Bus- und Bahn-Anzeige
Find a file
Stefan Bethke cc38689bfc
All checks were successful
docker-image / docker (push) Successful in 9m54s
Try to work with timezones
2025-06-10 22:23:44 +02:00
.forgejo/workflows Fix docker image 2025-05-31 11:10:14 +02:00
buba Try to work with timezones 2025-06-10 22:23:44 +02:00
docs Add sales brochure with some details about the displays 2025-06-03 20:49:18 +02:00
scripts Helper to auto deploy from cron 2025-06-02 20:10:33 +02:00
.gitignore Trials and tribulations 2025-05-30 22:34:10 +02:00
Dockerfile Fix docker image 2025-05-31 11:10:14 +02:00
poetry.lock Add CCCHH events 2025-06-02 21:54:55 +02:00
pyproject.toml Add CCCHH events 2025-06-02 21:54:55 +02:00
README.md Add more info 2025-06-02 18:06:06 +02:00

Bus- und Bahn-Anzeige (bus and train display)

This is the code to send information to the station display that is hanging in the hallway of CCCHH.

Documentation

The docs directory contains a number of documents about the device, all in German.

Development Environment

Use Poetry to manage a local environment:

poetry install

Local Development

You can run the server without having a physical display attached. The server will open HTTP port 3000 on localhost, and show an emulated display.

Deployment

The server is deployed as a Docker image and run with Docker Compose. See below for the configuration.

You will need to allow access to the serial port. For example, in compose.yaml:

services:
  buba:
    image: buba
    environment:
      BUBA_SERIAL: /dev/ttyUSB0
    devices:
      - /dev/ttyUSB0

Configuration

Buba is configured completely through environment variables:

Name Default Description
BUBA_LISTEN 127.0.0.1:3000 IP and port to listen on.
BUBA_SERIAL /dev/ttyUSB0 Serial port the display is connected to.
DEBUG false Set to any value except false to enable debug output.

Creating Animation Plugins

Buba instantiates objects of type BubaAnimation and runs through them in a loop. Each animation must implement the run() method, which should send data to the display. The animation is run in its own thread, therefor, the animation should sleep an appropriate time to let users take in the information. See the existing animations in buba/animations for inspiration.

Note: if you need to fetch and update external information regularly, you should start your own thread when initalizing your animation.

Character Set

The display uses Code Page 437, with a few exceptions. Due to the limited resolution of the segments, the display can deviate significantly.

Note that the Python codecs for CP437 do not map all special characters correctly.

Code CP437 Geavision Spaltenschrift
0xb4 ┤ u2524 Vehicle end left
0xb5 ╡ u2561 Vehicle end right
0xb6 ╢ u2562 Track
0xff   u00a0 Three full segments

In other displays, the vehicle ends can be used together with other special characters to show carriage information; this set seems to be missing those extra characters.