Use a Raspberry Pi to develop a stand alone Twitter appliance that can be used to display tweets in a public environment.
Every two years, Letchworth and Baldock District Scouts holds its Arts and Crafts competition. This year, it was decided to hold it in a pop-up shop in Letchworth town centre. The theme was Adventure.
The Scouts in my troop, 5th Letchworth, decided it would be a good idea to have a multi-media display; comprising a physical hashtag and a display of tweets containing that hashtag. The hashtag was, of course, #5thLetchworth.
The Scouts constructed the physical hashtag and decorated it with pictures, poems and other items that conveyed the notion of adventure. It was my task to create the twitter display.
The obvious base for the display was a Raspberry Pi! of which I have several. This would be connected to a large screen TV via the built in HDMI interface, and to the Internet via my own Mi-Fi.
Configuring the Pi
As the basis of the system, I chose to stick to the stock Raspbian distribution as it has almost everything I needed. The only changes I needed to make were to set it to startup in headless mode and allow remote VNC connections (because there wouldn’t be a keyboard or mouse connected when the system was in use). I also had to set it to auto-start Chromium.
Setting the Pi to startup in headless mode
To do this, you need to install the x11vnc package.
- Logon as the default user pi
- Open a terminal session and download the x11vnc package:
sudo apt-get update
sudo apt-get install x11vnc
Set a password for when you attach via your VNC client.
Create a startup configuration for x11vnc. From your home directory:
Now use your favourite editor to create the file
x11vnc.desktopwith the following contents:
Exec=x11vnc -forever -shared -usepw -display :0 -ultrafilexfer
- Now reboot the Pi
- After it has rebooted, you should be able to use your favourite VNC client to connect to the IP address of the Pi on port 5900 using the password set it step 3.
Installing and autostarting Chromium
- Open another terminal session and install chromium.
sudo install chromium
- Create the file
chromium.desktopwith the following contents:
- If you now reboot again, the chromium browser should open automatically
Setting Chromium to open www.twitterfall.com automatically
For this to work, you need to authenticate to a twitter account and decide in advance what you wish to display. In my case I wanted to display the output from a specific Twitter List.
Complete the following in the chromium browser:
- Open the URL www.twitterfall.com
- Authenticate to the Twitter account.
- Set Twitterfall to display the appropriate content
- Copy the full URL from the chromium address bar; including the
- Now open a terminal session and edit the file
~/.config/autostart/chromium.desktopand change the
Exec=line to be
- Save and close and then reboot to test.
Starting Chromium in kiosk mode
The last step is to set Chromium to start in Full Screen mode
~/.config/autostart/chromium.desktopagain and change the
Exec=line again to be:
Exec=chromium -kiosk twitterfall.com/?oauth_token=whatever
- Reboot again and it should all work.
One last thing
You will have noticed that Twitterfall cannot be configured to launch in Presentation Mode. This is why you need the remote VNC connection.
I was going to have my MacBook Air with me when I installed this so I simply connected remotely and clicked on the Presentation Mode button in Twitterfall. If anybody knows how to avoid needing to do this, I’d love to hear from them.