No connection. Micro:bit IoT kit to Thingspeak
Show older comments
Hi.
I have issues getting live data in ThingSpeak working with Elecfreaks IoT-kit. Is this a known issue? I have had it working before, so its not my code thats the problem :)
Regards
Martin
2 Comments
Christopher Stapels
on 7 Mar 2023
Edited: Christopher Stapels
on 7 Mar 2023
Can you show us parts of the code you are using to connect and write? Are you using MQTT or REST API?
Does your device have any monitoring? Are you getting any response at all from the device?
Martin Exner
on 8 Mar 2023
Accepted Answer
More Answers (6)
Christopher Stapels
on 8 Mar 2023
Edited: Christopher Stapels
on 8 Mar 2023
0 votes
You seem to have no delay between requests. This will result in you continuously querying the ThingSpeak server, and eventually you will be blocked for abuse. The minimum time between posts is 1 second for a paid user and 15 seconds for a free user. Please add some delay.
2 Comments
Martin Exner
on 13 Mar 2023
Christopher Stapels
on 13 Mar 2023
I dont think you have been blocked yet. Does anything at all show up in your account? Perhaps try looking at the export recent data button at the top of your channel view. Does the number of entries increase?
Are you able to test the connection part of the code above to see if it is successful (say blink an led or have serial output? )
Im not sure how the pink blocks on the right in your diagram interact but I only see 2000 ms of delay on the loop on the left. Make sure the total delay is at least 15 seconds unless you have a paid ThingSpeak license.
Perhaps try a different network, or use your phone hotspot to conenct to test if it is your WiFi.
Martin Exner
on 13 Mar 2023
0 votes
Christopher Stapels
on 13 Mar 2023
0 votes
Can you try updating your channel with your browser address bar? Use the format shown on the API keys tab of your channel.
This makes sure the API Keys havent changed and the account it still active.
2 Comments
Martin Exner
on 13 Mar 2023
Christopher Stapels
on 13 Mar 2023
Where do you see "thingspeak says no connection"? Is there a serial monitor?
Martin Exner
on 13 Mar 2023
0 votes
5 Comments
Christopher Stapels
on 13 Mar 2023
I'm not clear how the conenct thingSpeak block in microbit works exactly. Is there a way for you to show what is hapepning internally?
Which version of the ESP8266 do you have? If it is a version with a built in programmer, perhaps we can try connecting directly to ThingSpeak with the esp8266 without the micro bit.
Martin Exner
on 14 Mar 2023
Christopher Stapels
on 14 Mar 2023
Thanks for letting me know about the breadth of the problem, we definitey would like to fix this if possible.
I wonder if there was an upgrade to the microbit firmware 6 months ago that would change the ThingSpeak communication. I am not aware of any changes on ThingSpeak in that timeframe that would effect devices.
Can you let me know when the last time you were able to post data was?
Robert Parks
on 12 Sep 2023
Hi Christopher and Martin,
After experiencing the same problems as Marin, and incorporating your advice regarding delays and troubleshooting notifications, I managed to get it to work. The key, I think, is to get the code to keep looping until ESP8266 successfully talks to the router. This takes a minute or two. Here's what worked for me:

All my best,
Robert Parks
MIT App Inventor
rich yates
on 15 Jan 2024
I had the same issue and your solution worked perfectly! Thank you for sharing it.
Chris KM
on 14 Mar 2023
0 votes
Hi, I'we tried Martins programming. Added OLED to check.
I have the same problem.


The program stops when connecting to ThingSpeak
1 Comment
Dick
on 14 Apr 2023
I have encountered the same issue here. I use makecode and ESP8266 and they seems not communicating with the thingspeak.
I have tried the HTTP method (address bar), it works. Only the makecode part is not working.
regards
Dick Chan
Christopher Stapels
on 14 Apr 2023
0 votes
Do you know anyway to expose what the steps in the make code or the ESP firmware are doing? I know how to connect an ESP8266 directly to ThingSpeak, and there are no issues with that process at present, but I dont know what the micro bit is specifically doing with the esp8266.
9 Comments
Dick
on 17 Apr 2023
Hi,
This is one the methods I was trying to do. I want to upload the temperature reading to thingspeak, but it never responses.
I have tried the thingspeak library indeed, but failed as well.

Best Regards,
Dick
Christopher Stapels
on 17 Apr 2023
Thanks for sharing, this helps. Do you know if there is a block that says wait for a response after the GET is sent? This can be an issue since the server wont update the channel if the client doesnt acknowlede the server response.
Dick
on 19 Apr 2023
Dear Chris,
I did add a counter which is about 15 seconds between each data sending.
Best Regards,
Christopher Stapels
on 19 Apr 2023
Is there a way to add a block to "wait for a reponse from thingspeak" before disconnecting or finishing the transmission? That is sometimes an issue that prevents data from being ingested.
Dick
on 20 Apr 2023
Hi
I have tried this one (https://makecode.microbit.org/_E0R4671puEam), the wifi is connected, but the thingspeak cannot.
Best Regards,
SAM YUK
on 21 Apr 2023
Hello
I also have the same Problem with the microbit and wifi not uploading the data into the thingspeak
i tried to reset some api key and it seems to not work so i wonder how can i fix the problem?
Best Regards,
Dick
on 21 Apr 2023
Hi Sam, which version of the micro:bit and wifi module are you using?
I have tried microbit v1.0, 1.5, 2.0 and ESP8266, failed at all....
Best Regards,
Dick Chan
SAM YUK
on 12 May 2023
Hi Dick, sorry for the late response. So, have you found the way to fix the problem?
I have tried microbit v1.5 and 2.0. I also tried two different ESP8266 from kittenbot and emakefun.
It showed that it can connect to the wifi but none of the data was uploaded to thingspeak platform.
Robert Parks
on 12 Sep 2023
Sam and Dick,
See image above for some Makecode that worked for me.
Robert
Communities
More Answers in the ThingSpeak Community
Categories
Find more on Read Data from Channel in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
