Community
OpenEnergyMonitor

Community

Connect Node red and MQTT

Tags: #<Tag:0x00007f56b4e2ca40> #<Tag:0x00007f56b4e2c928> #<Tag:0x00007f56b4e2c810>

I have an EmonPi. I cannot get data to Node-Red using MQTT.

I had configured the server as the next image shows:

But it doesn’t work.

This is the mosquitto log:

[email protected]:/var/log/mosquitto $ tail mosquitto.log
1576698856: Config loaded from /etc/mosquitto/mosquitto.conf.
1576698856: Opening ipv4 listen socket on port 1883.
1576698856: Opening ipv6 listen socket on port 1883.
1576698858: New connection from 127.0.0.1 on port 1883.
1576698858: New client connected from 127.0.0.1 as lwrf (c1, k20, u'emonpi').
1576698858: New connection from ::1 on port 1883.
1576698858: New client connected from ::1 as emoncms (c1, k5, u'emonpi').
1576698859: New connection from 127.0.0.1 on port 1883.
1576698859: New client connected from 127.0.0.1 as 2a95e7ad-8efc-4032-8e0f-b8660f6b36bc (c1, k60, u'emonpi').
1576698865: New connection from 127.0.0.1 on port 1883.

But it is always in “connecting” state:

imatge

This is the node-red log:

[email protected]:/var/log $ node-red-log

18 Dec 19:54:24 - [info] Started flows
18 Dec 19:54:25 - [info] Server now running at http://127.0.0.1:1880/
18 Dec 19:54:25 - [info] [mqtt-broker:EmonHub] Connection failed to broker: mqtt://emonhub/rx/#:1883
18 Dec 19:54:49 - [info] [mqtt-broker:EmonHub] Connection failed to broker: mqtt://emonhub/rx/#:1883
18 Dec 19:55:04 - [info] [mqtt-broker:EmonHub] Connection failed to broker: mqtt://emonhub/rx/#:1883
18 Dec 19:55:19 - [info] [mqtt-broker:EmonHub] Connection failed to broker: mqtt://emonhub/rx/#:1883

Do you have any idea to solve this problem?

Thanks a lot

Ok, the server was wrong. Now with 127.0.0.1 works