This MicroPython code, executed on an ESP32 OLED SSD1306 board, displays departure tables by utilizing the VVS Rest API (META EFA)
MIT License
_|_|_| _|_| _|_|
_|_| _|_|_| _|_|_| _| _| _| _|_| _| _|_|_|
_|_|_|_| _|_| _| _| _|_| _| _|_|_|_| _|_|_|_| _| _|
_| _|_| _| _| _| _| _| _| _| _|
_|_|_| _|_|_| _|_|_| _|_|_| _|_|_|_| _|_|_| _| _|_|_|
_|
_|
The aim of this project is to display the departure data of one or more VVS stations (Haltestellenmonitor) on an ESP32 microcontroller equipped with an Oled SSD1306 display. VVS is the Stuttgart public transport system. VVS provides the current timetable of relevant stations by a public available REST endpoint. Micropython is the programming language of choice for this project.
Here is what you get when you deploy the application on your ESP32 board:
The top line contains the current time. The other lines hold the tram/bus line number, the departure time, the delay and the short name of the station (RH, SMi). (The relevant tram/bus lines and stations are configurable within a configuration resource)
Please note that the hosted version of the public REST endpoint (metaEFA) used by this project is not available anymore. Information on hosting a MetaEFA server yourself can be found at https://github.com/opendata-stuttgart/metaEFA.
Links:
This is just a brief description of what steps have to be performed to enable the development of this application. Please consult Google to get in-depth details.
git clone https://github.com/aschuma/esp32_ssd1306_metaefa.git
cd esp32_ssd1306_metaefa/
virtualenv py3 -p $(which python3)
source py3/bin/activate
ampy
, rshell
)
pip3 install -r requirements.txt
esptool.py --port /dev/cu.SLAB_USBtoUART flash_id
esptool.py --port /dev/cu.SLAB_USBtoUART erase_flash
esptool.py --port /dev/cu.SLAB_USBtoUART write_flash -z 0x1000 <path-to-downloaded-image>
screen /dev/cu.SLAB_USBtoUART 115200
After that, you will be connected to the micropython shell running on the board.Ctrl-A
, K
and y.
rshell -p /dev/cu.SLAB_USBtoUART
The files on the board should be available locally at /pyboard
on your dev machine.cp
command. More details are available here: https://github.com/dhylands/rshell
Please be aware that you can not use multiple shells simultaneously to the access the board.
src/config.py.template
to src/config.py
and adjust at least the wifi settings.src
to the root directory of the board using the rshell
tool or the ampy
tool.
screen /dev/cu.SLAB_USBtoUART 115200
press CTRL-C
and CTRL-D
to trigger a reboot. Then you should see some log messages.Be aware that my primary coding language is not python. So please forgive me my bad coding style. I'm still learning python and ESP32 development.
Please feel free to issue a bug report or submit a PR. Any helping hand is welcome.