Issues with mqtt thingspeak connection

hi everyone i have isuss i try many time find were problem is but i found northing.

in my flow the node mqtt are config to send via mqtt to thingspeak . the node are working for 2 at 7 day and then it sopped or it blocked . it show the mqtt connecting like in the image . and to fix it i need every time to reboot the router and raspberry pi . i try to restart just nodred but it not fixing it . any ideas were problem is ???


i update node red form the v3.0.2 to v3.1.0 and also i update and upgrade package of pi 4 . and the internet is ok when it stoped .

Try doing one thing at a time.

For example, only restart the PI next time it happens.

If that doesnt work, only restart the router next time it happens.

How do you do this? node-red-stop?

i did it but when i reboot only pi the problem are fixed
also i try node-red-restart and node-red-stop and start it again

May be a device problem. Do you have a different PI or can you run this on a computer for a while to see if that solves it?

this happent on 2 pi
not in pc

and it happend once every 2 at 15 day often

Are w Pi running at the same time? Do they both connect to the broker using the same client ID?

NO. each one is in a different place and every pi has id & key different TO OTHER

I now have 5 PI's not working in the same place and not in the same network and I'm seeing this problem in 2 PI's at the moment. And there is no stopping at the same time.

Where is the MQTT broker you are using installed? It would be helpful if you provided a newwork diagram.

Try adding a mqtt-in node with the same topic you are sending to your mqtt-out node and connect it to a debug node set to send the output to the system log.

That way you could look at the log and get a bit more information.

You could also install mqtt-explorer and connect to the mqtt broker and see what is being sent thru it.

Are you using Docket or home assistant?

I m using raspi os 64bit full . and i config the mqtt from thingspeak server . so the broker is on there server .

i used both of them mqtt out to send data and mqtt out to see if it has send but when the problem happend .both of them showing connecting ...

i send data as a Numbers every 30 sec

How often are you polling Thingspeak> From it's FAQ it states:

 For users of the free option, the message update interval limit remains limited at 15 seconds. Other limitations are described on the How to Buy pages.

Try increasing the time between calls.

1 Like

i m ussing the paid one with interval of 1 s . but i only send one msg in every min .

Have you tried to see how long the connection works with only one Pi sending msgs to the Thinkspeak broker?

Since this seems to work fine for several days and then fails with a connection error, I would suspect something is happening at the Thinkspeak end. I would investigate that possibility, find out what logs they have and how to look at them. Post a question to their support staff (if that is possible).

I found the problem in raspberry config . It same time change the nameserver from 8.8.8.8 to local 198.168.0.1 of router.

I just make a simple change on this
sudo nano /etc/resolv.conf

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