How do I calculate the total number of bytes in my upload write to a Thingspeak channel

조회 수: 4 (최근 30일)
my code
int x = ThingSpeak.writeFields(myChannelNumber[ChID], myWriteAPIKey[ChID]);
  댓글 수: 1
Vinod
Vinod 2021년 6월 16일
ThingSpeak library handles calculation of payload size and formatting it as needed. Could you help me understand the use case for knowing the number of bytes of the upload -- if available, how would you use this information?

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

채택된 답변

Barnard Richards
Barnard Richards 2021년 6월 17일
I am going to be evaluating a Arduino MKR NB1500 to upload to a Thingspeak channel.
The Cell phone companies charge for the number of bytes transmitted. I want to know how many bytes i might be able to economically upload with particular SIM card account.
I know a Thingspeak message is limited to 3000 bytes.
  댓글 수: 2
Vinod
Vinod 2021년 6월 17일
편집: Vinod 2021년 6월 17일
Uncomment the following #define in the ThingSpeak library, and it will print out the exact details of what is sent to ThingSpeak servers. You can then calculate the bytes sent.
#define PRINT_DEBUG_MESSAGES
Barnard Richards
Barnard Richards 2021년 6월 18일
Thanks Vinod,
My suggestion is that it would also be useful for Thingspeak to consider adding a get_data_length function to the Thingspeak library which can be called from the Arduino sketch.
but thanks again.

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

추가 답변 (0개)

커뮤니티

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

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by