Building a real-time transit information kiosk with Raspberry Pi

I’ve been playing with raspberry pi a lot lately and managed to make a real-time transit display for my kitchen. This shows the real-time arrival predictions for the transit routes near me, a map of the stops, the weather, and recent tweets from my roommates.

It was surprisingly easy to set up, so I’ll post the steps:

1. Get a raspberry pi

Raspberry pi’s are really popular, so it has been tricky to find a distrubutor with them in stock. I was able to purchase one in the US from MCM Electronics for $35.

2. Get some parts

You’ll need a few other parts, but you may already have some of these laying around:

4. Set up the pi

Once you have raspbian installed, put the SD card in your pi, connect the power microUSB to power, connect the keyboard and mouse and connect the HDMI cable to the DVI port on your monitor. You’ll also want to connect it to the internet via eithernet for this initial setup. The Raspberry pi will power on automatically and if you are lucky you’ll see the raspi-config setup screen.

You’ll want to do the following setup:

“expand-rootfs” – Expand root partition to fill SD card

“change_pass” – Change password for ‘pi’ user

“change_locale” – Change the locale to your area (default is Great Britain)

If you are connecting it to a monitor via DVI, you may want to force the pi to use its HDMI output (and not default to RAC). Edit ‘/boot/config.txt’:

hdmi_force_hotplug=1

Now, we’ll setup the wireless. We installed xvkbd, a virtual keyboard, so you can unplug the USB keyboard and plugin the USB wireless card.

Open the virtual keyboard xvkbd

Click on the Wifi Setup icon on the desktop

Click “Scan”, select your wireless network

Using the virtual onscreen keyboard, type in the wireless password

Restart the pi, and you are done.

$ sudo reboot

6. Access the display remotely

From the same network, you can SSH to the pi. First you have to figure out what its IP address is. You can do this using nmap or by logging into your router and showing all clients on your network.

# determine your computers local IP address
ifconfig
# scan all devices on your network (if your computer's IP is 192.168.1.49, for example)
sudo nmap -sP 192.168.1.*
# the raspbery pi may show up as manufacturer "unknown" if you are using wireless.
# Try sshing to each device you think may be the pi
ssh pi@192.168.1.144

Once you’ve successfully connected, you may want to reboot:

$ sudo reboot

You may want to restart chromium at some point:

# stop chromium
sudo killall chromium
# manually set the display to one that is currently being used
# start chromium in kiosk mode with the URL we want to load
# use nohup so it stays up after we disconnect
DISPLAY=:0 nohup chromium --kiosk --incognito bart.blinktag.com/?station=16TH &

7. Customize the display

All of the pi-specific stuff is done, but you need to choose what actually gets displayed. You can use my BART realtime display kiosk page or grab the source. You can link directly to a specific station’s page using ‘?station=16TH’ after the url.