Thingspeak - no reading data error code 0

Hi,
I've just tried to upload the example sketch ReadField with an Arduino R4, updating the library with WifiS3.h rather than Wifi.h. The network connection is OK.
Unfortunately, I get an error code 0 in the Serial Monitor :
"Problem reading channel. HTTP error code 0"
I d'ont konw what is wrong here and how to fix it. I've read it could be result to the update rate, but the delay of the example seemes to be sufficient (15s).

댓글 수: 5

Vinod
Vinod 2024년 9월 10일
Have you tried starting from one of the examples in the GitRepo here? I'd recommend starting from those examples to build a working project.
Christopher Stapels
Christopher Stapels 2024년 9월 11일
편집: Christopher Stapels 2024년 9월 11일
Can you also try using the your web browser to update your channel? The syntax is provided in the api keys tab of your channel view.
Armand
Armand 2024년 9월 11일
@Vinod Yes I used the example ArduinoWifiShield/ReadField changing the library Wifi.h by WifiS3.h which read the public channel "Mathworks WeatherStation" with Channel Id 12397.
Im sorry, I misread your post, I thought you were writing, not reading. In that case it definitely has nothing to do with the update rate. I would consider trying a different network. Also try using the read command in your browser (also on the api keys tab of your channel;)
Armand
Armand 2024년 9월 24일
Sorry for the delay @Christopher Stapels. It works well in the browser so it seems not to be a problem of network.
Moreover, by adapting the WiFiWebClient sketch from Arduino with a GET method on the chanel URL, I've succeed to get the related JSON. But I don't understant why the Thingspeak library doesn't work in my case and how to fix it.

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

답변 (1개)

Vinod
Vinod 2024년 9월 24일

1 개 추천

I believe the key is here "...updating the library with WifiS3.h rather than Wifi.h." My guess is the WiFiS3 library is not exactly functionally equivalent to Wifi library in Arduino. I'd recommend comparing the source of WifiS3 to Wifi to find the difference.

댓글 수: 3

O'car
O'car 2024년 12월 13일
for the people that show up here. I am experiencing the same issue as @Armand but for posting data to a channel instead of reading, yet, data is posted successfully all the time!
The issue is the response code being 0 which I agree with @Vinod that the issue here MAY BE the WifiS3.h library rather than a bug or a problem on thingspeak. I have to yet study the differences between WifiS3 to Wifi but for now I am accepting response code 0 as success as I see the data being posted on the channel.
Vinod
Vinod 2024년 12월 23일
편집: Vinod 2024년 12월 24일
The issue lies deep in the implementation of the Arduino R4's WiFiS3 library, which is used to create the client that is passed into the ThingSpeak library. See the issue I have reported to the maintainers of the repo.
Hope they get to that soon. Thanks for digging into the issue @Vinod

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

커뮤니티

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

카테고리

도움말 센터File Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

질문:

2024년 9월 10일

댓글:

2024년 12월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by