Hello everyone,
I have run into a snag while trying to connect the MQTT Ethernet Gateway to Openhab. I hope this is the right location to post this. If not, let me know. The problem I have run into is in Openhab, the data that I am trying to get from the sensor and show up in Openhab is not showing. Any help would be greatly appreciated. I have tried to include as much information as possible.
I have successfully built and compiled the MQTT Ethernet gateway and have connected the radio (nRF24L01+). I am using an Arduino UNO with a Wiznet W5100 Ethernet Shield. Opening the serial monitor shows the following:
Started!
<<10 12 00 06 4D 51 49 73 64 70 03 02 00 3C 00 04 4D 51 54 54
20 02 00 00
0;0;3;0;9;read: 20-20-0 s=1,c=1,t=0,pt=7,l=5:66.2
MyMQTT/20/1/V_TEMP
30 18 00 12 4D 79 4D 51 54 54 2F 32 30 2F 31 2F 56 5F 54 45 4D 50 36 36 2E 32
0;0;3;0;9;read: 20-20-0 s=0,c=1,t=1,pt=7,l=5:48.0
MyMQTT/20/0/V_HUM
30 17 00 11 4D 79 4D 51 54 54 2F 32 30 2F 30 2F 56 5F 48 55 4D 34 38 2E 30
<<C0 00
D0 00
0;0;3;0;9;read: 20-20-0 s=0,c=1,t=1,pt=7,l=5:47.0
...
I also have a humidity/temperature sensor built using an Arduino Pro Mini 5V 16MHz, nRF24L01+ radio and a DHT11 sensor. When I open its serial monitor it shows the following:
sensor started, id 20
send: 20-20-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1
send: 20-20-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
read: 0-0-20 s=255,c=3,t=6,pt=0,l=1:M
send: 20-20-0-0 s=255,c=3,t=11,pt=0,l=8,st=ok:Humidity
send: 20-20-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
send: 20-20-0-0 s=0,c=0,t=7,pt=0,l=5,st=ok:1.4.1
send: 20-20-0-0 s=1,c=0,t=6,pt=0,l=5,st=ok:1.4.1
send: 20-20-0-0 s=1,c=1,t=0,pt=7,l=5,st=ok:64.4
T: 64.40
send: 20-20-0-0 s=0,c=1,t=1,pt=7,l=5,st=ok:41.0
H: 41.00
send: 20-20-0-0 s=1,c=1,t=0,pt=7,l=5,st=ok:66.2
T: 66.20
...
From these two outputs, I assume that the sensor is sending its data to the MQTT gateway and the gateway is receiving it but somewhere between the gateway and openhab running on my raspberry pi there is some kind of problem.
Moving on to the OpenHAB configuration - currently running version 1.6.1 on my Raspberry PI
In openhab.cfg in the section entitled MQTT Transport I have defined the following:
URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
mqtt:mysensor.url=tcp://192.168.2.150:1883
Optional. Client id (max 23 chars) to use when connecting to the broker.
If not provided a default one is generated.
mqtt:mysensor.clientId=MyMQTT
I have added to the addons folder org.openhab.binding.mqtt-1.6.1.jar
I think this is where the problem may lie... I could be wrong.
In my .items file I have the following mqtt bindings:
Number Temperature_MainFloor_Nursery_Office "Temperature [%.1f °F]" <temperature> (MainFloor_Nursery_Office) {mqtt="<[mysensor:MyMQTT/20/1/V_TEMP:state:default]"}
Number Humidity_MainFloor_Nursery_Office "Humidity [%.1f %%]" <pressure> (MainFloor_Nursery_Office) {mqtt="<[mysensor:MyMQTT/20/0/V_HUM:state:default]"}
String sketch20 "Sketch name for node id 20 is [%s]" (MainFloor_Nursery_Office) {mqtt="<[mysensor:MyMQTT/20/255/V_SKETCH_NAME:state:default]"}
I am using the MySensors library 1.4 and Arduino IDE 1.0.6
Any help would be greatly appreciated. Thanks.
EDIT: sorry for the large font. I copied/pasted and cant figure out how to change it.