No connection. Micro:bit IoT kit to Thingspeak

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

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?
Yes. This is the code from makecode:
Regards
Martin Exner

Sign in to comment.

 Accepted Answer

for those who work with the iot:bit v1.4 combined with a Micro:Bit v1.38 this is what worked fro me (after trying all the above):
Do NOT use the ESP8266_IoT extension, but use the ESP_ThinkSpeak extension in stead (see https://makecode.microbit.org/pkg/alankrantas/pxt-ESP8266_ThingSpeak for code example) .
With the ESP8266_IoT extension No data was getting to the API, but with the ESP_ThinkSpeak it worked flawless

More Answers (6)

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

Hi Christopher.
I've also tried with delay (see code below) but still no connection to Thingspeak. Could it be that my account already has been banned?
Regards
Martin
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.

Sign in to comment.

Hi Christopher
I have embedded the wifi-check and thingspeak-check. Wifi works, thingspeak says no connection. I have downloaded the data export and no entries.
I have also tried the 15 seconds delay, still no connection. On a sidenote, we have had the set working for years (thingspeak and IoT from Elecfreaks) but half a year ago it stopped working.
Regards
Martin
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

Hi Christopher
I've updated, and API key is still the same.
Where do you see "thingspeak says no connection"? Is there a serial monitor?

Sign in to comment.

Hi Christopher.
Yes, I made a check on Thingspeak-connection in my makecode. You can see the code here: https://makecode.microbit.org/_cEj4XYXjoDu4
Regards
Martin

5 Comments

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.
Hi Christopher.
I use this (https://www.elecfreaks.com/micro-bit-smart-science-iot-kit.html ) with a build in ESP8266 wifi module. I don't know about ESP8266-version or if it can be used directly.
For the reference: This has been an issue for all my colleages that uses this kit. It used to be working and was a cool way to get data from the micro:bit online. Actually it was the only real way to do so. Therefore many schools and students are now unable to do so.
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?
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
I had the same issue and your solution worked perfectly! Thank you for sharing it.

Sign in to comment.

Hi, I'we tried Martins programming. Added OLED to check.
I have the same problem.
The program stops when connecting to ThingSpeak

1 Comment

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

Sign in to comment.

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

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
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.
Dear Chris,
I did add a counter which is about 15 seconds between each data sending.
Best Regards,
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.
Hi
I have tried this one (https://makecode.microbit.org/_E0R4671puEam), the wifi is connected, but the thingspeak cannot.
Best Regards,
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,
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
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.
Sam and Dick,
See image above for some Makecode that worked for me.
Robert

Sign in to comment.

Communities

More Answers in the  ThingSpeak Community

Categories

Products

Asked:

on 7 Mar 2023

Answered:

on 14 May 2025

Community Treasure Hunt

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

Start Hunting!