Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonprickett/nextmetro
Next DC Metro from Wiehle-Reston East Station
https://github.com/simonprickett/nextmetro
python raspberry-pi wmata-api
Last synced: 6 days ago
JSON representation
Next DC Metro from Wiehle-Reston East Station
- Host: GitHub
- URL: https://github.com/simonprickett/nextmetro
- Owner: simonprickett
- License: mit
- Created: 2015-01-16T03:28:04.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-04T23:24:05.000Z (almost 10 years ago)
- Last Synced: 2024-10-29T15:49:21.759Z (about 2 months ago)
- Topics: python, raspberry-pi, wmata-api
- Language: Python
- Homepage: https://simonprickett.dev/
- Size: 316 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nextmetro
Next DC Metro from Wiehle-Reston East StationTODO Write up notes on configuring Raspberry Pi, required hardware etc.
TODO:
* Auto login as root
* Configure wifi
* Set WMATA_API_KEY
* Install Python dependencies
* Install Python code
* Set to run on boot
* TestAUTO LOGIN:
```
sudo vi /etc/inittab
```Find:
```
1:2345:respawn:/sbin/getty —noclear 38400 tty1
```comment it out #
Add below:
```
1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1
```Save, exit, reboot to check
CONFIGURE WIFI:
(assuming root login, pi booted with wifi adapter plugged in)
```
vi /etc/network/interfaces
```Should look like:
```
auto loiface lo inet loopback
iface eth0 inet dhcpallow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
```Save and exit.
(assuming root login)
```
vi /etc/wpa_supplicant/wpa_supplicant.conf
```assuming WPA2 setup...
```
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=“NETWORK SSID"
psk=“NETWORK PASSWORD"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
```Save, exit reboot
Once rebooted, test:
```
ping google.com
```Should return pings.
SET WMATA API KEY
As root:
```
vi ~/.profile
```Add line at the bottom:
```
export WMATA_API_KEY=your_api_key
```Save and exit.
Reboot. When logged in as root test, by:
```
echo $WMATA_API_KEY
```Should return your key.
INSTALL PYTHON DEPENDENCIES:
(as root)
```
apt-get update
apt-get install python-pip
apt-get install python-dev
pip install requests
pip install schedule
pip install unicornhat
```INSTALL UNICORN HAT STUFF
get their github
run install scriptINSTALL PYTHON CODE:
(as root)
```
cd
git clone https://github.com/simonprickett/nextmetro.git
```TEST:
(attach unicorn hat)
(as root)
```
cd ~/nextmetro
python nextmetro.py
```AUTO RUN ON BOOT:
As root
Add to ~/.profile:
```
/usr/bin/python /root/nextmetro/nextmetro.py
```