MQTT

From base48
Revision as of 16:16, 25 January 2017 by Squirrel (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Info

For now, there is installed broker mosquitto at mqtt.base48.cz. Only working device are lights at working table. repository

ESP8266 starts and tries to connect to the broker. If that does not happen, blue light is ON.

Only important topic should be /info/send, you can send three strings now: desc, hp or ctl each than responds to correspondic topic with adequate information, each device should listen for "/info/send" and act accordingly

This outputs something like:

>>/info/send desc
/info/desc esplana:ESP8266 in main workroom replaced svetlana, buggy az hellz

>>/info/send hp
/info/hp esplana:flash id, 1458400
/info/hp esplana:cpu freq, 80000000
/info/hp esplana:unique id, b'\xae$\x19\x00'
/info/hp esplana:mem alloc, 17984
/info/hp esplana:mem gree, 18224
/info/hp esplana:statvfs, 4096,4096,869,858,858,0,0,0,0,255

>>/info/send ctl
/info/ctl esplana:pub,button,/workroom/buttons/table,sends char 1 when pressed
/info/ctl esplana:sub,light,/workroom/lights/ctl/table_a,Send char of 0 or 1 to turn off or on
/info/ctl esplana:pub,light,/workroom/lights/events/table_a,Sned char of 0 or 1 when light tunerd off or on
/info/ctl esplana:sub,light,/workroom/lights/ctl/table_b,Send char of 0 or 1 to turn off or on
/info/ctl esplana:pub,light,/workroom/lights/events/table_b,Sned char of 0 or 1 when light tunerd off or on

# button was pressed
/workroom/buttons/table 1
/workroom/buttons/table 1

 

TODO:

  • logging into mqtt
  • keep alive check against device
  • resolved DNS bug on esp8266 in workroom
  • make it secure (open now)