Cant get data into thingspeak

Mckenzie Gibson on 24 Jun 2023 (Edited on 26 Jun 2023)
Latest activity Reply by Mckenzie Gibson on 29 Jun 2023

I have carefully followed the instructions to load data into my channel without success.
1 how do I check if I have a wifi connection?
2 the following lines are my thingspeak commands
char thingSpeakAddress[] = "api.thingspeak.com";
unsigned long myChannelNumber = 2202392;
const char * myWriteAPIKey = "xxxxxxxxxxxxxxxx";
String myStatus = "";
ThingSpeak.begin( client );
ThingSpeak.setField(1, volts2);
ThingSpeak.setField(2, adc2);
I can seed the data on arduino serial monitor. I am using an ESO8266 connected to a win 10 PC
Any help will be much appreciated as I have spent a lot of time trying to solve the problem
Christopher Stapels
Christopher Stapels on 26 Jun 2023 (Edited on 26 Jun 2023)
Please consider the ThingSpeak library for Arduino and ESP. In the library code, there is a routine that will inform you that the wifi is connected via the serial monitor. Also, you can measure the wifi strength using most Arduino libraries. I'd look up how to measure RSSI.
For your code above, you are not writing the data to ThingSpeak. The setfield command sets the field to use for sending data to ThingSpeak, but does not actually send the data. Have a look at the library examples to see how to send the data. There is also this temperature write example in the ThingSpeak doc, but I think the library examples are cleaner.
Mckenzie Gibson
Mckenzie Gibson on 29 Jun 2023
A BIG THANKS Christopher Stapels.
I found I got confused with the letter O and the number 0 in my router details. I now can access the internet from my ESP8266
I have also added "send data" to thingspeak and it works. I am a very happy man until I break my sketch with some "cliver" modes

Tags

No tags entered yet.