So I decided that it would be nice to check the chickens aren’t hanging out on the ladder, stuck, if the automatic door closes early, which has happened before.
I’d like a second camera that shows a more wideangle view, and frankly, a third camera that is inside the coop. All of which are possible (although the power demands may be…pushing it a bit).
So, I thought, I’ll install a nice fresh OS on my Raspberry Pi 2B which is sat around collecting cruft, and I’ll pop my old USB webcam on it (because the PiCam I got draws too much power which is why this hasn’t happened ’til now). Easy.
It’s taken most of my spare time from two days.
First up, the venerable Pi2 doesn’t have on-board WiFi. Easy, I thought. I’d already got a plan for this – I had a USB WiFi dongle. Only…when I added it, it didn’t work. After combining multiple things, and trying a wide variety of configurations (basically you need to configure both the network and wpa_supplicant and then fuck around for ages) eventually it randomly seemed to work.
It kept working through several reboots including a couple of power-cycles so I declared it okay. Then I installed Motion. That went okay. Except that for some reason with this camera, when it first starts if it’s in the boot process or running as a daemon, the image is corrupt. If you stop the service and restart it it’s fine. If you start manually it after booting, it’s fine. But if you start it as a service or within the boot process – it doesn’t work.
After about an hour of trying to work out what was going on or find some fix that would work, I gave up and decided that maybe I should just install motioneye which is what Nikki uses. Unfortunately, when I imaged the SD card…I actually imaged the SD card reader.
I didn’t realize, because I’m a pillock, so then I nuked the card to install MotionEye, which it turns out doesn’t talk to WiFi dongles. Doesn’t even give you a chance to configure a WiFi dongle. Just endlessly reboots.
So then I tried to put the stuff I’d done back on the card – and discovered that lo, I’m an arse. So then I started again this morning (after epically failing to get it working last night). After several hours of failure it randomly started working – and seemed to be working…and then I installed Motion, and it stopped working. Then it stopped detecting the USB WiFi. Then it would detect it but not connect to the network (which is what it was doing before).
After an hour or so of swearing at it I decided that maybe the WiFi dongle was faulty, and off I went to get a new dongle. I did a bunch of other errands, came home, and discovered that no, the WiFi dongle isn’t faulty.
Eventually I gave up and decided to pull apart my Mycroft prototype to yank its Pi3. That has *on board* WiFi.
Yay, I thought. I have a solution – only, yeah, it did work better. Configuring it through the raspi-config did work in the end. Getting Motion up and running was the same – and ended at the same point. It would be corrupt when it started.
Eventually my ‘solution’ to this (if you can call it that) was to add a script which starts motion, stops motion, then starts it again. Yes, it’s very very stupid.
However, it works.
Then I threw it into some food boxes. I have done some pretty ropey prototypes over the years, but this may take the biscuit. Or possibly the hummus and microgreens.
But when all’s said and done, it is working.
The chickens are, still, refusing to eat food from the feeder though, which is frustrating and concerning.