MATLAB Answers

ESP8266 help -- serial port data is showing data from sensor. Thinkspeak only receiving lines of zero data points.

13 views (last 30 days)
MATTHEW SKVASIK
MATTHEW SKVASIK on 16 Dec 2020
Hello everyone,
I am a relative noob at working with my ESP8266 module to send data to Thinkspeak. I am working on an IoT gardening project based off this project here at:
I have tried many times to compile both components of this project. I am receiving data on serial monitor, and my ESP is connected to my wifi but on thingspeak only receiving a line of zeros.
Here are a few things I have checked: my TX/RX and they are OK, as they get moved in position between these two codes, my API key is correct, as far as I can tell.
Does anyone have any recommendations they could make? I am stumped. I can post my code if that would be helpful. Many thanks!

Answers (1)

Christopher Stapels
Christopher Stapels on 17 Dec 2020
I reccomend the ThingSpeak library for Arduino. You can use it to program an ESP 8266. You will likely get better error mesages.
If you install the library in your Arduino IDE, you can use the examples for the library to get good starting code.
If you are using the ESP8266-01 like in that example, I reccomend you upgrade to a Node MCU or something. All the extra hassle of the extra wires and the UNO is not worth the few dolalrs you may have saved.
Share the whole serial output, that will help us debug the issue.
Also have a look at the ThingSpeak examples. May your garden grow large and fast. (and tasty)
  2 Comments
Christopher Stapels
Christopher Stapels on 29 Dec 2020
I dont see the screenshot unfortunately. Is your channel public? I can look at it directly if it is.
I looked at the code in the link you providede, the ESP is using the ThingSpeak library. Since you cannot monitor the serial in on the ESP while its running, debugging is hard. I suggest you hard code the esp to write particular values and work backwards until the hard coded values are exacly what you are sending from the UNO.
To start, comment everything out in the loop except keep this part
upload();
and add
value_1 =<some number>;
value_2 = <some other number>;
delay(15000); //dont slam ThnigSpeak
Then you should see that number in thingspeak every 15 seconds. Then work backwards to the input from the UNO. It lees like the code is looking for * and other special characters.

Sign in to comment.

Communities

More Answers in the  ThingSpeak Community

Community Treasure Hunt

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

Start Hunting!