adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.11k stars 1.22k forks source link

wifi Monitor channel doesn't change in 8.0.0-beta.0 #6829

Closed anecdata closed 2 years ago

anecdata commented 2 years ago

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

import time
import random
import wifi

mon = wifi.Monitor()
while True:
    pkt = mon.packet()
    if pkt:
        print(f"{time.monotonic_ns()} {mon.lost()} {mon.queued():3} {pkt[wifi.Packet.LEN]:4} {mon.channel:2} {pkt[wifi.Packet.CH]:2} {pkt[wifi.Packet.RSSI]} {' '*10}", end="\r")
    mon.channel = random.randrange(1, 14)

Behavior

Code works fine in 7.3.2, channel updates rapidly as the loop chooses a new random channel. In 8.0.0-beta.0, channel never changes.

Description

No response

Additional information

I don't think there have been any changes to the Monitor code, so probably something in the esp-idf update.

anecdata commented 2 years ago

Closing. Appears to have been some difference in range, wifi environment, or device issue. Testing in another environment with several devices does not show the issue.