필터 지우기
필터 지우기

thingspeak - Any way to disable "Transfer-Encoding: chunked"?

조회 수: 40 (최근 30일)
Zachariah Belding
Zachariah Belding 2021년 1월 11일
편집: Christopher Stapels 2021년 1월 12일
When updating a channel with an execute Talkback(https://www.mathworks.com/help/thingspeak/writedataandexecutetalkbackcommand.html), the thingspeak server uses a chunked style body. With weak and intermittent cellular connections, this can cause difficulties. Is there any way to disable this behavior? I believe updating a channel without Talkback does not use chunked encoding.

채택된 답변

Christopher Stapels
Christopher Stapels 2021년 1월 12일
편집: Christopher Stapels 2021년 1월 12일
Are you sending a very large command to your device? The talkback response should be quite small. We cannot change the encoding on the response that is sent from a TalkBack, but you can use a ThingSpeak channel as a proxy for TalkBack. Write the command to a channel and have the device read the channel at regular intervals or use MQTT to subscribe to the channel. The subscription will provide the channel contents when they are updated.
  댓글 수: 3
Vinod
Vinod 2021년 1월 12일
편집: Vinod 2021년 1월 12일
Try adding "&headers=false" to your request. That should shorten it up and cause the response to be less likely to be chunked.
Also, are you sending a HTTP/1.1 or HTTP/1.0 request? Try sending a HTTP/1.0 if your device cannot handle a HTTP/1.1 request.
Zachariah Belding
Zachariah Belding 2021년 1월 12일
"Try adding "&headers=false" to your request. That should shorten it up and cause the response to be less likely to be chunked."
Thank you! This will shorten the response quite a bit and reduce data usage!
HTTP/1.1 200 OK
Date: Tue, 12 Jan 2021 11:35:37 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
ETag: W/"050a4384880d48b11dc203846aea209c"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 79cb41b5-e471-4a0e-9201-f0f45b21581b
X-Runtime: 0.074885
X-Powered-By: Phusion Passenger 4.0.57
Server: nginx/1.9.3 + Phusion Passenger 4.0.57
86
{"executed_at":"2021-01-12T11:35:37Z","position":null,"id":21390658,"command_string":"146wateron","created_at":"2021-01-12T11:33:06Z"}
0
After looking at my issue more, I have determined that I was wrong about the chunked encoding. I am working with raw tcp sockets and I was not giving the response enough time to be fully buffered in the cellular modem I am using. Adding a 250ms delay after the modem first tells me data is available seems to have fixed the issue.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 Read Data from Channel에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by