All my ThingSpeak Channels stopped receiving data on the same date. April 13th 2022 at around 10.00 EST. What changed?
I have a personal account which I use for my home projects, along with a paid license which I use for monitoring a set of sensors in a remote building.
All my sensors went offline at about the same time, but I am only just noticing this now, because I have been focused on why the remote location went offline, thinking that it was an issue with the internet or WiFi at that location, rather than a problem with posting the data!
All my monitoring setups are using electricImp devices to post data to ThinkSpeak and have been in some cases, running for several years without any issues. All the devices are now returning a 400 - invalid constant string error.
See logs below.
|2022-04-19T13:30:07.017 +00:00 [Agent] https://api.thingspeak.com/update?api_key=XXXXXXX&status=OK&created_at=2022-04-19 13:30:01 UTC&field4=0.00&field3=0.00&field6=0.00&field5=0.00&field2=14.65&field1=2022-04-19%2013%3A30%3A01%20UTC&status=OK&field8=0.6129&field7=0.00&created_at=2022-04-19%2013%3A30%3A01%20UTC
2022-04-19T13:30:07.086 +00:00 [Agent] PUSH: 400 - invalid constant string
I modified a device to not send the date in field 1 on one device because I thought that might be causing the problem, but it is not clear to me what changed. I have been sending data like this for a long time.
Any ideas appreciated.
Thanks
4 Comments
Time DescendingIt appears some part of the string is not URL encoded. Some infrastructure updates on our end have made the parsing of the headers and query parameters more strict.
In the example you posted created_at has spaces instead of %20 and it appears some query parameters are being duplicated in the request. It should be something like this:
https://api.thingspeak.com/update?api_key=XXXXXXX&status=OK&created_at=2022-04-19%2013:30:01%20UTC&field4=0.00&field3=0.00&field6=0.00&field5=0.00&field2=14.65&field1=2022-04-19%2013%3A30%3A01%20UTC&field8=0.6129&field7=0.00