No connection. Micro:bit IoT kit to Thingspeak

44 visualizzazioni (ultimi 30 giorni)
Martin Exner
Martin Exner il 7 Mar 2023
Commentato: rich yates il 15 Gen 2024
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 Commenti
Christopher Stapels
Christopher Stapels il 7 Mar 2023
Modificato: Christopher Stapels il 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
Martin Exner il 8 Mar 2023
Yes. This is the code from makecode:
Regards
Martin Exner

Accedi per commentare.

Risposte (6)

Christopher Stapels
Christopher Stapels il 8 Mar 2023
Modificato: Christopher Stapels il 8 Mar 2023
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 Commenti
Martin Exner
Martin Exner il 13 Mar 2023
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
Christopher Stapels
Christopher Stapels il 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.

Accedi per commentare.


Martin Exner
Martin Exner il 13 Mar 2023
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

Christopher Stapels
Christopher Stapels il 13 Mar 2023
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 Commenti
Martin Exner
Martin Exner il 13 Mar 2023
Hi Christopher
I've updated, and API key is still the same.
Christopher Stapels
Christopher Stapels il 13 Mar 2023
Where do you see "thingspeak says no connection"? Is there a serial monitor?

Accedi per commentare.


Martin Exner
Martin Exner il 13 Mar 2023
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 Commenti
Robert Parks
Robert Parks il 12 Set 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
rich yates il 15 Gen 2024
I had the same issue and your solution worked perfectly! Thank you for sharing it.

Accedi per commentare.


Chris KM
Chris KM il 14 Mar 2023
Hi, I'we tried Martins programming. Added OLED to check.
I have the same problem.
The program stops when connecting to ThingSpeak
  1 Commento
Dick
Dick il 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

Accedi per commentare.


Christopher Stapels
Christopher Stapels il 14 Apr 2023
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 Commenti
SAM YUK
SAM YUK il 12 Mag 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
Robert Parks il 12 Set 2023
Sam and Dick,
See image above for some Makecode that worked for me.
Robert

Accedi per commentare.

Community

Più risposte nel  ThingSpeak Community

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by