Skip to content
Chris edited this page Apr 12, 2021 · 43 revisions

Copyright (c) 2020-2021, Christian Heinrichs. All rights reserved.

Roc-MQTT-Display

Welcome to the Roc-MQTT-display Wiki! The content will be updated and completed soon, stay tuned!

What is Roc-MQTT-Display for?

It's a dynamic Passenger Information system for Model Railroad Stations controlled by Rocrail. Communicates with Rocrail via MQTT messages. A Lolin/Wemos D1 mini ESP8266 and a TCA9548A I2C Multiplexer can drive up to eight 0.91" 128x32 I2C OLED displays. Several D1 mini controllers can run together so the total number of displays is not limited. The goal was to create an easy to integrate, non expensive, scalable and flexible system of displays for railroad systems.

1. Architecture

Roc-MQTT-Display Architecture

2. Requirements

Hardware for one Roc-MQTT-Display controller

  • 1x Lolin Wemos D1 mini, Lolin Wemos D1 mini pro or a clone of them. It should be an ESP8266 with min. 4MB memory
  • 1x I2C Multiplexer TCA9548A
  • 1-8x OLED Displays 0.91“ 128x32 I2C

Software

3. Wiring

Roc-MQTT-Display Wiring

Breadboard Setup

4. Rocrail configuration settings to work with Roc-MQTT-Display

File / Rocview Properties... Enable „UTF-8“ Rocrail Enable UTF-8

File / Rocrail Properties...
Hostname: Enter here the IP address of your MQTT Broker
Rocrail MQTT IP

File / Rocrail Properties...
Define an MQTT Controller
Rocrail MQTT Controller

MQTT Controller Properties
Rocrail MQTT Props

Tables / Text...
Create a new text field

Tables / Actions...
Create an Action

Message Format sent from Rocrail text fields or other sources via MQTT

Format: ZZAMSG#Targets#Template#Station#Track#Destination#Departure#Train#TrainType#Message#Spare1#Spare2#

  • ZZAMSG: Identifier for relevant MQTT messages

  • Targets: Identifier for displays, D01 = Display01, D02=Display02, ..., can include more than one Display e.g.: D01D02

  • Template: Identifier for Template, T0 = Template 0, T1 = Template 1, ..., can include only one Template e.g.: T0

  • 0 - Station: Name of the station

  • 1 - Track: Track number

  • 2 - Destination: Destination city

  • 3 - Departure: Departure time

  • 4 - Train: Train number

  • 5 - TrainType: Train Type for Logo selection

  • 6 - Message: ** Flexible messages to display either static in the middle of the display or as a ticker at the top. ** A message in the middle: Example 1: ZZAMSG#D01#T0#Bhf01#1#####Zugdurchfahrt### ** A message ticker at the top

  • 7 - Spare1: For future features

  • 8 - Spare2: For future features

Rocrail Dynamic Text Variables can be used. Some of them have been tested but by far not all.

Roc-MQTT-Display specific Command Variables:

  • NTP Time {ntptime}
  • Rocrail Time {rrtime}

Example 2: ZZAMSG#D01#T0#Bhf01#1#####%lcid%###

For dynamic time use: NTP time: ZZAMSG#D01#T0#Bhf01#1#####{ntptime}### Rocrail time: ZZAMSG#D01#T0#Bhf01#1#####{rrtime}###

Clear Display D01 and D02
Example 3: ZZAMSG#D01D02###########

Example 4: ZZAMSG#D01#T0#Hamburg-Hbf#1#Bonn#10:22#ICE 597#ICE####

Example 5: ZZAMSG#D01#T1#Bhf01#1#Köln-Bonn#10:22#ICE 597#ICE#5min Verspätung###

Example 6: ZZAMSG#D01D02#T0#Station01#1#Bonn#10:22#IC 56#IC#5min delayed###

Stationname
Example 7: ZZAMSG#D01#T6#Bogenhausen#########

These are examples how to integrate Roc-MQTT-Display with Rocrail. All other sources that can generate the required MQTT messages will work as well.

5. Installation

  • Serial Monitor if needed: 38400 Baud
  • Firewall ports for OTA must be allowed
  • Install required libraries in your Arduino IDE or the IDE of your choise
  • Compile and Upload the RocMQTTdisplay.ino sketch
  • Important: Upload the files from the data folder via ‘Tools/ESP8266 LittleFS Data Upload’ !!! If this option is not available install the plugin from here: ESP8266 LittleFS Data Upload Tool Do NOT use ‘Tools/ESP8266 Sketch Data Upload’, it will not work. It was for the on ESP8266 deprecated SPIFFS file system.

6. Configuration

  • Preconfigure 'rmdsec.txt' from the data folder with your WIFI SSID and WIFI Password
  • Launch web based configuration via ‘http://your controller IP address’
Clone this wiki locally