Mini-matrix: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
Marcus (talk | contribs)
Categorised
Line 111: Line 111:
=== Source code ===
=== Source code ===
The source code for the nanode firmware will be put on the Nottinghack github repo shortly; the code for the server side (nh-mini-matrix) component is in the Nottinghack instrumentation google [http://code.google.com/p/nottinghack-instrumentation/ code repo].
The source code for the nanode firmware will be put on the Nottinghack github repo shortly; the code for the server side (nh-mini-matrix) component is in the Nottinghack instrumentation google [http://code.google.com/p/nottinghack-instrumentation/ code repo].
[[Category:Projects]]

Revision as of 19:05, 23 April 2012

The mini LED matrix display in the blue room was donated by Michael Erskine, and is believed to be of the kind used in British Rail Class 465 trains (simply because the original logic board output the text "BRB Class 465" when first powered up...).

It has been re-purposed to cycle through:

  • The subject of the latest email to the Nottinghack google group
  • The last "!display <message>" from IRC via nh-holly
  • The latest tweet received by the twitter bot

When the door is opened by an RFID card, it will show who opened it for 15 seconds, and if the door bell is rang, it will flash the text "door bell" for 15 seconds (or until the door is opened - whichever happens first).

The original PSU and logic board have been removed - the power now comes from the same ATX PSU in the store room that is used to power gatekeeper and the full sized LED matrix display in the studio; the logic board has been replaced with a nanode.

The display is 16x192, and consists of a shift register and address lines to select the row. It relies on the display being constantly refreshed to maintain a static image (it is currently refreshed every 25ms).

Logically, the display has been split into 2x 8x192 segments, to show two lines of text.

The nanode firmware stores 4x 140 character message buffers - the intention being that two will be on screen (one per line), and two off screen to be updated by holly.


Interface

The nanode is physically connected to holly using Ethernet, and due to memory constraints, all communication is done using UDP/IP, not TCP/IP.

There are two message types sent from holly to the nanode; these are:

Set Buffer

Set text and options for a buffer (0-3). Assuming this isn't an active (on screen) buffer, the message won't be displayed until a Set buffer command is sent.

Byte 1 2 3 4 5+
B Options buffer data

The two digit options field can be made up of:

Scroll in 1 - Scroll in from the right (instead of showing the message fully on screen, then scrolling)
Scroll 2 - Continuously scroll the message
Instant display 4 - When switching to this buffer, don't wait for the previous message to scroll off screen first - switch immediately.
Flash 8 - when showing the message, invert the screen every ~500ms

E.g:
B201<ds1111> - Set buffer 2 to scroll in (then stop) the text "<ds1111>".
B212DOOR BELL - Set buffer 2 to show "DOOR BELL" flashing (inverting the screen every 500ms or so), and show instantly.

Show buffer

Set which buffer (0-3) is displayed on each line of the display.

Byte 1 2 3
S upper line buffer lower line buffer

E.g.
S01 - show buffer 0 on the upper line, and 1 on the lower line.

Both of the above messages can be sent to the display using netcat, e.g.:
$ nc -u 10.0.0.63 49168
B001Daniel
B103Hello World!
S01

Messages from nanode to holly

Temperature

The only message sent from the display nanode to holly is regular temperature reports from a DS18S20 sensor in the Snackspace fridge (temperature graphed by Cacti). At present, the nanode firmware can only support a single one-wire temperature sensor.

byte 1 2-10 11 12-19
T address 0x00 data

Addr is the address of the one wire sensor, and data is the data returned from the device. The data section is converted Celsius on holly, and published to nh/temp for nh-temperature to pick up and record.

Source code

The source code for the nanode firmware will be put on the Nottinghack github repo shortly; the code for the server side (nh-mini-matrix) component is in the Nottinghack instrumentation google code repo.