Saturday, 15 June 2019

How to make a mini bird box monitor

It's all very well having a bird box camera that you can view on a PC/ipad/etc, I wanted an unobtrusive static monitor, so I made one

My little Elf Helpers demonstrating their bird box monitor

Some prerequisites....

  1. Bird box camera live streaming to your local network that can be viewed via a web-browser on a PC / ipad / other tablet computer.
  2. In my case I use Pikrellcam software running on a Raspberry Pi-equipped bird box with raspberry pi camera module (see a recent blog post on the nest that is showing on this ).
  3. In the picture above I've used a HyperPixel 4.0 screen from Pimoroni, which is plugged into a Raspberry Pi 3 Model A+, in a case to protect it.  Pimoroni have comprehensive setup instructions.

My normal way of monitoring this box on a PC using pikrellcam looks like this...

To get a minimal interface, you need to switch the Raspberry to 'kiosk mode'.  This means that when it boots up, it loads a specific website and removes extraneous stuff from the active window such as mouse cursors, scroll bars and distracting error messages.  This is the same approach that you get in applications such as photo booths, cash dispensers etc.

I modified a method from the website.  There are probably other ways of achieving the same end.  I'm also assuming that you're familiar with entering commands via SSH.  Google it if you don't know how.

Brief summary...

Make a file called
nano /home/pi/

Install dependencies
sudo apt-get install xdotool unclutter sed

Add this to the file.  Substitute 'http://xxxurlToYourWebCam' with your local URL

xset s noblank
xset s off
xset -dpms

unclutter -idle 0.5 -root &

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences

/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk http://xxxurlToYourWebCam  &

Interestingly if you're doing his setup over SSH, if you run sh from an SSH terminal window on another machine the kiosk wont start.  Probably as the active SSH session cant find a screen.  If you run it directly on the Pi with connected keyboard it works fine

Most of the following is copied verbatim from 'how to' the link above, with a couple of changes

Run script from command line using service file
sudo nano /lib/systemd/system/kiosk.service

Add the following text to this file:
Note that using the hyperpixel, this only works if 'Type=simple' is changed to 'Type=forking' (as suggested in the commentary at the end of the above article)
Description=Chromium Kiosk

ExecStart=/bin/bash /home/pi/


Enable, then start the service
sudo systemctl enable kiosk.service
sudo systemctl start kiosk.service

Check status like this
sudo systemctl status kiosk.service

There's loads more detail on but I've just listed the modified version I did to make it work.

One more thing....

There's some sort of bug/security procedure combo affecting the chrome web browser boot up time, such that it wont load chrome browser until it generate sufficient 'Entropy' in particular when there is no keyboard connected.  Seriously.  I think this has something to do with random number generation & cryptography and reflects how 'secure' the machine is.  Or something.

Anyway, the effect is that our kiosk wont load for several minutes after boot, which is a pain especially if you need to do a quick demo.

There's a solution detailed here:
I'm not vouching for the relative safety or what it does (use at your own risk etc...)

sudo apt-get install haveged
sudo systemctl enable haveged
sudo systemctl start haveged

After all that I have a stand-alone Pi with screen that boots directly to my bird boxes webpage :)


  1. Replies
    1. Was standing next to the crate of lego when looking for some way of getting scale across.... :)