Skip to content

Serial MQTTInterface

Anool Mahidharia edited this page Nov 19, 2018 · 15 revisions

ClockIOT has both a mqtt interface and a serial interface which mirrors the mqtt interface. Here are the parameters:

Connection:

  • Baudrate -- 115200
  • Linux -- /dev/
  • Mac -- /dev/cu.SLAB_USBtoUART*
  • PC --

Serial Messages: The message format is based on MQTT with the topic and payload separated by two forward slashes topic//payload. Example: clockiot/display_idx//2 sets the display index to 2.

topic//payload.

  • clockiot/timezone_offset -- payload ~ seconds from UTC ("IP" --> gets timezone from IP address)
  • clockiot/add_to_timezone -- payload ~ seconds to add to current timezone offset
  • clockiot/get_faceplates, (websocket only) return json list of strings of faceplate names with current faceplate index in "faceplate_idx" *clockiot/faceplate_idx//faceplate# -- payload index of desired faceplate.
  • clockiot/get_displays, (websocket only) return json list of strings of display names with current display index in "display_idx" {"displays":["Plain","The Matrix","Word Drop","Solid Color"],"display_idx":"0"}
  • clockiot/display_idx//display# -- payload ~ 0 to N_displays - 1, set displayed animation
  • clockiot/next_display -- payload ~ NA, switch to next display, wrap around to beginning
  • clockiot/brighter -- payload ~ NA, double brightness of display
  • clockiot/dimmer -- payload ~ NA, half brightness of display
  • clockiot/flip_display -- payload ~ NA, flip display top-to-bottom for assembly flexibility
  • clockiot/mqtt_ip -- payload ~ formatted IP address of mqtt server: example "192.168.1.159"
  • clockiot/set_rgb -- payload ~ 6-byte hex formatted color string: example "ff0000" is RED TODO:
  • clockiot/settime -- payload ~ unix time seconds since 1 January 1970
  • clockiot/use_ntp -- no payload ~ revert to NTP time (as opposed to RTC only)
  • clockiot/request_ip -- payload ~ NA, request ip address of ClockIOT esp32 if connected or 255.255.255.255 if not set
  • clockiot/request_mqtt_ip -- payload ~ NA, request mqtt ip address (255.255.255.255 if not used)
  • clockiot/use_wifi -- payload ~ NA, set use_wifi flag to true
  • clockiot/stand_alone -- payload ~ NA, set use_wifi flag to false

network diagram

Clone this wiki locally