badger2040 icon indicating copy to clipboard operation
badger2040 copied to clipboard

Wifi not initializing on Badger2040W

Open christopherdoyle opened this issue 2 years ago • 2 comments
trafficstars

I am getting the following error trying to initialize wifi network using .connect:

ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n  File "<stdin>", line 19, in <module>\r\n  File "badger2040.py", line 264, in connect\r\n  File "uasyncio/core.py", line 1, in run_until_complete\r\n  File "uasyncio/core.py", line 1, in run_until_complete\r\n  File "uasyncio/core.py", line 1, in run_until_complete\r\n  File "network_manager.py", line 78, in client\r\nOSError: [Errno 1] EPERM\r\n')

I have tried this on 3 different wifi networks and with v0.0.1 and v0.0.2 of the firmware, and the firmware from the latest build.

The simplest example of the error is:

>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> wlan.scan()
Traceback (most recent call last):   
  File "<stdin>", line 1, in <module>
OSError: [Errno 1] EPERM

I thought hardware issue, but then I flashed the latest stock rp2 pico-w firmware, and the same command works correctly and lists wifi networks. I am able to connect with wlan.connect and get an ip address.

christopherdoyle avatar Jul 08 '23 16:07 christopherdoyle

Specifically clocking to "fast" seems to fix this, doesn't really explain the difference between badger2040w firmware and pico-w firmware though.

badger2040.system_speed(badger2040.SYSTEM_FAST)

christopherdoyle avatar Jul 08 '23 19:07 christopherdoyle

Relates to WiFi simply breaking at slower clock speeds which is mentioned here - https://github.com/pimoroni/badger2040/pull/25

Gadgetoid avatar Jul 28 '23 07:07 Gadgetoid