# Issues with mqtt thingspeak connection

**URL:** <https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536>\
**Category:** General\
**Tags:** mqtt\
**Created:** [8 December 2023 19:09 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536 "2023-12-08T19:09:44Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [8 December 2023 19:09 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/1 "2023-12-08T19:09:44Z")

</div>

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 ???

 ![thing problem](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f7b9eaa5770dfd55bb0021402980f864038b91c9.png)  
 ![pi ssh](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e48a7ebf8c180f3b4a7c84f18b9062a504736d6.jpeg)

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 .

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 December 2023 19:16 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/2 "2023-12-08T19:16:58Z")

</div>

> [@issambfs1](#):
>
> 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 ???

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.

> [@issambfs1](#):
>
> i try to restart just nodred but it not fixing it . any ideas were problem is ???

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

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [8 December 2023 19:28 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/3 "2023-12-08T19:28:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 December 2023 19:34 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/4 "2023-12-08T19:34:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [8 December 2023 21:00 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/5 "2023-12-08T21:00:41Z")

</div>

this happent on 2 pi  
not in pc

and it happend once every 2 at 15 day often

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 December 2023 21:44 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/6 "2023-12-08T21:44:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [8 December 2023 22:08 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/7 "2023-12-08T22:08:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [8 December 2023 22:14 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/8 "2023-12-08T22:14:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 December 2023 01:25 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/9 "2023-12-09T01:25:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [9 December 2023 10:15 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/10 "2023-12-09T10:15:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 December 2023 10:27 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/11 "2023-12-09T10:27:10Z")

</div>

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

```auto
 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.

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [17 December 2023 04:05 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/12 "2023-12-17T04:05:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 December 2023 11:11 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/13 "2023-12-17T11:11:43Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![issambfs1](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@issambfs1](https://discourse.nodered.org/u/issambfs1)\
**Post date:** [7 January 2024 12:09 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/14 "2024-01-07T12:09:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 January 2024 12:09 UTC](https://discourse.nodered.org/t/issues-with-mqtt-thingspeak-connection/83536/15 "2024-01-21T12:09:39Z")

</div>

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