feat(settings/espnow): validate wifi_channel and wire into firmware

This commit is contained in:
pi
2026-03-26 00:40:21 +13:00
parent 43d494bcb9
commit ec39df00fc
4 changed files with 25 additions and 3 deletions

View File

@@ -8,8 +8,14 @@ import time
UART_BAUD = 912000
BROADCAST = b"\xff\xff\xff\xff\xff\xff"
MAX_PEERS = 20
# Match led-driver / controller default settings wifi_channel (111)
WIFI_CHANNEL = 6
sta = network.WLAN(network.STA_IF)
sta.active(True)
sta.config(pm=network.WLAN.PM_NONE, channel=WIFI_CHANNEL)
print("WiFi STA channel:", sta.config("channel"), "(WIFI_CHANNEL=%s)" % WIFI_CHANNEL)
network.WLAN(network.STA_IF).active(True)
esp = espnow.ESPNow()
esp.active(True)
esp.add_peer(BROADCAST)