spacemanspiff2007 / sml2mqtt

Sml to MQTT Bridge
GNU General Public License v3.0
27 stars 8 forks source link

Does not try to reconnect to MQTT when connection is gone #4

Closed nohn closed 2 years ago

nohn commented 2 years ago

Today I restarted my MQTT broker.

While sml2mqtt detected that it was gone, it apparently did not try to reconnect. A restart of sml2mqtt fixed that:

[2021-10-13 04:21:48,577] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:21:50,385] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:21:51,803] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:21:54,080] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:21:55,505] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:21:57,363] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:21:59,165] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:01,348] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:02,780] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:04,981] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:06,398] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:08,192] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:10,031] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:11,843] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:13,672] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:15,881] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:17,313] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:19,153] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:20,962] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:20,966] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:20,970] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:22,785] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:24,626] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:26,234] [sml2mqtt               ] INFO     | Shutting down ...
[2021-10-13 04:22:26,469] [sml.mqtt               ] ERROR    | [code:4] Could not publish message
[2021-10-13 04:22:34,288] [sml.device.ttyUSB0     ] INFO     | PORT_OPENED
[2021-10-13 04:22:35,497] [sml.device.ttyUSB0     ] INFO     | OK
nohn commented 2 years ago

Works with 0b8ea25 (c981d1b).

[2021-10-16 06:38:10,046] [sml2mqtt               ] INFO     | Shutting down ...
[2021-10-16 06:38:26,979] [sml                    ] INFO     | Starting V0.6
[2021-10-16 06:38:27,188] [sml.device.ttyUSB0     ] INFO     | PORT_OPENED
[2021-10-16 06:38:29,219] [sml.device.ttyUSB0     ] INFO     | OK
[2021-10-16 06:50:51,058] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:50:52,786] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:50:54,529] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:50:56,306] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:50:58,035] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:50:59,763] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:51:01,508] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:51:03,236] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:51:05,404] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:51:06,741] [sml.mqtt               ] ERROR    | [code:4] Could not publish message (MqttCodeError)
[2021-10-16 06:51:06,766] [sml.mqtt               ] ERROR    | [Errno 111] Connection refused (MqttError)
spacemanspiff2007 commented 2 years ago

Thank you for verifying!