Reputation: 88
Need help. I installed node-red and want to build a flow with connects to mqtt broker, get's messages and passes them with tpc/ip to other server. I built a simple flow for connecting to mqtt, but it is unable to connect to broker.
installed
sudo npm install -g --unsafe-perm node-red
Print from command line:
Welcome to Node-RED
===================
13 Dec 00:00:15 - [info] Node-RED version: v0.17.5
13 Dec 00:00:15 - [info] Node.js version: v8.9.3
13 Dec 00:00:15 - [info] Linux 4.8.0-59-generic x64 LE
13 Dec 00:00:16 - [info] Loading palette nodes
13 Dec 00:00:17 - [warn] ------------------------------------------------------
13 Dec 00:00:17 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
13 Dec 00:00:17 - [warn] ------------------------------------------------------
13 Dec 00:00:17 - [info] Settings file : /home/cash/.node-red/settings.js
13 Dec 00:00:17 - [info] User directory : /home/cash/.node-red
13 Dec 00:00:17 - [info] Flows file : /home/cash/.node-red/flows_cash-VirtualBox.json
13 Dec 00:00:17 - [info] Server now running at http://127.0.0.1:1880/
13 Dec 00:00:17 - [debug] loaded flow revision: d84a8846a8ef3073ecb32c239f96a967
13 Dec 00:00:17 - [debug] red/runtime/nodes/credentials.load : no user key present
13 Dec 00:00:17 - [debug] red/runtime/nodes/credentials.load : using default key
13 Dec 00:00:17 - [info] Starting flows
13 Dec 00:00:17 - [debug] red/nodes/flows.start : starting flow : global
13 Dec 00:00:17 - [debug] red/nodes/flows.start : starting flow : feaee5c6.b23688
13 Dec 00:00:17 - [info] Started flows
13 Dec 00:00:27 - ###[info] [mqtt-broker:c6682cca.1258d] Connection failed to broker: mqtt://broker.mqttdashboard.com:8000
^C13 Dec 00:00:46 - [info] Stopping flows
What happens?
Cannot connect to the broker.
I used http://www.hivemq.com/demos/websocket-client/ on the same computer, it connects fine and sends/receives messages without any problem, so it is not a port issue.
Please tell us about your environment:
Node-RED version: v0.17.5 node.js version: v8.9.3 npm version: 5.5.1 Platform/OS: Ubuntu 14 Browser: Chrome
FLOW
[{"id":"459d50b3.426c1","type":"mqtt in","z":"feaee5c6.b23688","name":"hiveMQ","topic":"testtopic/#","qos":"2","broker":"c6682cca.1258d","x":270,"y":260,"wires":[["1e91217b.00451f"]]},{"id":"1e91217b.00451f","type":"debug","z":"feaee5c6.b23688","name":"","active":true,"console":"false","complete":"false","x":470,"y":260,"wires":[]},{"id":"c6682cca.1258d","type":"mqtt-broker","z":"","broker":"broker.mqttdashboard.com","port":"8000","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
Upvotes: 0
Views: 11323
Reputation: 59618
The MQTT nodes in Node-RED only support native MQTT not MQTT over Websockets.
The broker running on broker.mqttdashboard.com supports both Native MQTT and MQTT over Websockets but on 2 separate ports. Port 1883 for Native MQTT and port 8000 for MQTT over Websockets.
Upvotes: 2