How to make the live streaming Christmas Tree Game. // Project


Installing

Next to install the whole thing onto the Christmas tree. First the UpBoard with Ethernet, power, Teensy USB and two cameras to be used for the YouTube live streaming.

Next arrange the LED strips on the tree

and connect them up to the little black box, then the juice from the power supply.

There you go. Nothing can go wrong! All safely hidden away at the top of a bookshelf.

I attached one camera to a mike stand pointing at the lower half.

and another attached to the bookshelf on a stick pointing at the top half.

Once everything was powered up I logged in remotely to the Up Board and ran an Xdesktop to VNC redirect, which allowed me to see what was going on the desktop…

nohup x11vnc -display :0 -reopen -zeroconf -nolookup -loop </dev/null &

…and the all important TCP port to TTY redirect. Socat is really the Swiss Army Knife tool of choice here.

nohup socat -gx TCP-LISTEN:1234,fork,max-children=10,reuseaddr OPEN:/dev/ttyACM0,b115200,flusho=1,raw,readbytes=1 </dev/null &

This will:

  • listen on TCP port 1234 for connections and redirect input and output to the Teensy serial port.
  • fork – means that for every inbound connection create sub-procss to handle it.
  • max-children – is set to 10 as we only have ten Elves.
  • flushno=1 – will flush all I/O.
  • raw – raw means that we don’t want any complicated handshake.
  • readbytes=1 – and this will limit the amount of data to only 1 byte, as that’s all we should be getting anyway.
  • The “nohup” will ensure that when I exit from this login the process won’t be killed.
  • </dev/null – I’m also further guaranteeing no funny business by redirecting standard input away from the login session.

Next on to YouTube live streaming. I used the rather excellent Open BroadCast software. This allows you to combine all sorts of input streams like static images, rotating image files, and video streams.

First of all you will need to obtain the live stream key from the YouTube Creator Studio

and place this key here.

I had to fiddle around with the streaming bit rate as Ozzie Internet is pretty hopeless and I could only really stream at 1Mbit/s. I tried to reduce latency as much as possible, but was still stuck with a 10 second delay. Oh well.

Once everything configured just click on “Start Streaming” and you’re live! Easy!