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

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Need some help regarding ESP8266 - Thingspeak
Avatar
deep_kap
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
December 2, 2017 - 1:18 am
sp_Permalink sp_Print

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.

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
2
December 3, 2017 - 8:42 pm
sp_Permalink sp_Print

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.

Avatar
deep_kap
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
3
December 7, 2017 - 1:02 am
sp_Permalink sp_Print

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);

}

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
4
December 7, 2017 - 6:24 pm
sp_Permalink sp_Print

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:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

donj51

trilee

Bfletche

stuartWAI

shivmkatiyar

AidanThing

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee