Thingspeak - TCP disconnection after channel update

3 views (last 30 days)
Hello,
When updating the channel feed the TCP connection is terminated by the Thingspeak server immediately after each request (doesn't matter "bad" or "good").
That behavior does not depend on the method I use (reqests from ESP8266 via WiFi, GPRS, ordinary terminal program under Windows etc.)
Is that normal?
From technical point of view this is not a problem but when using GPRS the service provider charges me for 100kB of data each time the new TCP connection is open (even if seding 100 bytes) so I suspect it would be better (cheaper) to keep the connection open between the reqests.
Thank you in advance for any advice.

Answers (1)

Naga
Naga on 14 Jan 2025
Hello Pawel
Some devices are sending data to ThingSpeak and closing the TCP connection too quickly, without allowing sufficient time for ThingSpeak API servers to respond or confirming that the data has been successfully received. As a result, these requests are dropped because our protection mechanisms interpret the prematurely closed connection as an abandoned request, preventing it from reaching our servers.
To resolve this issue, please consider the following options:
  1. Modify your code to use the ThingSpeak library available here: https://github.com/mathworks/thingspeak-arduino
  2. Adjust your code to wait for an HTTP response code from ThingSpeak, or at least pause for 1 second before closing the connection or putting the device into deep sleep mode.

Products

Community Treasure Hunt

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

Start Hunting!