Tuesday, 7 March 2017

BirdBox2017: a few problems

This system was deployed just over a month ago and has been visited by blue tits almost every day.

It is basically doing its job by recording lots of video clips of both the inside and outside views of the bird box, which is mounted on the side of our pergola.

However, it does have a couple of problems that are rather annoying.

The hardware, the operating system, and a few of the applications are either new or upgraded from previous years. And this is the prime source of my problems.

The internal box system is triggered by a bird breaking the beam at the entrance hole, which causes the Picaxe to turn on the power to the Raspberry Pi. The Pi then has a limited amount of time to boot and run my Gambas app which starts kicking the Picaxe, to stop it shutting the power down.

longer boot times

Unfortunately the newer version of Raspbian (Jessie) seems to have a longer, and less reliable, boot time than the older version (Wheezy). Every 'n' times it runs a check on the file system before booting, and sometimes gets delayed by some dhcp service.

Consequently the system sometimes shuts down within the first 2 or 3 minutes, because the Pi has not had enough time to boot up and start kicking the Picaxe. It is not easy to re-program the Picaxe with a longer delay time, and I really can't be bothered to take the bird box down at this stage to do it.

data files not updating

Although the system is saving video files and my Gambas app can write data files to the SD card, these data files are not reliably updating. To clarify, if I delete an app data file, a new one will be created the next time data is ready to be stored, and new data will continue to be appended to the file for a while. But at some point the system stops updating the file with new data.

The Gambas app performs a file Append, the file modified date (i.e. in file manager) shows the correct time and date, but the new data is not actually in the file!

Nothing makes sense. If it were a bug in Gambas Append, it would probably just create a new file (after I delete the original) and then never update. But it always continues to update during the same session. Its not a file size thing, its not a permissions thing, I just have no idea at the moment.

video play-back pause

The system is set to create mp4 video when running 'motion'.  When I play back these clips, the player shows a play time (e.g. 1m 20s) but does not play continuously for 1m 20s. It typically plays for a while, pauses, then plays again. So the whole 'performance' takes 1m 20s, but the "action" may only last for (say) 30s within that 1m 20s window.

Now I thought I'd used mp4 encoding in the past, but maybe I need to check this. Either way, its very annoying.


I keep wondering if I'm getting any benefits from using motionEye. I suspect not.

I've reverted back to using an html page on my monitoring computers, as I can get my BirdBoxMonitor Gambas software to turn on a web browser (i.e. when a box system is triggered) and display the video streams side-by-side. So I'll probably drop motionEye in the future.

using Chromium web browser to view side-by-side video streams

However I'm still using the raspimjpeg.py to stream at 15fpm (when I have time to just sit and watch!).

battery monitor

This is the good news, the battery monitor is working well. The disadvantage of relying on the battery voltage to determine charge is that as the batteries age, so the characteristics seem to change. The fully charged terminal voltages for my 3 batteries were (the last time I checked); 12.5V, 13.1V & 13.8V. So when I connect a freshly charged battery to the system I may get anything from 65% to 100% indicated.

However, each battery seems to last a similar amount of time before dropping below 30% and being replaced by the next.

camera lens hood

One thing that can spoil the quality of the RaspiCam is sun getting into the lens. With the sun shining onto the lens glass, but not actually in the picture, the image contrast is seriously degraded.

To make matters worse I wanted to point the external camera in a southerly direct so that the side-by-side images from the two cameras made sense on the monitor.

My solution to the terrible lens flare was to fit a simple lens hood. Initially this was a piece of card attached with BluTac. But Hurricane Doris took that away...

...so I cut a piece of black plastic from a food tray and fixed it on with a screw, 2 washers and a nut.

The Bottom Line

On balance I have decided NOT to upgrade my second bird box, as this was developed during the winter of 2013/14 and has been very successful every season since. So sometime before the end of March, this is going back onto the trunk of the maple tree without any modifications.

But as far as the currently installed box goes, I need to eventually use a fast booting operating system like ArchLinux and re-write the application code in Python... maybe next winter.

No comments:

Post a Comment