build(boards): micropython板卡执行 npm run build:prod

This commit is contained in:
王立帮
2026-01-20 18:10:33 +08:00
parent 0968a1c678
commit 6c34d392ae
300 changed files with 1376 additions and 685 deletions

View File

@@ -11,8 +11,10 @@ WILL_TOPIC = '9d634e1a156dc0c1611eb4c3cff57276'
def wlan_connect(ssid='MYSSID', password='MYPASS', timeout=10):
import network
wlan = network.WLAN(network.STA_IF)
if not wlan.active() or not wlan.isconnected():
if not wlan.active():
wlan.active(True)
time.sleep(0.5)
if not wlan.isconnected():
print('connecting to:', ssid, end ="")
try:
wlan.connect(ssid, password)
@@ -26,7 +28,11 @@ def wlan_connect(ssid='MYSSID', password='MYPASS', timeout=10):
if _num > timeout:
wlan.active(False)
print('')
raise RuntimeError("WiFi connection timeout, Please check only 2.4G supported name and password")
import os
if 'c5' in os.uname().machine.lower():
raise RuntimeError("WiFi connection timeout. Please check the SSID and password")
else:
raise RuntimeError("WiFi connection timeout, Please check the SSID and password (only 2.4GHz networks are supported)")
print('\nnetwork config:', wlan.ifconfig())
return wlan