我正在尝试为课堂构建一个闹钟,但是每当我运行代码并且时钟必须连接到互联网时,时钟就会崩溃。我将如何解决这个问题?是 Pyportal 的问题还是代码的问题?
**编辑:运行此处找到的 wifi 测试时它也会崩溃 - https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/examples/pyportal_simpletest.py
崩溃是指 Pyportal 将关闭、重新打开并以安全模式运行。**
崩溃时部分的代码是
# Set up where we'll be fetching data from
DATA_SOURCE = 'http://api.openweathermap.org/data/2.5/w'
DATA_SOURCE += 'eather?id='+secrets['city_id']
DATA_SOURCE += '&appid='+secrets['API_TOKEN']
# You'll need to get a token from openweather.org,
# looks like 'b6907d289e10d714a6e88b30761fae22'
DATA_LOCATION = []
####################
# setup hardware
pyportal = PyPortal(url=DATA_SOURCE,
json_path=DATA_LOCATION,
status_neopixel=board.NEOPIXEL)