Upload a single value

Josue on 11 Dec 2023
Latest activity Reply by Christopher Stapels on 12 Dec 2023

Hello I want to upload a single value from a raspberry and I can't find a way. Can somebody help me?
Lot of Thanks¡¡
Christopher Stapels
Christopher Stapels on 11 Dec 2023
There are a few options. You can use publish to MQTT, and use this example for help. Or you can use the REST API. There is an example using Bulk update on the pi, you can modify using the details from the write Data API.
I never published a single write example from Raspberry Pi in the ThingSpeak doc, but feel like I might have put some code up in this forum before. I'd have a search through old threads.
Josue
Josue on 12 Dec 2023
In the end I chose a script:
DATA=$value
curl -X POST "https://api.thingspeak.com/update?api_key=API_KEY&field1=$DATA"
Crontab is my friend :-D
Christopher Stapels
Christopher Stapels on 12 Dec 2023
nice. Killed my solution with simplicity. Well done.

Tags

No tags entered yet.