Getting sporadic 404 Bad request and 429 Too Many Requests when posting bulk data

10 views (last 30 days)
Have 10 IoT ESP32 devices which posts status every 30 minutes.
Sometime it works well, some other times the same log fails and returns with either HTTP error code 404 or 429.
From my end it looks exactly the same.
Would like to research how a bad request looks from Thingsspeak's end and why they are rejected.
Channel ID: 1023335.
thanks in advance.

Accepted Answer

Vinod
Vinod on 3 Jun 2020
This is most likely with a badly constructed request to ThingSpeak. It will be difficult to debug because it is likely that some values of parameters the request is badly encoded. One way to debug this is to log to the serial monitor the exact request being made to ThingSpeak when you get a 404 or 429 response code.
Ideally you are not constructing the request yourself and are using the library here: https://github.com/mathworks/thingspeak-arduino to update ThingSpeak.
  8 Comments
Christopher Stapels
Christopher Stapels on 4 Jun 2020
I would like to suggest that scalability is quite possible with ThingSpeak. The channels API gives you a lot of control.
You can use the Create Channel API call to create channels in real time from a device. You can store information in the metadata or tags section of a channel that allows you to group devices. You can write code in MATLAB analysis that scans your channels and returns the api keys for the devices that have the right metadata key or tag.Then you can selectivelty read those channels. Then in ThingSpeak, you can even schedule it to run automatically with a TimeControl. I can help you with pseudo code for each of those parts if you are interested.
I think this weatherstation example shows how to apportion a channel from a device.
avner gideobi
avner gideobi on 4 Jun 2020
Thanks much Vinod.
Problem is these devices are sleeping and wake up occsionally, so I can't really control timing.

Sign in to comment.

More Answers (0)

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on ThingSpeak in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!