Skip to content

20221109 0109 Pre-Release for QOS 1 testing

Pre-release
Pre-release
Compare
Choose a tag to compare
@nielsonm236 nielsonm236 released this 09 Nov 19:31

This is a Pre-Release only to permit testing of the QOS 1 implementation. If you are not using Home Assistant you should see no difference in operation. If you ARE using Home Assistant you should find that the Toggle function now works, however, read the notes that follow:

  • CAUTION: If you are using the Upgradeable builds (with external EEPROM) you MUST follow the procedure for uploading this firmware:
    o Start the existing Code Uploader with the /72 URL command
    o Install the new NetworkModule-CodeUploader.sx file
    o Install the new NetworkModule-Strings.sx file
    o Install the new NetworkModule-MQTT-UPG.sx OR NetworkModule-Browser-UPG.sx file.
  • If you don’t follow the process you may have to reprogram the module with the SWIM interface.

Comment: It was found that some Network Module PUBLISH messages were not being properly forwarded to Home Assistant when using Mosquitto 1.6.x. This problem went away when Mosquitto was upgraded to 2.0.15. If you are using Mosquitto I recommend you use the latest Mosquitto revision.

Remaining issue: Whenever the Network Module is rebooted the Home Assistant “Toggle” button will not initially send all required PUBLISH State Change messages for all outputs. I am fairly certain this is a Home Assistant issue based on examining Mosquitto logs. Pressing “Toggle” several times (with a short pause between presses) will eventually cause Home Assistant to properly send all PUBLISH State Change messages as expected, and thereafter Home Assistant continues to properly send all PUBLISH State Change messages (until the next reboot). I don’t know if this is an issue unique to my implementation of Home Assistant and Mosquitto on the same Windows 10 server. I’m interested in what the Linux server and Raspberry users see.

Code changes:

  • Added MQTT QOS 1 functionality for PUBLISH State Change messages sent from Home Assistant to the Network Module. All other messages sent in either direction continue to be delivered with MQTT QOS 0.
  • Changed the MQTT message response processes so that the Network Module will respond to an MQTT PUBLISH State Change message with a PUBLISH Response regardless of whether the PUBLISH State Change made a change in the ouput pin state. Example: Home Assistant sends a PUBLISH State Change to set Output 1 to the ON state. If Output 1 was already in the ON state the previous code would not send a PUBLISH Response back to Home Assistant. Now it will. This is to address an “out of sync” issue that seems to occur between edge devices and Home Assistant on rare occasion.
  • Fixed an issue in the MQTT transmit code wherein multiple queued messages might not all get sent. This did not appear as a problem until current efforts to implement QOS 1 resulted in multiple responses to a single PUBLISH from Home Assistant (the QOS 1 implementation requires a PUBACK response followed by a PUBLISH with the new pin state).
  • Changed the code so that Home Assistant sees pin 11 as Disabled when it is being used for UART based debug functionality.
  • Changed the code to slow the rate at which messages are extracted from the ENC28J60 hardware receive buffer. This was necessary to allow reliable processing of the burst of Home Assistant PUBLISH State Change messages that occur when the Toggle button is pressed. This change may slow MQTT response time slightly verses previous versions of code.

I have not yet updated the manual, so it is not included in this pre-release.