Closed HamAndGreenEggs closed 5 years ago
I just double checked the example, it compiles and works as-is for me. Did you change something in the example when this started happening? If you needed to add a \n to get it to work, it's a sign that the actual length of the payload doesn't match the length specified in the POST header. Usually that is caused by a string or char[] missing it's null terminator. For example doing something like this: char value[5] = "12345";
Thanks for checking this. I found that the behavior was a function of how the controller was connected to the internet. I did further testing and found that when I was connected to:
In these tests, I only changed the WiFi and Password strings, then toggled the patch in/out (I also initially set the channel and key). I don't know how to interpret the difference with T-Mobile--as a seeming weakness of my T-Mobile hotspot, or a robustness of the Verizon hotspot, or something else altogether.
You are the second person in a week to mention problems with a hotspot. I was only testing on Verizon. I'll see if I can find some T-mobile hardware to test with.
The one place it should absolutely work is your WiFi. There still might be something going wrong in your application code. If you want us to take a look at it, strip out anything personal and post it on our forum: https://community.thingspeak.com/forum/
I submitted the code to the forum in case there's a defect. I also noted that my T-mobile hotspot has problems reading the channel fields.
Maybe this is best directed to the forum since it doesn't seem to be a problem with the library, but as followup to your interest in the hotspot topic, I peaked at the response from t-mobile in getHTTPResponse() in a different "read" sketch and saw this:
HTTP/1.1 302 Found Location: http://offers.t-mobile.com/tethering/upsell.do?source=pcweb Content-Type: text/html; charset=iso-8859-1 Proxy-Connection: close
The document has moved
Thanks
I'll close this in favor of discussion on the forum as to why some providers and networks seem to not work well.
I couldn't get the esp32's WriteMultipleFields example to work until I adjusted ThingSpeak.h. Until then it was giving:
As a workaround, I added an additional line to my copy of ThingSpeak.h's writeRaw()
I'm too new at this to say whether it's a needed fix or if it's a usage error.