Connect pico to wifi without password

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
jensenrobert
Posts: 2
Joined: Wed Aug 03, 2022 7:48 pm

Connect pico to wifi without password

Post by jensenrobert » Wed Aug 03, 2022 7:52 pm

Hi

At my university, we have a dedicated iot-network for various sensors and micro-controllers to connect to. This network is protected only by a white-list and uses an empty password. I have several devices connected to this network, including M5-stacks and a Pi 3, with no problems.

However, the Pico W seems to have a problem with the empty password. I can scan the network with no problems:
wlan.scan()
[.... (b'device', b'\x00,\xc8\x87\r@', 11, -77, 0, 1),
(b'eduroam', b'\x00,\xc8\x87\x0ba', 11, -84, 5, 2),
(b'device', b'\x00,\xc8\x87\x0b`', 11, -86, 0, 1),
...]

But when I try to connect, I get this error:

wlan.connect('device')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 1] EPERM
>>>

Also, using an empty string as password gives same result:
wlan.connect('device', '')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 1] EPERM

I can connect the same unit to my home network without problems, so I am fairly sure the Pico works (also, I have confirmed this on two units).

Any suggestions as to what I can do to get around this?

Best regards
Robert

fdufnews
Posts: 76
Joined: Mon Jul 25, 2016 11:31 am

Re: Connect pico to wifi without password

Post by fdufnews » Thu Aug 04, 2022 4:31 pm

In the MicroPython doc it is declared this way
WLAN.connect(ssid=None, key=None, *, bssid=None)
Connect to the specified wireless network, using the specified key. If bssid is given then the connection will be
restricted to the access-point with that MAC address (the ssid must also be specified in this case).
Have you tried key=None

jensenrobert
Posts: 2
Joined: Wed Aug 03, 2022 7:48 pm

Re: Connect pico to wifi without password

Post by jensenrobert » Fri Aug 05, 2022 4:34 am

Yes, this unfortunately gives the same result :(

muka
Posts: 1
Joined: Sun Aug 07, 2022 2:21 pm

Re: Connect pico to wifi without password

Post by muka » Sun Aug 07, 2022 2:24 pm

I have the same problem? Any progress?

davesaldub
Posts: 2
Joined: Thu Aug 18, 2022 1:51 pm

Re: Connect pico to wifi without password

Post by davesaldub » Thu Aug 18, 2022 1:55 pm

I also have the same issue.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Connect pico to wifi without password

Post by jimmo » Thu Aug 18, 2022 2:25 pm

Does the network have no security (i.e. open), or does it have an empty key?

You need to use
connect("network", security=0)
if it's an open network.

and
connect("network", key="")
if it's an empty key.

I think... It's also possible this is a bug with the Pico W. Can you try both and let me know.

davesaldub
Posts: 2
Joined: Thu Aug 18, 2022 1:51 pm

Re: Connect pico to wifi without password

Post by davesaldub » Thu Aug 18, 2022 2:29 pm

The network has no security, but I tried both just to be sure and I still got the same error.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Connect pico to wifi without password

Post by jimmo » Thu Aug 18, 2022 11:49 pm

OK thanks. Looks like there's already an issue tracking this -- https://github.com/micropython/micropython/issues/9016

Post Reply