Microbit esp8266 stop sending data to thingspeak

5 ビュー (過去 30 日間)
panaxao
panaxao 2021 年 4 月 25 日
コメント済み: alex 2022 年 11 月 27 日
I use the following code for sending data from microbit using esp8266
basic.show_icon(IconNames.DIAMOND)
ESP8266ThingSpeak.connect_wifi(SerialPin.P1,
SerialPin.P0,
BaudRate.BAUD_RATE115200,
"ssid",
"pass")
if ESP8266ThingSpeak.is_wifi_connected() == True:
basic.show_icon(IconNames.YES)
else:
basic.show_icon(IconNames.NO)
ESP8266ThingSpeak.wait(10000)
basic.clear_screen()
def on_forever():
ESP8266ThingSpeak.connect_thing_speak("api.thingspeak.com",
"WRITE API KEY",
input.acceleration(Dimension.STRENGTH),
input.magnetic_force(Dimension.STRENGTH),
input.temperature(),
pins.analog_read_pin(AnalogPin.P10),
0,
0,
0,
0)
basic.pause(60000)
basic.forever(on_forever)
The code worked properly for days. But suddenly it stops sending data after few minutes. I have to restart microbit in order to keep sending data. But, it stops again.
Do you have any recommendation? I cannot find any help to net....
Thanks!
  1 件のコメント
alex
alex 2022 年 11 月 27 日
I have the exact same problem. I may have to use an external automation to shut the power off and on again for the microbit

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeREST API についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by