MQTT & openhab
-
I use a client ( MQTT.fx http://www.jensd.de/wordpress/?cat=50 ) to test the mqtt gateway. Please see my post: http://forum.mysensors.org/topic/953/how-to-know-the-node-ids-assigned-by-the-mqtt-gateway-to-the-sensors/2
With this tool I can see if the gateway is working and which id's are used. Then I configure OpenHAB accordingly.
-
I use a client ( MQTT.fx http://www.jensd.de/wordpress/?cat=50 ) to test the mqtt gateway. Please see my post: http://forum.mysensors.org/topic/953/how-to-know-the-node-ids-assigned-by-the-mqtt-gateway-to-the-sensors/2
With this tool I can see if the gateway is working and which id's are used. Then I configure OpenHAB accordingly.
@Xander Thanks ;)
Very great link, now I can see what is sent.
1)-

2- The ip in MQTT.fx is the same as in openhab.cfg
mqtt:mysensor.url=tcp://192.168.1.234:1883 mqtt:mysensor.clientId=MQTT
3- test.items
Group all Group meteo //(all) Group noeud_1 (meteo) Group noeud_2 (meteo) //Group sketch (all) Number noeud1_temperature "Temperature [%.1f °C]" (noeud_1, all) {mqtt="<[mysensor:MyMQTT/21/0/V_TEMP:state:default]"} Number noeud1_luminosite "Luminosite [%.0f Lux]" (noeud_1, all) {mqtt="<[mysensor:MyMQTT/21/1/V_LIGHT_LEVEL:state:default]"} Number noeud1_humidite "Humidite [%.0f Rh]" (noeud_1, all) {mqtt="<[mysensor:MyMQTT/21/2/V_HUM:state:default]"}4- openHAB runtime
Launching the openHAB runtime... osgi> 2015-04-01 20:28:05.432 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.6.2). 2015-04-01 20:28:06.066 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started 2015-04-01 20:28:06.189 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Disco very initialization completed. 2015-04-01 20:28:07.134 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest 2015-04-01 20:28:15.943 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'test.sitemap' 2015-04-01 20:28:16.055 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'test.items' 2015-04-01 20:28:16.653 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Class ic UI at /openhab.appAnd finally...........................

nothing :(
PS : i don't see the repeater with the barometer, I need to dissociate them so one nano more :(
-
Did you restart openHAB after you entered the MQTT gateway IP address in the configuration file? You don't need to restart when changing items, or sitemaps.
You should check that openHAB has made a connection to the MQTT gateway.
netstat -an |grep 1883
root@openHAB:~# netstat -an |grep 1883 tcp6 0 0 192.168.40.201:42199 192.168.40.200:1883 ESTABLISHED root@openHAB:~#Do you see it listed? If not restart the gateway, it should connect within a few minutes.
-
Did you restart openHAB after you entered the MQTT gateway IP address in the configuration file? You don't need to restart when changing items, or sitemaps.
You should check that openHAB has made a connection to the MQTT gateway.
netstat -an |grep 1883
root@openHAB:~# netstat -an |grep 1883 tcp6 0 0 192.168.40.201:42199 192.168.40.200:1883 ESTABLISHED root@openHAB:~#Do you see it listed? If not restart the gateway, it should connect within a few minutes.
-
that shows you have a listener, but nothing connected!
Are you running the gateway on this PC? if so the openhab configuration should be localhost or 127.0.0.1:1883.
-
And tonight, the weird is back
C:\Users\Totche>netstat -an|find "1883" TCP 0.0.0.0:1883 0.0.0.0:0 LISTENINGIn openHAB.fx, I can see the msgs from the node, so I suppose that the ethernet connection is working
With MYSController, nothing displayed, no node network

With the serial, I can see the exchanges between node and the MQTTgateway
So what's wrong ? The Gateway, a port redirection ????
-
And tonight, the weird is back
C:\Users\Totche>netstat -an|find "1883" TCP 0.0.0.0:1883 0.0.0.0:0 LISTENINGIn openHAB.fx, I can see the msgs from the node, so I suppose that the ethernet connection is working
With MYSController, nothing displayed, no node network

With the serial, I can see the exchanges between node and the MQTTgateway
So what's wrong ? The Gateway, a port redirection ????
-
@Totche Just for clarification: MYSController is not compatible with MQTT gateways but with serial gw. .
@tekka Ah OK, it's better to know it, thanks; ;)
And I found the error this morning and it works great......
To create the configuration file for openHAB, I made a copy/paste of the Mysensors example., and I haven't seen it was a space character at the beginning of each lines.
I removed it, and it's working fine.now
So be carefull with the spaces, it was a stupid mistake and boring to find.
I have done this test 5 times, so I'm sure that it's the problem.
Thank you everybody....
