Trouble connecting to ThingSpeak with HTTP GET
-Hologram SIM and connection on the Verizon network
-Set RadioAccessTechnology to 2 (Default, Cat M1 with NBIoT failover)
-Connects to Verizon Network consistently
SKETCHES tried and results
-TestGPRS.ino --> Connection (OK response), but no response message
-NBWebClient.ino
-with example.org it works with full response
-with arduino.cc it works but response is 301 (permanently moved)
-with thingspeak.com it fails to connect
-with api.thingspeak.com it fails to connect
-with google.com it works but response is 301 (permanently moved)
-NBSSLWebClient.ino
-with example.org it worked but response was unreadable
-with arduino.cc it works to get the ascii logo
-with thingspeak.com it fails to connect
-with api.thingspeak.com it fails to connect
-with google.com it connected but response was unreadable
Ultimately I would like to use the REST API of ThingSpeak.com to do bulk updates of sensor data with HTTP GET but I can't seem to even connect to the server...
Any ideas where to go from here?
I just used the MKRNB library examples to keep it simple.
Thanks!
Hi,
I am not using HTTP GET, but am sending data to ThingSpeak using the Arduino library. This seems to work fine, but every few days the network connection seems to fail. I'm still investigating how to solve that one.
do {
ThingSpeak.setField(1, value[0]); // wind DIR
ThingSpeak.setField(2, value[1]); // wind speed
ThingSpeak.setField(3, value[2]); // temperature
ThingSpeak.setField(4, value[3]); // humidity
ThingSpeak.setField(5, value[4]); // barometric pressure
ThingSpeak.setField(6, value[7]); // accumulated precipitation
ThingSpeak.setField(7, value[14]); // GUST
ThingSpeak.setField(8, value[19]); // solar radiation
// write to the ThingSpeak channel
tsSuccess = ThingSpeak.writeFields(chanNumb, writeKey);
if(tsSuccess != 200){
connectToNetwork();
}
} while (tsSuccess != 200);
This code is based upon the library example WriteMultipleFields
I have resolved my ThingSpeak connection issues and can now complete a bulk update with CSV file via POST, yay! I use the nb library for connection to network and server, then a manual POST using client.write
I have found that the examples provided by ThingSpeak were not quite right and difficult to follow/contradictory if I wanted to update in bulk from an SD card with the MKR NB 1500 and MKR MEM shield.
My only problem now is that this all worked fine when I power the unit through my laptop with normal USB cord (Power and data), but when I try to provide power to Vin by 2A/5V buck boosted battery (Voltaic brand), output from USB cell phone charger connected through Vin, or USB cell phone charger through USB port on MKRNB1500 the system resets after trying to make the cellular connection. I do not have a battery connected to the JST connector yet, this may help (I see some posts around about power management on this board, in particular the I2C charger).
bq24195
I am working on this now and will start another post.
This board seems to give me a lot of trouble so far, I have been using Arduino products for a while and never had so little reference. It seemed difficult to even find the voltage range for the Vin pin...