MQTT App connection problems

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
Spacely
Posts: 1
Joined: 06 Jul 2020 12:22

MQTT App connection problems

Post by Spacely »

Hi there,

I'm using a razberry module on raspberry. I have installes the MQTT package and configured it to communicate with my remote mosquitto installation.
Mosquitto is allowing anonymopus connections. Many Tasmotas accessing it right now every second...
No Messages arriving at mosquitto server from zwave. Errors in z-way-server.log:

[2020-07-06 11:20:25.075] [core] [MQTT-14] Socket connection opened.
[2020-07-06 11:20:25.075] [core] [MQTT-14] Connected to 192.168.10.7
[2020-07-06 11:20:25.075] [core] [MQTT-14] ----------------- undefined
[2020-07-06 11:20:25.075] [core] [MQTT-14] +++++++++++++++++ {"first_start_up":"2020-07-02T18:24:43.146Z","count_of_reconnects":4,"firstaccess":false}
[2020-07-06 11:20:26.090] [core] [MQTT-14] Trying to reconnect (0)
[2020-07-06 11:20:27.115] [core] [MQTT-14] Socket connection closed.
[2020-07-06 11:20:27.121] [core] [MQTT_14] Error: Disconnected, will retry to connect...
at MQTT.BaseModule.error (automation/userModules/BaseModule/index.js:122:17)
at MQTT.onDisconnect (automation/userModules/MQTT/index.js:139:7)
at MQTTClient._disconnectCallback (automation/userModules/MQTT/index.js:92:46)
at MQTTClient._onClose (automation/userModules/MQTT/lib/mqtt.js:303:10)
at tcp._connection.onclose (automation/userModules/MQTT/lib/mqtt.js:173:10)

Any Ideas?

gbone001
Posts: 5
Joined: 18 Oct 2020 19:13

Re: MQTT App connection problems

Post by gbone001 »

did you ever resolve this, I have the same issue.....

thanks

User avatar
PoltoS
Posts: 5946
Joined: 26 Jan 2011 19:36

Re: MQTT App connection problems

Post by PoltoS »

Please upgrade the MQTT package to the latest version. Should work then

gbone001
Posts: 5
Joined: 18 Oct 2020 19:13

Re: MQTT App connection problems

Post by gbone001 »

1.4.1? I have that version and its not working

User avatar
PoltoS
Posts: 5946
Joined: 26 Jan 2011 19:36

Re: MQTT App connection problems

Post by PoltoS »

Should be working. Pleasae show us your error.

johnpdowling
Posts: 2
Joined: 04 Jan 2018 11:36

Re: MQTT App connection problems

Post by johnpdowling »

I'm seeing the same thing on newest builds of z-way-server, basemodule, and mqtt. Here are logs for:
z-way-server

Code: Select all

[2020-10-28 11:40:21.958] [I] [core] --- Starting module MQTT
[2020-10-28 11:40:21.970] [I] [core] Executing script: /*** Buffer ******************************************************************* ...
[2020-10-28 11:40:21.973] [I] [core] Executing script: /*** MQTTClient ************************************************************** ...
[2020-10-28 11:40:21.984] [W] [core] Send error: Broken pipe
[2020-10-28 11:40:21.986] [I] [core] --- ERROR: Can't register duplicate module instance: 16
[2020-10-28 11:40:21.987] [I] [core] Notification: error (core): Can't register duplicate module instance: 16
[2020-10-28 11:40:21.997] [I] [core] [MQTT-16] Socket connection closed.
[2020-10-28 11:40:22.004] [I] [core] [MQTT_16] Error: Disconnected, will retry to connect...
    at MQTT.BaseModule.error (automation/userModules/BaseModule/index.js:122:17)
    at MQTT.onDisconnect (automation/userModules/MQTT/index.js:173:7)
    at MQTTClient._disconnectCallback (automation/userModules/MQTT/index.js:110:46)
    at MQTTClient._onClose (automation/userModules/MQTT/lib/mqtt.js:303:10)
    at tcp._connection.onclose (automation/userModules/MQTT/lib/mqtt.js:173:10)
[2020-10-28 11:40:22.025] [I] [core] [MQTT-16] Trying to reconnect (0)
[2020-10-28 11:40:22.991] [W] [core] Send error: Broken pipe
[2020-10-28 11:40:22.992] [I] [core] [MQTT-16] Reconnect attempt finished
[2020-10-28 11:40:23.012] [I] [core] [MQTT-16] Socket connection closed.
[2020-10-28 11:40:23.015] [I] [core] [MQTT_16] Error: Disconnected, will retry to connect...
    at MQTT.BaseModule.error (automation/userModules/BaseModule/index.js:122:17)
    at MQTT.onDisconnect (automation/userModules/MQTT/index.js:173:7)
    at MQTTClient._disconnectCallback (automation/userModules/MQTT/index.js:110:46)
    at MQTTClient._onClose (automation/userModules/MQTT/lib/mqtt.js:303:10)
    at tcp._connection.onclose (automation/userModules/MQTT/lib/mqtt.js:173:10)
[2020-10-28 11:40:24.021] [I] [core] [MQTT-16] Trying to reconnect (1)
[2020-10-28 11:40:24.022] [W] [core] Send error: Broken pipe
[2020-10-28 11:40:24.023] [I] [core] [MQTT-16] Reconnect attempt finished
[2020-10-28 11:40:24.043] [I] [core] [MQTT-16] Socket connection closed.
[2020-10-28 11:40:24.045] [I] [core] [MQTT_16] Error: Disconnected, will retry to connect...
    at MQTT.BaseModule.error (automation/userModules/BaseModule/index.js:122:17)
    at MQTT.onDisconnect (automation/userModules/MQTT/index.js:173:7)
    at MQTTClient._disconnectCallback (automation/userModules/MQTT/index.js:110:46)
    at MQTTClient._onClose (automation/userModules/MQTT/lib/mqtt.js:303:10)
    at tcp._connection.onclose (automation/userModules/MQTT/lib/mqtt.js:173:10)
    
on the broker, a repeat of a new connection that immediately fails

Code: Select all

1603913909: New connection from 172.30.33.7 on port 1883.
1603913910: Socket error on client <unknown>, disconnecting.

aivs
Posts: 47
Joined: 04 Mar 2011 15:26

Re: MQTT App connection problems

Post by aivs »

After restarting Z-Way MqttClient works well for me:

Code: Select all

[2020-11-02 18:54:26.436] [I] [core] Instantiating module 41 from class MQTT
[2020-11-02 18:54:26.438] [I] [core] --- Starting module MQTT
[2020-11-02 18:54:26.498] [I] [core] Executing script: /*** Buffer ******************************************************************* ...
[2020-11-02 18:54:26.502] [I] [core] Executing script: /*** MQTTClient ************************************************************** ...
[2020-11-02 18:54:26.538] [I] [core] [MQTT-41] Socket connection opened.
[2020-11-02 18:54:26.539] [I] [core] [MQTT-41] Connected to localhost as zway

Code: Select all

pi@raspberrypi:~ $ sudo mosquitto
1604332024: mosquitto version 1.5.7 starting
1604332024: Using default config.
1604332024: Opening ipv4 listen socket on port 1883.
1604332024: Opening ipv6 listen socket on port 1883.
1604332466: New connection from 127.0.0.1 on port 1883.
1604332466: New client connected from 127.0.0.1 as zway (c0, k30).
I think the problem occurs when MqttClient doesn't close the socket after reloading the instance.

Post Reply