I75W wlan.active(True) gives [CYW43] Failed to start CYW43

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.

The real time clock drifts by a few seconds a week, so I decided to use NTP to keep accurate time, as in the demo program pimoroni-pico/micropython/examples/interstate75/75W/clock.py at main · pimoroni/pimoroni-pico · GitHub.

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?

I also built an identical clock for my daughter, which I have now retrieved and tested.

It fails in exactly the same way:

>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
[CYW43] Failed to start CYW43
[CYW43] Failed to start CYW43
Traceback (most recent call last):
  File "<stdin>", line 190, in <module>
  File "<stdin>", line 121, in sync_time
OSError: [Errno 1] EPERM
>>> 

Can anyone shed any light on why two separate I75Ws should fail to run the example program, please?

The program runs fine if I comment out the call to sync_time().

Your test code (and the clock.py example are both working fine for me), on both v1.23 and v1.24.

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.

Hi Hel, thanks very much for looking.

It’s really strange, as I have a Pico Plus 2 W that connects to my network fine with the same secrets.py.

Also, it’s failing to activate the network interface, before it even tries to connect, as wlan.scan() fails as well.

Sadly the Interstate 75 W is out of stock at the moment, so I can’t get another one to try.

Curioser and curioser…

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?

Potentially, the I75W I have here is a very, very old one - it has a hand-soldered header!

It is very odd that it’s working with the vanilla MicroPython build and not our build. Have you tried seeing if it connects to another wi-fi network?

No, I haven’t tried that. I’ll take it to my daughter’s tomorrow and try on her wi-wi network, thanks.

Whoops - I meant wi-fi…

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
>>> 

Hmm, what a puzzle!

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?

Thanks Hel. It does seem strange that I have the same issue on two separate boards, and yet no-one else has the problem.

I’ll try your suggestions. If that doesn’t help, I’ll see if I can get my head around Github.

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.

Have you tried Pimoroni’s 123.0_1 uf2?

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 ;) .

I just flashed 1.23.0-1 to my i75W
If I run this,

import time
import network

from secrets import WIFI_SSID, WIFI_PASSWORD 
  
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(WIFI_SSID, WIFI_PASSWORD)
print(wlan.active())
 
# Wait for connect or fail
max_wait = 10
while max_wait > 0:
    if wlan.status() < 0 or wlan.status() >= 3:
        break
    max_wait -= 1
    print('waiting for connection...')
    time.sleep(1)
 
# Handle connection error
if wlan.status() != 3:
    raise RuntimeError('network connection failed')
else:
    print('connected')
    status = wlan.ifconfig()
    print( 'ip = ' + status[0] )

I get this,

MPY: soft reboot
True
connected
ip = 192.168.2.48

And if I do this right after without doing a reset

>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> print(wlan.active())

I get a True
If I reset my Pico W and try it again,
I get a False.

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.

It seems that wlan.active() returns False even when the network interface is active.

It returns True once the network is connected, mimicking the behaviour of wlan.isconnected():

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():', wlan.active())
wlan.active(): False
>>> from secrets import WIFI_SSID, WIFI_PASSWORD
>>> wlan.connect(WIFI_SSID, WIFI_PASSWORD)
>>> print('wlan.status():', wlan.status())
wlan.status(): 3
>>> print('wlan.active():', wlan.active())
wlan.active(): True
>>> print('wlan.isconnected():', wlan.isconnected())
wlan.isconnected(): True
>>> wlan.disconnect()
>>> print('wlan.active():', wlan.active())
wlan.active(): False
>>> print('wlan.isconnected():', wlan.isconnected())
wlan.isconnected(): False
>>> 
1 Like