I recently built a standalone clock using an Interstate75W with a 64x32 LED matrix panel, an RV3028 real time clock, a BME280 environment sensor and an LTR-559 light sensor, which all work fine.
However, when I tried running the demo program, it failed to connect to the network, with the error message OSError: [Errno 1] EPERM. Further investigation showed that activation of the network interface was silently failing:
MicroPython v1.23.0, picow v1.23.0-1 on 2024-06-06; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>>
>>> import network
>>> from secrets import WIFI_SSID, WIFI_PASSWORD
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> wlan.config(pm=0xa11140)
>>> wlan.connect(WIFI_SSID, WIFI_PASSWORD)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 1] EPERM
>>> print(wlan.status())
0
>>> print(wlan.active())
False
>>> wlan.active(True)
>>> print(wlan.active())
False
>>> print(wlan)
<CYW43 STA down 0.0.0.0>
I disconnected all the I2C devices, but that didn’t make any difference.
Then I flashed the I75W with the latest .uf2 (picow v1.24.0-beta1) and now attempts to activate the network interface give the error message [CYW43] Failed to start CYW43
Has anyone else had this problem, or have any idea what is wrong?
Has something changed on your network, perhaps? Might be worth checking your credentials in secrets.py (and that your modem/router is supplying 2.4GHz wi-fi to connect to).
Trying to connect repeatedly when there’s already a wifi connection active can also cause weird errors to crop up, so might be worth trying running the code after a reset of the board, if you’ve not tried that already.
I downloaded a copy of the official Raspberry Pi Micropython .uf2, copied it to the I75W, and it connected to my network normally:
MicroPython v1.24.1 on 2024-11-29; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import network
>>> from secrets import WIFI_SSID, WIFI_PASSWORD
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> print(wlan.active())
True
>>> wlan.connect(WIFI_SSID, WIFI_PASSWORD)
>>> print(wlan.status())
3
>>>
Then I downloaded a fresh copy of the Pimoroni .uf2, copied that to the I75W, and once again it failed to connect:
MicroPython v1.24.0, picow v1.24.0-beta1 on 2024-10-31; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import network
>>> from secrets import WIFI_SSID, WIFI_PASSWORD
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
[CYW43] Failed to start CYW43
>>> wlan.connect(WIFI_SSID, WIFI_PASSWORD)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 1] EPERM
>>>
Could there be any difference between the hardware version of the I75W you tested on and the ones that I bought a couple of months ago?
It doesn’t seem to depend on the presence of a wi-fi network at all.
I turned off my router and disconnected the matrix panel and I2C devices, and it still failed to activate the network interface:
MicroPython v1.24.0, picow v1.24.0-beta1 on 2024-10-31; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
[CYW43] Failed to start CYW43
>>> print(wlan.active())
False
>>>
Whereas it successfully activated the network interface with the vanilla Micropython:
MicroPython v1.24.1 on 2024-11-29; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> print(wlan.active())
True
>>>
Have you tried clearing the flash and starting from scratch? You could also try deleting your main.py, and seeing if running the script from Thonny works any better.
If that doesn’t help I’m out of ideas - if you’re getting the same issue with multiple boards (and only with our MP image) it seems likely to be a software issue rather than a hardware one. Might need to open an issue on Github so that our software folks can take a look?
I nuked the I75W flash and reloaded the latest Pimoroni picow MP image.
This time it didn’t produce the error message, but still failed to activate the wireless interface:
MicroPython v1.24.0, picow v1.24.0-beta1 on 2024-10-31; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> print(wlan.active())
False
>>> wlan.active(True)
>>> print(wlan.active())
False
>>>
I’ll open an issue on Github, as you suggested, thanks.
I have an i75W When I get a chance I’ll hook up a cable and have a look see with Thonny. I’m currently not using the wifi. I’ll do some testing though, after i back up my code ;) .
Many thanks @alphanumeric, I was hoping you might be able to help.
MP v1.23.0-1 is what I was using when I had my original problem, but I have downloaded a fresh copy and installed it, and then tried your test script.
It worked, exactly as you described.
So then I tried the example clock program again, and that worked as well!
I don’t understand why it didn’t work in the first place, nor why Thonny reports that wlan is inactive when I type the commands into its shell. I guess I must have been focusing on that and not looking beyond it.
Now I will modify my matrix clock program to use NTP.
I have one so I decided to have a look see. I wasn’t doing much, just sipping my morning coffee.
I’ve had some weird things happen when I’ve run several different files in a row. Hitting the reset button will often bail you out, it removes everything you have imported etc. It gives you fresh start.