tulsasoftware / vfdctl

IoT enable your variable frequency drives
GNU General Public License v3.0
3 stars 1 forks source link

Improperly formatted json commands will crash vfdctl #4

Closed thompcd closed 1 year ago

thompcd commented 1 year ago

To Reproduce Steps to reproduce the behavior:

  1. Run Vfdctl on p1am
  2. From a MQTT client, publish an improperly formatted json message under the wildcard topic of vfdctl/#
  3. Vfdctl will stop responding to messages / publishing

Expected behavior

  1. publish to an error topic that an improperly formed message was ingested on the specified topic
  2. message is dropped, continues processing queue
thompcd commented 1 year ago

Tested, fixed in #9 .

Added LED status indicators to help diagnose bad messages, updated wiki:

(5x) - MQTT command bad syntax

Ensure the configuration command is in proper json format and does not contain any formatting errors. Copy/paste the contents into a json formatter to determine if any typos exist in the formatting. Example site: https://jsonlint.com/ Ensure the topic of the command conforms to the proper command topic structure (6x) - MQTT command unsupported

Ensure the register name within the command topic matches a valid config.txt configuration parameter topic Ensure the body of the command contains a key / value for "value" : (desiredValue)