Need some help regarding ESP8266 - Thingspeak | ESP8266 Wi-Fi Module | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Need some help regarding ESP8266 - Thingspeak
No permission to create posts
December 2, 2017
1:18 am
Avatar
deep_kap
New Member
Members
Forum Posts: 2
Member Since:
December 2, 2017
sp_UserOfflineSmall Offline

I'm using ESP8266 as WiFi cloud posting device for my sensor nodes.

Taking data from a sensor node via UART (Software UART) -> Get Timestamp from RTC -> Store that data into SD card -> On regular time interval Post collected data to Thingspeak using Bulk Data update API.

Issue I'm facing is while ESP8266 posting data to Thingspeak it remains busy to get back the response from thingspeak for successful posting. It takes 6 - 8 seconds normally and sometimes if internet is down it takes 25 - 30 seconds.

So during this time, ESP8266 not able to get data from Sensor node via UART.

Is there any way to get data via UART during the time of posting also???

I'm using
Arduino IDE
NodeMCU as ESP8266 board
Thingspeak REST API bulk update
UART communication between sensor node and ESP8266

Any other alternative way is also acceptable like instead of using UART, use SPI.

December 3, 2017
8:42 pm
Avatar
rw950431

Top
Members
Forum Posts: 269
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

If you post the code you are now using for the upload you may get more help in improving it.  In my experience most of the wifi upload time is spent waiting for the network or the other end so it may well be possible to go on collecting data in the meantime, if you have the right code.

December 7, 2017
1:02 am
Avatar
deep_kap
New Member
Members
Forum Posts: 2
Member Since:
December 2, 2017
sp_UserOfflineSmall Offline

rw950431 said
If you post the code you are now using for the upload you may get more help in improving it.  In my experience most of the wifi upload time is spent waiting for the network or the other end so it may well be possible to go on collecting data in the meantime, if you have the right code.  

Here is the part of code that post the data.

 

client.stop();

String data_length = String(http_data.length() + 1);

if (client.connect(server, 80))

{

String temp_buffer = const_http_header + data_length;

client.println(temp_buffer); client.println(); client.println(http_data);

}

else

{

Serial.println("Failure: Failed to connect to ThingSpeak");

}

delay(250);

client.parseFloat();

String resp = String(client.parseInt());

if(resp == "202")

{

Serial.println("Posted Successfully");

}

else

{

Serial.println("Error in posting");

Serial.println("Error : " + resp);

}

December 7, 2017
6:24 pm
Avatar
rw950431

Top
Members
Forum Posts: 269
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

There is discussion about problems similar to yours at https://github.com/esp8266/Arduino/issues/1420

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

dollyip18, toddbt2, SatrapB, Ronalpsync, wandaim69, GregoryGof

Administrators: Hans: 387, lee: 457