Hi,
My new Pico W arrived!
I had some code written for the ESP32 that set the device up as an access point and served a web page with some buttons controlling a couple of io pins. As the micropython network library is common I thought I'd see if it would run, it did.... almost!
I got an error when setting up the access point:
station = network.WLAN(network.AP_IF)
station.active(True)
station.config(essid='PICO')
station.config(authmode=3,password='12349876')
The error was thrown on the last line and reports an unknown argument. What I remove the "authmode" argument the code runs and the page is served but the WiFi network is unlocked!
I went back to the micropython docs for network.WLAN and the "authmode" argument is not there but "security" is, '3' is equal to wpa2. Changing the argument to "security" trows the same error.
I think the Pico WiFi device can operate wpa3. I assume this would be backward compatible but I'm not sure. No library option can constant appears for wpa3 that I can find.
The setup guide doesn't seem to cover operation as an access point either.
Has anyone set up their Pico as an access point with security?
Letting anyone connect even to a dev project just doesn't seem like a good idea!
Many thanks for any help you could provide
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
- aallan
- Raspberry Pi Employee & Forum Moderator
- Posts: 321
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
Re: Pi Pico W Access Point
Patrick1234 wrote: ↑Sun Jul 03, 2022 7:56 amI had some code written for the ESP32 that set the device up as an access point and served a web page with some buttons controlling a couple of io pins. As the micropython network library is common I thought I'd see if it would run, it did.... almost!
I got an error when setting up the access point:
station = network.WLAN(network.AP_IF)
station.active(True)
station.config(essid='PICO')
station.config(authmode=3,password='12349876')
This works for me,
Code: Select all
ssid = 'MicroPython-AP'
password = '123456789'
ap = network.WLAN(network.AP_IF)
ap.config(essid=ssid, password=password)
ap.active(True)
Head of Documentation
Raspberry Pi Ltd
About me, http://alasdairallan.com
Raspberry Pi Ltd
About me, http://alasdairallan.com
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
Many thanks I'll give that a try when I'm back.
Last night I used:
station = network.WLAN(network.AP_IF)
station.active(True)
station.config(essid='PICO')
station.config(password='12349876')
This worked but the WiFi network was open. I can't think why it would be different specifying arguments in separate variables but possible it's an oddity of the port I guess.
Last night I used:
station = network.WLAN(network.AP_IF)
station.active(True)
station.config(essid='PICO')
station.config(password='12349876')
This worked but the WiFi network was open. I can't think why it would be different specifying arguments in separate variables but possible it's an oddity of the port I guess.
Re: Pi Pico W Access Point
Interestingly, that example sort of works for me but gives an unsecured AP called PICO2947
Have I got the right version of MicroPython for pico-w? Mine is: micropython-firmware-pico-w-290622.uf2
Although the "connecting-to-the-internet-with-pico-w.pdf" links to :rp2-pico-w-20220630-unstable-v1.19.1-88-g99c258977.uf2
(Same result with that version...)
Code: Select all
import network
ssid = 'MicroPython-AP'
password = '123456789'
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid=ssid, password=password)
Although the "connecting-to-the-internet-with-pico-w.pdf" links to :rp2-pico-w-20220630-unstable-v1.19.1-88-g99c258977.uf2
(Same result with that version...)
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
Hi Niel,
I had the same experience. You can change the SSID by moving the active() statement after assigning the SSID name. Still the same problem with an unsecured access point though.
I had the same experience. You can change the SSID by moving the active() statement after assigning the SSID name. Still the same problem with an unsecured access point though.
Re: Pi Pico W Access Point
Yes, moving the ap.active(True) to after the ap.config works. (like the ESP32 documentation has it)
What does NOT work is having the password parameter.
What does NOT work is having the password parameter.
Re: Pi Pico W Access Point
If I'm not mistaken, the config parameters that MicroPython has on offer for the Pico W can be seen here and are:
That being said, there is a C SDK example called access_point in the pico_examples repository and the access point is secured. It's secured by calling cyw43_arch_enable_ap_mode here.
- antenna
- channel
- ssid or essid
- monitor
- key or password
- pm
- trace
- txpower
That being said, there is a C SDK example called access_point in the pico_examples repository and the access point is secured. It's secured by calling cyw43_arch_enable_ap_mode here.
https://github.com/fivdi
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
Hi,
I would agree that the issue seems to be that the security or authmode Param is not implemented. I hope that this is just a temporary issue and wl be picked up by a future release soon as it's a significant safety/reliability issue especially considering the client limit is 4.
I'm also hesitant about using the Pico as a client as without an encryption feature such as the ESP32 offers the network password is vulnerable. I
Also I wonder about the possibility of remote reconfiguration when an AP or as a client.
I really like the Pico so hope at least secure AP functionality can be implemented soon
I would agree that the issue seems to be that the security or authmode Param is not implemented. I hope that this is just a temporary issue and wl be picked up by a future release soon as it's a significant safety/reliability issue especially considering the client limit is 4.
I'm also hesitant about using the Pico as a client as without an encryption feature such as the ESP32 offers the network password is vulnerable. I
Also I wonder about the possibility of remote reconfiguration when an AP or as a client.
I really like the Pico so hope at least secure AP functionality can be implemented soon
- aallan
- Raspberry Pi Employee & Forum Moderator
- Posts: 321
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
Re: Pi Pico W Access Point
Huh. This does seem to be the case for the current release build, I'm also seeing an open network.
However it did work in earlier, pre-release builds, of MicroPython. Leave it with me, I'll start an internal email chain and see if we can sort this out.
Head of Documentation
Raspberry Pi Ltd
About me, http://alasdairallan.com
Raspberry Pi Ltd
About me, http://alasdairallan.com
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
Hi Alan,
Many thanks
For looking into this.
Patrick
Many thanks
For looking into this.
Patrick
Re: Pi Pico W Access Point
Yes thanks.
The C access point works (poll version) with SSID = picow_test and password = password
It is shown (on connected phone) as WPA/WPA2-Personal
Thanks fivdi
The C access point works (poll version) with SSID = picow_test and password = password
It is shown (on connected phone) as WPA/WPA2-Personal
Thanks fivdi
Re: Pi Pico W Access Point
fivdi wrote: ↑Sun Jul 03, 2022 3:55 pmThe security or authmode parameter which is supported on the ESP32 doesn't appear to be available for the Pico W.
Both "auth" and "security" there, with "auth" noted as deprecated a few lines below where "security" supplants it. I'm guessing "auth" is what used to be "authmode" on other boards - MicroPython seems to make a habit of that, making the new subtly different to what's gone before and what the documentation says. That means example code and libraries for one board annoyingly won't work as is on another even though they should and could.
Oops - That's 'connet' not 'config'.
As to how it works, or why it doesn't - Can't help there it's all new to me. I think you have to dig through the layers to figure out what does what, and why it isn't.
Last edited by hippy on Sun Jul 03, 2022 9:02 pm, edited 1 time in total.
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
Interesting, I couldn't find a stable version of the Pico W micropython u2f file. Maybe it's just a damaged file on Fridays build?
At the moment "security" nor "auth" appear to operate in this build.
I'll try next week and see where I get.
I'm wondering if there is a way to list all parameters available - perhaps using inspect?
At the moment "security" nor "auth" appear to operate in this build.
I'll try next week and see where I get.
I'm wondering if there is a way to list all parameters available - perhaps using inspect?
Re: Pi Pico W Access Point
To me that looks like part of the connect method which isn't used for access points (this topic is about access points.)hippy wrote: ↑Sun Jul 03, 2022 8:08 pmThey look to be here to me - https://github.com/micropython/micropyt ... w43.c#L232fivdi wrote: ↑Sun Jul 03, 2022 3:55 pmThe security or authmode parameter which is supported on the ESP32 doesn't appear to be available for the Pico W.
https://github.com/fivdi
Re: Pi Pico W Access Point
Yes; I was editing my post to correct that. I concur - it doesn't appear to be supported.fivdi wrote: ↑Sun Jul 03, 2022 8:59 pmTo me that looks like part of the connect method which isn't used for access points (this topic is about access points.)hippy wrote: ↑Sun Jul 03, 2022 8:08 pmThey look to be here to me - https://github.com/micropython/micropyt ... w43.c#L232fivdi wrote: ↑Sun Jul 03, 2022 3:55 pmThe security or authmode parameter which is supported on the ESP32 doesn't appear to be available for the Pico W.
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
Hi,
Ive had a crude look:
print(station.config("mac")
print(station.config("essid")
print(station.config("key")
All respond as expected, auth, auth_mode, security all return the expected "unknown config param" error.
Ive had a crude look:
print(station.config("mac")
print(station.config("essid")
print(station.config("key")
All respond as expected, auth, auth_mode, security all return the expected "unknown config param" error.
Re: Pi Pico W Access Point
can you report this on the github repo?Patrick1234 wrote: ↑Sun Jul 03, 2022 9:32 pmHi,
Ive had a crude look:
print(station.config("mac")
print(station.config("essid")
print(station.config("key")
All respond as expected, auth, auth_mode, security all return the expected "unknown config param" error.
//Edit: Nvm, i've done it now: https://github.com/micropython/micropython/issues/8858
Last edited by Taki7o7 on Mon Jul 04, 2022 6:48 am, edited 1 time in total.
- aallan
- Raspberry Pi Employee & Forum Moderator
- Posts: 321
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
Re: Pi Pico W Access Point
Patrick1234 wrote: ↑Sun Jul 03, 2022 8:28 pmInteresting, I couldn't find a stable version of the Pico W micropython u2f file. Maybe it's just a damaged file on Fridays build?
There hasn't yet been a stable release for Pico W.
Head of Documentation
Raspberry Pi Ltd
About me, http://alasdairallan.com
Raspberry Pi Ltd
About me, http://alasdairallan.com
Re: Pi Pico W Access Point
MicroPython have moved away from using "stable" and "unstable" terminology to using "release" and "nightly build". That avoids any incorrect interpretation that 'stable is reliable but unstable isn't".Patrick1234 wrote: ↑Sun Jul 03, 2022 8:28 pmInteresting, I couldn't find a stable version of the Pico W micropython u2f file.
A "nightly build" should be no less stable than a "release" in terms of reliability of operation. It's just that there may be some recently added features which need to be tested further, or issues ironed out, before it becomes a "release".
If something is not in a particular build it is unlikely that the UF2 is corrupt, more likely it has not been implemented due to an oversight or being a forthcoming feature, the implementation has changed but that has not been documented everywhere, or there have been issues not previously identified with the implementation; good old fashioned bugs.
MicroPython builds for the Pico-W can be found here -
There is only a "nightly build" at the present time. Releases tend to happen every 3 to 5 months, but a 1.19.2 or 1.20.1 release may arrive sooner. Just use the latest "nightly build" until it does.
- aallan
- Raspberry Pi Employee & Forum Moderator
- Posts: 321
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
Re: Pi Pico W Access Point
Looks like this issue has now been resolved, see https://github.com/micropython/micropython/issues/8858.
Head of Documentation
Raspberry Pi Ltd
About me, http://alasdairallan.com
Raspberry Pi Ltd
About me, http://alasdairallan.com
-
- Posts: 23
- Joined: Sun Feb 21, 2021 11:40 pm
Re: Pi Pico W Access Point
That's great news. Many thanks
Re: Pi Pico W Access Point
Tested with the 4th July version - still gives security = None, so maybe I need to wait for a later build than :
rp2-pico-w-20220704-unstable-v1.19.1-90-g3d76292f3.uf2
rp2-pico-w-20220704-unstable-v1.19.1-90-g3d76292f3.uf2
- aallan
- Raspberry Pi Employee & Forum Moderator
- Posts: 321
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
Re: Pi Pico W Access Point
Looking at the timestamps on my emails it should be in today's (5th July) nightly build. Or you could just download the source and build the UF2 yourself?
Head of Documentation
Raspberry Pi Ltd
About me, http://alasdairallan.com
Raspberry Pi Ltd
About me, http://alasdairallan.com
Re: Pi Pico W Access Point
The good news is that the fixes have made it way into the latest source code - v1.19.1-93
The bad news is it no longer builds - - Solved : viewtopic.php?p=2017292#p2017292
Last edited by hippy on Tue Jul 05, 2022 9:26 am, edited 1 time in total.
- aallan
- Raspberry Pi Employee & Forum Moderator
- Posts: 321
- Joined: Mon Feb 09, 2015 11:30 am
- Location: Exeter, UK
Re: Pi Pico W Access Point
Just checked, v1.19.1-93 built for me out of the box?
Head of Documentation
Raspberry Pi Ltd
About me, http://alasdairallan.com
Raspberry Pi Ltd
About me, http://alasdairallan.com