Thingspeak - TCP disconnection after channel update

조회 수: 2 (최근 30일)
Pawel
Pawel 2024년 11월 25일
답변: Naga 2025년 1월 14일
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.

답변 (1개)

Naga
Naga 2025년 1월 14일
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.

카테고리

Help CenterFile Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by