I have working with OPENHAB2 for a while running it an an UBUNTU Server. I have recently tried to install a new version of OPENHAB on my Raspberry Pi 3B.
Installation was fine and I also installed MOSQUITTO
For a test I have connected an ESP8266 (12) flashed with EASYESP and a HC-SR04 connected to GPIO pin 12.
(Removed Image)
The installation and configuration seems fine.
When I look at MQTT Fx I can see the various topics.
(Removed Image)
On OPENHAB2 is have configured the following:
mqtt.thing
Bridge mqtt:broker:localBroker [ host=“10.0.0.22”, secure=false, clientID=“openhab2”, username=“dawie”, password=“passwd” ]
{
Thing mqtt:topic:uptime {
Channels:
Type number : uptime “uptime” [ stateTopic=“ESP12/SysInf/uptime” ]
}
Thing mqtt:topic:Distance {
Channels:
Type number : Distance “Distance” [ stateTopic=“ESP12/Dist/Distance” ]
}
}
broker.thing
mqtt:broker:localBroker [ host=“10.0.0.22”,secure=false, clientID=“openhab2”, username=“dawie”, password=“passwd” ]
default.items
Number MQTTuptime “MQTT uptime [%d]” {channel=“mqtt:topic:uptime:uptime”,autoupdate=“false”}
Number MQTTDist “MQTT Dist” {channel=“mqtt:topic:Distance:Distance”,autoupdate=“false”}
default.sitemap
sitemap default label=“Test Sitemap”
{
Frame label=“MQTT Test”{
Text item=MQTTuptime
Text item=MQTTDist}
}
I have also configured the MQTT binding on the paper_ui
(Removed Image)
I still can not see the value from my ESP8266 on the basic_ui
(Removed Image)
looking at netstat
[17:52:26] openhabian@openHABianPi:/etc/openhab2/items$ netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:netbios-ssn 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:microsoft-ds 0.0.0.0:* LISTEN
tcp 0 0 raspberrypi:1883 raspberrypi:46222 ESTABLISHED
tcp 0 0 raspberrypi:1883 10.0.0.131:52613 ESTABLISHED
tcp 0 0 raspberrypi:ssh Dawies-MacBook-Pr:50412 ESTABLISHED
tcp 0 0 raspberrypi:9001 Dawies-MacBook-Pr:49808 ESTABLISHED
tcp 0 172 raspberrypi:ssh Dawies-MacBook-Pr:49813 ESTABLISHED
tcp6 0 0 [::]:8003 [::]:* LISTEN
tcp6 0 0 localhost:8101 [::]:* LISTEN
tcp6 0 0 [::]:netbios-ssn [::]:* LISTEN
tcp6 0 0 [::]:5007 [::]:* LISTEN
tcp6 0 0 [::]:http-alt [::]:* LISTEN
tcp6 0 0 localhost:45365 [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 [::]:1883 [::]:* LISTEN
tcp6 0 0 [::]:8443 [::]:* LISTEN
tcp6 0 0 [::]:microsoft-ds [::]:* LISTEN
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50467 ESTABLISHED
tcp6 1 0 raspberrypi:http-alt Dawies-MacBook-Pr:50195 CLOSE_WAIT
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50462 TIME_WAIT
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50471 TIME_WAIT
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50468 TIME_WAIT
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50511 ESTABLISHED
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50509 ESTABLISHED
tcp6 0 0 raspberrypi:46222 raspberrypi:1883 ESTABLISHED
tcp6 0 0 raspberrypi:http-alt Dawies-MacBook-Pr:50491 TIME_WAIT
[17:57:00] openhabian@openHABianPi:/etc/openhab2/items$
it does seem as if the mqtt binding from openhab is talking to the mqtt server
Looking at the LOG file
My mqtt.cfg file
localBroker.url=tcp://10.0.0.22:1883
localBroker.clientId=openhab2
localBroker.user=dawie
localBroker.pwd=passwd
localBroker.qos=0
localBroker.retain=false
localBroker.async=true
Can anybody please help, it looks like this new mqtt binding is taking me to the cleaners.
Tx Dawie