How to send some inputs to a raspberry pi board from thingspeak
HEMANTH KUMAR REDDY
on 21 Feb 2023
Latest activity Reply by Christopher Stapels
on 21 Feb 2023
I am sending my sensor readings to thingspeak channel using raspberrry pi board but i dont know how can we send some instruction back to the raspberry pi board to control an LED or Motor or some other things. Can anyone provide some information about this?
1 Comment
Time DescendingThere are a few methods.
One polling methods is to use a channel to indicate the state you want the device to be in and have the device read that channel continuously. The cheer lights examples are a good demo this kind of process. (for arduino c here, no Rpi)
Second polling method you can use is Talkback, which creates and stores a command list that your device can consume.
The last method is MQTT subsccribe, where the device can subscribe to a channel and ThingSpeak will push channel updates to the device.
All methods are accesible via Pi, I probably reccomend the third. This example shows publish in RPi, you can adapt for subscribe.
If you created a REST interface on you PI, you could also use MATLAB webread and webwrite in ThingSpeak to send data to your device, but that is the most complex method.
Sign in to participate