MQTT Stopwatch / Display
MQTT Stopwatch / Display
Parts to Buy
Parts to 3d Print
Mechanical Assembly
CircuitPython Setup
Software
The Secrets File
The Config File
Message Protocol
Setup Your Own Broker
Extending
Message Protocol (MQTT Stopwatch / Display)
This device responds to MQTT messages on the following topics. Note that it is a "read-only" device and does not publish (send) any messages at all.
Topics specific to the stopwatch
Note that none of these topics expect any "payload" content. The presence of a message on the specified topic is sufficient (although the presence of a payload will not cause an error).
Topic | Payload | Notes |
---|---|---|
stopwatch/start | (none) | clears and starts the timer |
stopwatch/stop | (none) | stops the timer |
stopwatch/clear | (none) | clears the timer (0:00) |
General Topics
These topics represent info being sent back to the remote controller (operator) by the robot.
Note that the robot name (as represented in red in this table) is optional to help in an environment where multiple robots are playing. The configuration file has a parameter to specify the name to which the unit will respond, and it may be blank. If used, this robot name is actually part of the topic name.
Topic | Payload | Notes |
---|---|---|
robot4/info/warning | any text | text message to be displayed RED |
robot4/info/status | any text | text message to be displayed (see notes below) |
robot4/info/battvolts | 11.4 | display battery voltage on bottom line |
Note that a "warning" message is displayed on the bottom line of the display, in red. On a 2-panel display, 22 up to 22 total characters will be displayed.
Generally, a "status" message is displayed on the bottom line of the display, in blue. If the message has a colon (":") in it, the portion before the colon will be displayed (in orange) to the right of the time display, possibly split into 2 lines favoring the first space as the split point; the portion after the colon will be displayed on the bottom line, in blue.
A "battvolt" message is displayed on the bottom line of the display, in green. Note that the payload should start with the voltage as a number, as shown above. The payload may have additional characters following the number, which are ignored. Note that if additional characters are added, there must be a least one space character terminating the number. Note that the battery voltage is only displayed if the timer is running, and if the configuration parameter (in the config file) "want_battery_message" is set to True.
Specialty Topics
These topics represent commands being sent from the remote controller (operator) to the robot. The display's response to these commands is optional, and is controlled by the "want_specialty_cmds" in the config file. All of the topics generate the same message on the bottom line of the display, in purple. This message is controlled by the "specialty_banner" in the config file
Note that the robot name (as represented in red in this table) is optional to help in an environment where multiple robots are playing. The configuration file has a parameter to specify the name to which the unit will respond, and it may be blank. If used, this robot name is actually part of the topic name.
Topic | Payload | Notes |
---|---|---|
robot4/control/joyYL | any text | specialty banner is displayed PURPLE |
robot4/control/joyXL | any text | specialty banner is displayed PURPLE |
robot4/control/joyYR | any text | specialty banner is displayed PURPLE |
robot4/control/joyXR | any text | specialty banner is displayed PURPLE |
Additional Background
The following offsite links provide useful backgound info on the general structure of MQTT messages.