[SOLVED] Embedded MQTT broker is ignoring published topics

HI,

I am running OpenHAB 2.4 on a Synology DS718+.

After recently upgrading from OH2.1 to OH2.4 Synology package, I have successfully migrated all items of my two ESP8266 systems to use the new embedded MQTT broker.
Everything was working fine until a few days ago when I started experimenting with the MQTT homie convention on a new ESP8266 device.
Ultimately I would like to convert my existing scripts to homie 3.x and enable mqtt OTA programming.

As a first test, I have programmed the third device with the “LightOnOff.ino” example script from the “develop-v3 branch” of the homie-esp8266 GitHub repository.
As expected the new “Thing” and its associated channel was auto-discovered in PaperUI-Inbox and a new switch appeared in “Control”.
However as soon as I move the switch to the ON position I get a communication error (see extracts of event.log below) and from that point the embedded broker start ignoring incoming messages from all existing connections.
As a result my two other devices are still responding to the commands but the status topics that they are publishing are no longer logged nor interpreted.

Here is an extract of the log when everything is working correctly.

2019-06-15 09:08:43.355 [ome.event.ItemCommandEvent] - Item 'mqtt_topic_fd4a69e9_CLOSEGATE' received command ON

2019-06-15 09:08:43.356 [ome.event.ItemCommandEvent] - Item ‘GF_CloseGate’ received command ON

2019-06-15 09:08:43.359 [nt.ItemStatePredictedEvent] - mqtt_topic_fd4a69e9_CLOSEGATE predicted to become ON

2019-06-15 09:08:43.364 [nt.ItemStatePredictedEvent] - GF_CloseGate predicted to become ON

2019-06-15 09:08:43.367 [vent.ItemStateChangedEvent] - mqtt_topic_fd4a69e9_CLOSEGATE changed from OFF to ON

2019-06-15 09:08:43.739 [vent.ItemStateChangedEvent] - GF_GateStatus changed from The gate is ajar to The gate is moving…

2019-06-15 09:08:43.740 [vent.ItemStateChangedEvent] - mqtt_topic_fd4a69e9_GATESTATUS changed from The gate is ajar to The gate is moving…

And here is the log with the discovery of the new thing, the communication error and the operation of the gate without the GF_GATESTATUS

2019-06-15 13:40:04.229 [me.event.InboxRemovedEvent] - Discovery Result with UID 'mqtt:homie300:embedded-mqtt-broker:esp8266-04-light' has been removed.

2019-06-15 13:40:04.255 [hingStatusInfoChangedEvent] - ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ changed from UNINITIALIZED to INITIALIZING

2019-06-15 13:40:04.278 [hingStatusInfoChangedEvent] - ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ changed from INITIALIZING to ONLINE

2019-06-15 13:40:04.314 [me.event.ThingUpdatedEvent] - Thing ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ has been updated.

2019-06-15 13:40:05.828 [.ItemChannelLinkAddedEvent] - Link ‘mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on-mqtt:homie300:embedded-mqtt-broker:esp8266-04-light:light#on’ has been added.

2019-06-15 13:40:05.831 [me.event.ThingUpdatedEvent] - Thing ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ has been updated.

2019-06-15 13:40:05.834 [me.event.ThingUpdatedEvent] - Thing ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ has been updated.

2019-06-15 13:40:05.838 [vent.ItemStateChangedEvent] - mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on changed from NULL to UNDEF

2019-06-15 13:40:20.734 [me.event.ThingUpdatedEvent] - Thing ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ has been updated.

2019-06-15 13:40:42.878 [ome.event.ItemCommandEvent] - Item ‘mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on’ received command ON

2019-06-15 13:40:42.880 [nt.ItemStatePredictedEvent] - mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on predicted to become ON

2019-06-15 13:40:42.884 [hingStatusInfoChangedEvent] - ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No connection or readOnly channel!

2019-06-15 13:40:42.885 [vent.ItemStateChangedEvent] - mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on changed from UNDEF to ON

2019-06-15 13:41:17.953 [ome.event.ItemCommandEvent] - Item ‘mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on’ received command OFF

2019-06-15 13:41:17.954 [nt.ItemStatePredictedEvent] - mqtt_homie300_embedded_mqtt_broker_esp8266_04_light_light_on predicted to become ON

2019-06-15 13:41:21.281 [vent.ItemStateChangedEvent] - network_pingdevice_2c3d19a0_lastseen changed from 2019-06-15T13:40:21.170+0700 to 2019-06-15T13:41:21.278+0700

2019-06-15 13:41:28.165 [hingStatusInfoChangedEvent] - ‘mqtt:homie300:embedded-mqtt-broker:esp8266-04-light’ changed from OFFLINE (COMMUNICATION_ERROR): No connection or readOnly channel! to ONLINE

2019-06-15 13:42:34.929 [ome.event.ItemCommandEvent] - Item ‘GF_OpenGate’ received command ON

2019-06-15 13:42:34.932 [nt.ItemStatePredictedEvent] - GF_OpenGate predicted to become ON

2019-06-15 13:42:34.933 [vent.ItemStateChangedEvent] - GF_OpenGate changed from OFF to ON

2019-06-15 13:42:36.321 [ome.event.ItemCommandEvent] - Item ‘GF_OpenGate’ received command OFF

2019-06-15 13:42:36.323 [nt.ItemStatePredictedEvent] - GF_OpenGate predicted to become OFF

2019-06-15 13:42:36.326 [vent.ItemStateChangedEvent] - GF_OpenGate changed from ON to OFF

2019-06-15 13:42:43.144 [ome.event.ItemCommandEvent] - Item ‘GF_StopGate’ received command ON

2019-06-15 13:42:43.146 [nt.ItemStatePredictedEvent] - GF_StopGate predicted to become ON

2019-06-15 13:42:43.154 [vent.ItemStateChangedEvent] - GF_StopGate changed from OFF to ON

I have to first remove the new ‘thing’ and restart the OH service in order to get the Embedded broker to start behaving normally again.

I am wondering if this has to do with the issue #4775 ([mqtt] Embedded broker silently discards published messages).

Any idea on how to fix this strange behavior?

Sorry for the formatting issues… My first post!

Hello,
I would really recommend updating to 2.5 M1 for the mqtt2 binding. It was released with many problems and bugs in 2.4 and many fixes didn’t make into the release till 2.5 M1 which fortunately is fairly stable. Your problems could well be related to this as I heard a few times of people having big problems especially with homie things. In addition you will get outgoing transformations when upgrading which are really useful.
Johannes

HI,

Thanks for your reply.
I will follow your recommendation and “attempt” to update to 2.5M1.
I never performed an upgrade without a Synology package file before but I am sure that it can be done.

Thanks again for your help Johannes.
Serge.