[SOLVED] MySensors MQTT Gateway - offline
-
Re: OpenHAB Mysensors binding 2.4: cant get mqtt gateway online
I have strange problem with MQTT:
MySensors MQTT Gateway is offline, allthough lof is at one point saying that is connected?!Here is log:
2019-07-06 18:21:56.815 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge 2019-07-06 18:21:56.862 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache file: given_ids.cached exist. 2019-07-06 18:21:56.868 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Cache (given_ids) content: [] 2019-07-06 18:21:56.911 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Enabling connection watchdog 2019-07-06 18:21:56.937 [DEBUG] [org.openhab.binding.mysensors ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=404, service.bundleid=242, service.scope=singleton} - org.openhab.binding.mysensors 2019-07-06 18:21:56.944 [DEBUG] [.discovery.MySensorsDiscoveryService] - Starting MySensors discovery scan 2019-07-06 18:21:56.947 [DEBUG] [nsors.handler.MySensorsBridgeHandler] - Initialization of the MySensors bridge DONE! 2019-07-06 18:21:56.941 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Connected to MQTT broker! 2019-07-06 18:21:56.991 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Adding consumer for topic: mysensors-in/+/+/+/+/+ 2019-07-06 18:21:57.029 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2; 2019-07-06 18:21:57.036 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Sending MQTT Message: Topic: mysensors-out, Message: 0;0;3;0;2; 2019-07-06 18:21:58.045 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2; 2019-07-06 18:21:58.082 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Sending MQTT Message: Topic: mysensors-out, Message: 0;0;3;0;2; 2019-07-06 18:21:59.026 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2; 2019-07-06 18:21:59.029 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Sending MQTT Message: Topic: mysensors-out, Message: 0;0;3;0;2; 2019-07-06 18:22:00.026 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2; 2019-07-06 18:22:00.030 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Sending MQTT Message: Topic: mysensors-out, Message: 0;0;3;0;2; 2019-07-06 18:22:01.026 [DEBUG] [rsAbstractConnection$MySensorsWriter] - Sending to MySensors: 0;0;3;0;2; 2019-07-06 18:22:01.029 [DEBUG] [rotocol.mqtt.MySensorsMqttConnection] - Sending MQTT Message: Topic: mysensors-out, Message: 0;0;3;0;2; 2019-07-06 18:22:02.027 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - Cannot start reading/writing thread, probably sync message (I_VERSION) not received. Try set startupCheckEnabled to false 2019-07-06 18:22:02.058 [INFO ] [ateway.MySensorsNetworkSanityChecker] - Network Sanity Checker thread stopped ==> /var/log/openhab2/events.log <== 2019-07-06 18:22:02.086 [hingStatusInfoChangedEvent] - 'mysensors:bridge-mqtt:728b59f4' changed from INITIALIZING to OFFLINE ==> /var/log/openhab2/openhab.log <== 2019-07-06 18:22:02.092 [DEBUG] [ensors.factory.MySensorsCacheFactory] - Writing on cache given_ids, content: [] 2019-07-06 18:22:02.105 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - Failed connecting to bridge...next retry in 10 seconds (Retry No.:0) ==> /var/log/openhab2/events.log <== 2019-07-06 18:23:22.767 [hingStatusInfoChangedEvent] - 'mqtt:systemBroker:mosquitto' changed from UNINITIALIZED to REMOVING
Any idea what this means
2019-07-06 18:22:02.027 [ERROR] [rotocol.mqtt.MySensorsMqttConnection] - Cannot start reading/writing thread, probably sync message (I_VERSION) not received. Try set startupCheckEnabled to false
Mosquitto log looks like it is working OK, at least to me?!
1562430021: mosquitto version 1.4.10 terminating 1562430038: mosquitto version 1.4.10 (build date Wed, 13 Feb 2019 00:45:38 +0000) starting 1562430038: Config loaded from /etc/mosquitto/mosquitto.conf. 1562430038: Opening ipv4 listen socket on port 1883. 1562430038: Opening ipv6 listen socket on port 1883. 1562430085: New connection from 127.0.0.1 on port 1883. 1562430085: New client connected from 127.0.0.1 as paho44685311961 (c1, k60, u'openhabian'). 1562430085: Sending CONNACK to paho44685311961 (0, 0) 1562430116: Received SUBSCRIBE from paho44685311961 1562430116: mysensors-in/+/+/+/+/+ (QoS 0) 1562430116: paho44685311961 0 mysensors-in/+/+/+/+/+ 1562430116: Sending SUBACK to paho44685311961 1562430117: Received PUBLISH from paho44685311961 (d0, q0, r0, m0, 'mysensors-out/0/0/3/0/2', ... (0 bytes)) 1562430118: Received PUBLISH from paho44685311961 (d0, q0, r0, m0, 'mysensors-out/0/0/3/0/2', ... (0 bytes)) 1562430119: Received PUBLISH from paho44685311961 (d0, q0, r0, m0, 'mysensors-out/0/0/3/0/2', ... (0 bytes)) 1562430120: Received PUBLISH from paho44685311961 (d0, q0, r0, m0, 'mysensors-out/0/0/3/0/2', ... (0 bytes)) 1562430121: Received PUBLISH from paho44685311961 (d0, q0, r0, m0, 'mysensors-out/0/0/3/0/2', ... (0 bytes)) 1562430181: Received PINGREQ from paho44685311961
-
Well, the Openhab and Mosquitto side looks good so far. I don't see a connection from the MySensors MQTT gateway in den Mosquitto log.
What gateway are you using?
-
MySensors MQTT gateway is offline.
I can not make it working .....
Here are my settingsorg.eclipse.smarthome.mqttbroker.cfg
name=mosquitto host=localhost secure=false port=1883 username=openhabian retain=false clientId=openhabRibaaa
mqtt-eventbus.cfg
broker=mosquitto
MySensors MQTT Gateway
Broker Name = mosquitto Subscription Topic = mysensors-in Publish Topic = mysensors-out Enabled: "Enabled the startup check" Enabled: "Enabled network sanity check"
-
@ribaaa What type of MQTT gateway are you using? RPi, Arduino...? I don't see it in den Mosquitto log. The Openhab side looks good, but there is no gateway responding to the requests send to Mosquitto.
-
It is RPI (NRF24L01 connected to GPIO pins)
-
@ribaaa Is the MySensors gateway service running and connected to Mosquitto?
-
Sorry for stupid question.
How do I check this?
I have did all steps according to
https://forum.mysensors.org/topic/9346/getting-mysensors-mqtt-gateway-working-on-openhab-2-2-stable (I did mqtt broker according to OH 2.3 requirement)
and did not manged to get MySensors MQTT Gateway online
-
I think I managed to set MySensors gateway, but still MQTT GW in OH is offline
Make options were:./configure --my-transport=rf24 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=RibaaaMQTTgw --my-debug=enable --my-mqtt-user=openhabian
Here is Mosquitto log
1562532386: Config loaded from /etc/mosquitto/mosquitto.conf. 1562532386: Opening ipv4 listen socket on port 1883. 1562532386: Opening ipv6 listen socket on port 1883. 1562532386: New connection from 127.0.0.1 on port 1883. 1562532386: New client connected from 127.0.0.1 as RibaaaMQTTgw (c1, k15). 1562532386: Sending CONNACK to RibaaaMQTTgw (0, 0) 1562532386: Received PUBLISH from RibaaaMQTTgw (d0, q0, r0, m0, 'mysensors-out/0/255/0/0/18', ... (5 bytes)) 1562532386: Received SUBSCRIBE from RibaaaMQTTgw 1562532386: mysensors-in/+/+/+/+/+ (QoS 0) 1562532386: RibaaaMQTTgw 0 mysensors-in/+/+/+/+/+ 1562532386: Sending SUBACK to RibaaaMQTTgw 1562532424: Received PINGREQ from RibaaaMQTTgw 1562532424: Sending PINGRESP to RibaaaMQTTgw 1562532425: Received PUBLISH from RibaaaMQTTgw (d0, q0, r0, m0, 'mysensors-out/3/1/1/0/16', ... (1 bytes)) 1562532425: Received PUBLISH from RibaaaMQTTgw (d0, q0, r0, m0, 'mysensors-out/3/254/1/0/38', ... (4 bytes)) 1562532432: New connection from 127.0.0.1 on port 1883. 1562532433: New client connected from 127.0.0.1 as paho45203016857 (c1, k60, u'openhabian'). 1562532433: Sending CONNACK to paho45203016857 (0, 0) 1562532439: Received PINGREQ from RibaaaMQTTgw 1562532439: Sending PINGRESP to RibaaaMQTTgw
RibaaaMQTTgw is MySensors GW
paho45203016857 is client from org.eclipse.smarthome.mqttbroker.cfg file ( I base that conclusion on username)Here are MySensors logs
Jul 07 22:46:25 INFO Starting gateway... Jul 07 22:46:25 INFO Protocol version - 2.3.1 Jul 07 22:46:26 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,REL=255,VER=2.3.1 Jul 07 22:46:26 DEBUG TSF:LRT:OK Jul 07 22:46:26 DEBUG TSM:INIT Jul 07 22:46:26 DEBUG TSF:WUR:MS=0 Jul 07 22:46:26 DEBUG TSM:INIT:TSP OK Jul 07 22:46:26 DEBUG TSM:INIT:GW MODE Jul 07 22:46:26 DEBUG TSM:READY:ID=0,PAR=0,DIS=0 Jul 07 22:46:26 DEBUG MCO:REG:NOT NEEDED Jul 07 22:46:26 DEBUG MCO:BGN:STP Jul 07 22:46:26 DEBUG MCO:BGN:INIT OK,TSP=1 Jul 07 22:46:26 DEBUG GWT:RMQ:MQTT RECONNECT Jul 07 22:46:26 ERROR connect: Connection refused Jul 07 22:46:26 ERROR failed to connect Jul 07 22:46:26 DEBUG TSM:READY:NWD REQ Jul 07 22:46:26 DEBUG TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: Jul 07 22:46:26 DEBUG GWT:RMQ:MQTT RECONNECT Jul 07 22:46:26 ERROR connect: Connection refused Jul 07 22:46:26 ERROR failed to connect ..... more RECONNECT retries Jul 07 22:46:26 DEBUG GWT:RMQ:MQTT RECONNECT Jul 07 22:46:26 ERROR connect: Connection refused Jul 07 22:46:26 ERROR failed to connect Jul 07 22:46:26 DEBUG GWT:RMQ:MQTT RECONNECT Jul 07 22:46:26 DEBUG connected to 127.0.0.1 Jul 07 22:46:26 DEBUG GWT:RMQ:MQTT CONNECTED Jul 07 22:46:26 DEBUG GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT Jul 07 22:46:33 DEBUG TSF:MSG:READ,3-3-0,s=1,c=1,t=16,pt=2,l=2,sg=0:1 Jul 07 22:46:33 DEBUG GWT:TPS:TOPIC=mysensors-out/3/1/1/0/16,MSG SENT Jul 07 22:46:35 DEBUG TSF:MSG:READ,3-3-0,s=1,c=1,t=16,pt=2,l=2,sg=0:0
-
I managed to get it online...... somehow?!
-
@ribaaa My guess: you restarted Openhab or the binding. I'm glad it works now!