MQTT Topics: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
This is the list of MQTT Topics that are use by the various [[HackSpace_Instrumentation|HackSpace Instrumentation]] projects.
This is the list of MQTT Topics that are use by the various [[HackSpace_Instrumentation|HackSpace Instrumentation]] projects.
All of these are available on [[holly]], and most are available on [[JARVIS]] via an MOTT/[http://mosquitto.org/ mosquitto] bridge.


All topics should be prefixed with "nh/"
All topics should be prefixed with "nh/"


==STATUS==
==STATUS==
nh/status<br/>
nh/status/req<br/>
All clients should subscribe to the topic and listen for the message "STATUS"<br/>
All clients should subscribe to this topic and listen for the message "STATUS"<br/>
Clients should respond with there name and status.  
Clients should respond on nh/status/res with their name and status.  


Three states  
Three states  
Line 24: Line 26:
*nh-matrix
*nh-matrix
*GateKeeper (process)
*GateKeeper (process)
*nh-gk-if
*nh-irc-misc
*nh-irc-misc
*nh-temperature
*WorkshopMQTT
*nh-vend


The status of all running clients is logged and reported here http://lspace.nottinghack.org.uk/addr_graphs/status.php
The status of all running clients is logged and reported here http://lspace.nottinghack.org.uk/addr_graphs/status.php
Line 36: Line 40:
! Notes
! Notes
|-
|-
| nh/gk/Unlock || ||
| nh/gk/Unlock || Shows message on LCD / unlocks door || Not available on Jarvis
|-
| nh/gk/DoorState || "Door Opened", "Door Opened by:" or "Door Closed" ||
|-
| nh/gk/entry_announce/known || "Door Opened by: ''username'' (last seen ''xxx'' ago)" || Sent by Gatekeeper process on receiving "Door Opened by:"
|-
|-
| nh/gk/DoorState || ||
| nh/gk/entry_announce/unknown || "Door opened" || Sent by Gatekeeper process
|-
|-
| nh/gk/Keypad || ||
| nh/gk/Keypad || PIN entered || Not available on Jarvis
|-
|-
| nh/gk/DoorButton || OUTER|INNER|REAR payloads for different doors || Each should create a different tone
| nh/gk/DoorButton || "OUTER", "INNER" or "REAR" for different doors || Doorbell. 1 ring=Inner, 2=Outer, 3=Rear
|-
|-
| nh/gk/RFID || ||
| nh/gk/RFID || Serial of RFID card presented, or "Unknown Card Type" || Not available on Jarvis
|-
|-
| nh/gk/LastManState || ||
| nh/gk/LastManState || "First In" or "Last Out" || Knife switch by door. There is an intentional delay between the switch being thrown, and publishing to this topic
|-
|-
| nh/gk/Status || ||
|}
|}


Line 61: Line 68:
|-
|-
| nh/mb/rx || confirmation of displayed message is returned to nh-matrix||
| nh/mb/rx || confirmation of displayed message is returned to nh-matrix||
|-
| nh/mb/Status || deprecated in MattrixMQTT 004 but still used via nh-matrix ||
|}
|}


Line 106: Line 111:


==[[Temperature Monitoring|Temperature]]==
==[[Temperature Monitoring|Temperature]]==
Readings from DS18B20 1-Wire digital temperature sensors around the space are published every 2.5 minutes.<br />
Readings from DS18B20 1-Wire digital temperature sensors around the space are published at least every 2.5 minutes.<br />
nh/temp<br>
nh/temp<br>
Message format as follows<br/>
Message format as follows<br/>

Revision as of 01:15, 29 September 2013

This is the list of MQTT Topics that are use by the various HackSpace Instrumentation projects.

All of these are available on holly, and most are available on JARVIS via an MOTT/mosquitto bridge.

All topics should be prefixed with "nh/"

STATUS

nh/status/req
All clients should subscribe to this topic and listen for the message "STATUS"
Clients should respond on nh/status/res with their name and status.

Three states

  • Restart:
  • Running:
  • Terminated:

ie. "Running: MatrixMQTT"

Include the : and a space before the clients name,

Current list of clients

  • MatrixMQTT
  • Gatekeeper (arduino)
  • nh-irccat
  • nh-irc
  • nh-matrix
  • GateKeeper (process)
  • nh-irc-misc
  • nh-temperature
  • WorkshopMQTT
  • nh-vend

The status of all running clients is logged and reported here http://lspace.nottinghack.org.uk/addr_graphs/status.php

Gatekeeper

Topic Description Notes
nh/gk/Unlock Shows message on LCD / unlocks door Not available on Jarvis
nh/gk/DoorState "Door Opened", "Door Opened by:" or "Door Closed"
nh/gk/entry_announce/known "Door Opened by: username (last seen xxx ago)" Sent by Gatekeeper process on receiving "Door Opened by:"
nh/gk/entry_announce/unknown "Door opened" Sent by Gatekeeper process
nh/gk/Keypad PIN entered Not available on Jarvis
nh/gk/DoorButton "OUTER", "INNER" or "REAR" for different doors Doorbell. 1 ring=Inner, 2=Outer, 3=Rear
nh/gk/RFID Serial of RFID card presented, or "Unknown Card Type" Not available on Jarvis
nh/gk/LastManState "First In" or "Last Out" Knife switch by door. There is an intentional delay between the switch being thrown, and publishing to this topic

MatrixMQTT

Topic Description Notes
nh/mb/tx nh-matrix script transmits messages to be displayed
nh/mb/rx confirmation of displayed message is returned to nh-matrix

IRC Bot: nh-holly

Living in #nottinghack on freenode, nh-holly is our MQTT to IRC bridge

Topic Description Notes
nh/irc/tx Sends to the default #nottinghack channel
nh/irc/tx/nottinghack Sends to the #nottinghack channel
nh/irc/tx/pm/<nick> Sends a pm to <nick>
nh/irc/rx/nottinghack/<nick> Incoming message from irc #nottinghack channel
nh/irc/rx/pm/<nick> Incoming pm from irc user <nick>

@Holly533MHz: nh-twitter

Twitter to MQTT bridge

Topic Description Notes
nh/twitter/tx
nh/twitter/rx/dm/<screen_name DM to @Holly533Mhz from <Screen_name>
nh/twitter/rx/mention/<screen_name> mention of @Holly533Mhz by <screen_name>
nh/twitter/rx/hs latest tweet from @HSNOTTS includes retweets payload <screen_name>:<text>

Temperature

Readings from DS18B20 1-Wire digital temperature sensors around the space are published at least every 2.5 minutes.
nh/temp
Message format as follows
address:temp

address Hex string 16 long
temp Float 00.00

XRF & LLAP

LLAP message format
12 Char's
aXXDDDDDDDDD

  • a start character
  • XX Device ID
  • DDDDDDDDD message

more detail can be found here:-

Payload for MQTT message is upto 9byte's, the message part of LLAP, padding is automatically added and striped.
aNOHELLO----
becomes
nh/xrf/?x/NO HELLO

Topic Description Notes
nh/xrf/tx/XX Send out a LLAP message XX is DEVID
nh/xrf/rx/XX LLAP message received XX is DEVID


Lighting Automation

For more details see Lighting Automation/Control Software Note messages on nh/li/state/# should be set to retained. So new clients subscribing can retrieve the current state with out polling.

Topic Description Notes
nh/li/set/ROOM/ZONE Lighting Command ROOM is one of the pre defined rooms ZONE within a ROOM and payload is COMMAND
nh/li/state/ROOM/ZONE Lighting State Retained Topic! ROOM is one of the pre defined rooms ZONE within a ROOM and payload is Curent STATE