Node-Red Editor no longer working afte Node-Red hangup

Hello,

I am starting with Node-Red two weeks before and had good succes.
My System: Rasberry PI 4, MQTT Mosquitto Broker, Node-Red, 8266 Wifi Module.

Today I had a complete hangup of Node-Red Editor. Node-Red adaptor installation on Pi 4 does not show any problems. I had been very lucky because some minutes before I had exported my complete flow. So nothing really lost.

I followed many hints from the net but without any success. Then I found one hint to the port.
So I changed in the Node-Red setting file the Port from 1880 to 1881. After Pi 4 restart the Node-Red Editor was working perfekt under the localadress:1881 together with the uploades previous flow and also the dashboard was OK. Only the MQTT messages from 8266 had been not available.

Then I changed back to Port 1880 and could reproduce that Node-Red editor is not working.
But after going to new Port 1881 now also here the Node-Red editor is not working.
And also changing to Port 1882 does not help.

Can anybody tell me what could be the problem behind.

Greetings

Bernd

Sounds like you have an MQTT loop, where you have subscribed to a topic and every time you get a message from it you end up publishing it again, so it just goes round and round and clogs everything up. To prove it, if you stop mosquitto (sudo systemctl stop mosquitto then node-red will respond again. A common cause of this is with something like a ui-switch node having Message Passthrough enabled. If the switch is fed from mqtt and also outputs to the same topic then you get a loop. Disable Passthrough and set the switch to show the state of the input (probably) and it will fix it.
Whenever node-red locks up due to a problem like this you can start the editor without starting the flows by stopping node red (node-red-stop, which might take a couple of minutes to happen if it is clogged up) and restart using
node-red --safe

Colin,

many thanks for Your fast response.
After sudo systemctl stop mosquitto the Node-Red editor is working correct. I removed the perhaps critical MQTT Outputs. Then I have restarted the mosquitto again. Node-Red Editor is working but after Deployment I again have an hangup of the Node-Red Editor.

Bernd

Well you still have an mqtt loop somewhere. In a terminal run
mosquitto_sub -t "#" -v | perl -pe 'print scalar(localtime()), " ";'
and you will see which topics are involved in the loop.

[Edit] Actually mosquitto_sub -t "#" -v would be enough.

Colin,

Perfect, I have disconnected my 8266 Board and everything is fine. Problem was a char array which was defined too short for the string to be transmitted via MQTT to the Rasberry.
So small bug in 8266 but with big impact on Red-Node.

Many thanks for Your successful support

Greetings

Bernd

I again had this problem, now I have changed 8266 code as attached in the way that everytime correct characters will be send out

d=StringToSend.length()+1;
StringToSend.toCharArray(msg, d);
client.publish("/home/Riego/Status",msg);

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.