-
1Setup Instructions (OSX)
To begin, the guerillaClock requires the basic set of Raspberry Pi components. And if this is the first time configuring a Raspberry Pi, then the Foundation's instructions are a recommended resource.
Prerequisites:
- Raspberry Pi + power
- Keyboard
- Monitor + HDMI cable
- SD Card
- Wifi access
- NYC MTA API key (Requires registration)
- 6 digit stop code for desired bus stop
The overall steps, from Raspbian installation to `git clone`, are listed below. While the steps may be condensed, they are the basic steps required to bring guerillaClock online.
- Download and install Etcher to "burn" the Raspbian OS to the SD card
- Download Raspbian (Stretch Lite), the official OS for Raspberry Pi's, from raspberrypi.org
- Open Etcher and select the downloaded copy of Raspbian, the SD card (if not automatically pre-selected), and click Flash
- Power-on the Raspberry Pi with the newly flashed SD card
- Login with the default credentials (username: pi / password: raspberry)
-
2Configure the Raspberry PI
Type sudo raspi-config and run through the following configuration steps:
- Change User Password (this will be a Wifi enabled device)
- Network Options (select a unique hostname and enter your Wifi network details)
- Boot Options (the console requiring user login is recommended)
- Localisation Options (change the timezone and keyboard layout to your locale)
- Interface Options (SSH is recommended to allow remote administration)
- Advanced Options (Expand File system is net necessary but recommended)
- Update
- Disable audio (Explanation)
- Type sudo nano /boot/config.txt
- Change the line (usually the last in the file) "dtparam=audio=on" to "dtparam=audio=off"
- Type sudo apt-get update and sudo apt-get upgrade to pre-installed software is up to date
- Type sudo apt-get install python-pip to install Pip, the Python package manager
- Reboot
-
3Install guerillaClock
- Update apt's package list by typing sudo apt-get update
- Type sudo apt-get install git-core to install Git
- Type git clone https://github.com/klinstifen/guerillaClock
- Type cd guerillaClock to enter the guerillaClock subdirectory
- Type nano config.ini and enter the following to create the config file
[main] key = <your MTA API key> stopID = <desired bus stop code>
-
4Install the required Python packages
- Type the following:
- sudo pip install requests
- sudo pip install python-dateutil
- sudo pip install pytz
- Type the following:
-
5Install guerillaClock's submodule
From within the guerillaClock subdirectory perform the following:
- Type git submodule init and git submodule update to install the rpi-rgb-led-matrix submodule
- Type cd rpi-rgb-led-matrix to enter the submodule subdirectory
- Type the following to install Python support (More information)
- sudo apt-get install python2.7-dev python-pillow -y
- make build-python
- sudo make install-python
-
6Configure guerillaClock to run at boot
- Type sudo nano /etc/rc.local
- Add the following above the line that says "exit 0":
#guerillaClock auto-start cd /home/pi/guerillaClock && sudo python guerillaClock.py
-
7More Information and Troubleshooting
The results of each MTA Bus Time query are written to the guerillaClock.log. This file can be useful for troubleshooting purposes or to run guerillaClock in a headless configuration.
While guerillaClock is running, perform the following to monitor the log:
- Type cd guerillaClock (if not already within the guerillaClock subdirectory)
- Type tail -f guerillaClock.log
The continuous output will list all the buses enroute, on layover, or at the terminal. The "next bus" is found by simply comparing the arrival times. The bus with the earliest arrival time is selected as the "next bus". And the bus line along with the estimated arrival time are displayed on the matrix.
If you encounter any errors, make sure you are running the latest version of guerillaClock by typing git pull from within the guerillaClock subdirectory.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.