How to build a photobooth with Elixir+Nerves?

It has been quite smooth sailing so far.

  1. Installing Phoenix on a Nerves system is a breeze.
  2. Working with the Raspberry Pi camera using Picam is quite easy.
  3. Using the Kiosk mode is okay, but you will really need the FTDI/UART to USB cable to debug it (since the screen will obv. only show the kiosk webpage).

Only (super minor) gotcha’s I’ve had are:

  1. My router does not seem to like Rpi’s, so connecting using WLAN is not possible over there (I now use my mobile phone as hotspot).
  2. The kiosk connects using the internet connection :nerves_network, :iface rather than whatever you’ve set up as default in your :nerves_network, :default configuration.
  3. The kiosk will only load a local page (like the local phoenix) when using IP address 0.0.0.0. I don’t know why but 127.0.0.1 and localhost will result in an ERR_NETWORK_CHANGE error page in the webkit kiosk browser.
  4. The Picam library has a nice example of streaming camera images to the browser using an mjpg stream. This works fine when connecting to the Pi with an outside device (and using that device’s browser), but the kiosk webkit variant will only load the first frame of the stream.

Currently I’m investigating other ways to load the camera feed as a ‘stream’. Now fetching individual images in an interval, although I think that sending JPGs over a persistent websocket connection (a Phoenix channel) might be faster.

4 Likes