Newer
Older

CCC Berlin information sign protocol

Date: 2024-03-19 00:30
Tags: bad-apple, cccb, cccb-airport-sign

In the entrance room at Chaos Computer Club Berlin is an airport- or train-station-style information screen.
If you are connected to the club network, you can send UDP packets to 172.23.42.29:2342 to control it.
There is no need to turn it on. The screen will turn on when you display something on it, and turn off after several minutes of inactivity.

The screen consists of 20 sections; each is 448 pixels wide by 8 pixels high. Between each section is a physical gap that's about 4 pixels high.
In text mode, there are 20 lines (indexed 0-19) of 56 characters (indexed 0-55) each.

There's also a web server on port 80, which seems to crash if used too heavily, but allows you to input text in a web browser.

Each 8x8 pixel section has a luminance setting, but I don't know anything about it.

The maximum UDP packet size is said to be 1450 bytes due to the embedded OS not supporting IP fragmentation.
Multi-byte numbers are big-endian.
All the packets you need are:

Write text

2 bytes: 0x0003 (packet type)
2 bytes: left coordinate of selected rectangle
2 bytes: top coordinate of selected rectangle
2 bytes: width of selected rectangle
2 bytes: height of selected rectangle

followed by some bytes of ASCII text data in the obvious order to fit within the specified rectangle.

Write graphics data

2 bytes: 0x0012 (packet type)
2 bytes: offset in data buffer
2 bytes: length in data buffer
2 bytes: 0x0000 (padding)
2 bytes: 0x0000 (padding)

followed by <length> bytes of graphics data. The graphics buffer holds 1-bit pixel data in the obvious order. Each byte contains 8 consecutive horizontal pixels per byte, with the most significant bit controlling the leftmost pixel.

Page flip

2 byte: 0x0011 (packet type) 2 bytes: 0x0000 (padding)
2 bytes: 0x0000 (padding)
2 bytes: 0x0000 (padding)
2 bytes: 0x0000 (padding)

After updating the graphics buffer, you need to send this to display the current contents on the screen. This allows the whole screen to be updated in multiple packets without tearing. Remember the maximum packet size isn't long enough to update the whole screen in one packet.

Bad Apple

Here's the sign playing Bad Apple. The bottom section is cut off due to not taking the gaps into account properly, but it still looks okay.
Youtube / Original quality H264/Opus (300MB) Reduced quality H264/AAC (5MB)