NodeRed Thingspeak42 node not seeing data on Thingspeak channel

Merle on 29 Nov 2022
Latest activity Reply by Merle on 30 Nov 2022

Using a Thingspeak42 node with NodeRed on a RaspberryPi 4. The node is showing data is being sent but nothing gets populated on graph in Thingspeak.
Rene Chan
Rene Chan on 29 Nov 2022
Couple things to check:
  • Are you using the Write API Key for the channel you are writing to?
  • Is the topic in NodeRED message correct for each channel field?
If you are not alread aware, you can verify by adding additional Debug nodes in NodeRED to check.
If you are still having problem, I suggest you share your flow (first redact anything insiginficant or you don't want to share) to get further help.
Merle
Merle on 29 Nov 2022
I am using the write api from thingspeak. The node setting is the same as the topic in thingspeak, if I understand what is meant by the topic settings. It is 1. Attached are my screens.
Rene Chan
Rene Chan on 30 Nov 2022
Caveat first, I haven't got a chance to try it myself, so my answer below is purely based on my reading of thingspeak42 source code/README and my understanding NodeRED:
In thingspeak42 top.png node, you set Topic 1 to "1". Base on my understanding, that means it will look for message with topic value of "1" and use that as the value for channel field 1 in ThingSpeak.
However, in your change node contents.png node, you set msg.topic to msg.1, which is undefined. Instead, I believe you need to set msg.topic to the string "1". In other words, click the drop down in the "to" field and select string. Then leave the value as 1.
Altenatively, instead of using "1" as the topic, you can use more descriptive topic such as "temp". See the log in https://nodered.org/docs/developing-flows/images/debug-topic.png for an example. temperature, humidity, and pressure are the topics. Compare that to the log in your temperature flow.png, you can tell that you did not properly set the topic or you would have seen something like "1: msg.payload : number" above the value. That makes sense because the value of msg.topic was set to msg.1, which is undefined.
Give it a try and see if it works after properly setting the topic.
Merle
Merle on 30 Nov 2022
That fixed it. Thank you.
Christopher Stapels
Christopher Stapels on 29 Nov 2022
what is a Thingspeak42 node?
Merle
Merle on 29 Nov 2022
It is a command that is used in NodeRed to link with Thingspeak. It can be used to write code for Raspberry Pi and other devices for those people like me that don't know Python.