Pico-W OSError: [Errno 22] EINVAL bluetooth module
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
RP2040 / Pico-W
MicroPython version
MicroPython v1.23.0-preview.116.g0432f7320 on 2024-02-12; Raspberry Pi Pico W with RP2040
Reproduction
This fault occurs when setting up a Bluetooth LE peripheral on a Pico-W. Three services are defined and added to the server configuration using BLE.gatts_register_services(). I've attached a code module to demonstrate the problem
Expected behaviour
The expected return from BLE.gatts_register_services() should be similar to that returned on an Arduino RP2040 Nano Connect using MicroPython v1.22.1 on 2024-01-05. E.g
((21, 24, 26), (29, 32, 34, 37), (41, 44, 46, 49))
Writes to values using these handles work as expected.
Observed behaviour
The returned set of handles from BLE.gatts_register_services() contains duplicates e.g.
((9, 12, 14), (17, 20, 22, 25), (27, 28, 28, 28))
Writing a value to handle 17 works OK. Writing a value to handle 27 causes Error 22.
Additional Information
The ESP32 port appears OK too.
Pico W:when I try "wlan.connect()" and "wlan.scan()" ,I get an "OSError: [Errno 1] EPERM"
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
raspberry pico w with rp2040
MicroPython version
MicroPython v1.19.1-88-g74e33e714 on 2022-06-30; Raspberry Pi Pico W with RP2040
MicroPython v1.22.1 on 2024-01-05; Raspberry Pi Pico W with RP2040
Reproduction
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(BSSID, pwd)
Expected behaviour
No response
Observed behaviour
Traceback (most recent call last):
File "<stdin>", line 169, in handle_key
File "<stdin>", line 152, in menu_wifi
File "<stdin>", line 120, in wlan_connect
OSError: [Errno 1] EPERM
Additional Information
I've looked for a solution to a similar problem, but it doesn't help me.
I tried "micropython.alloc_emergency_exception_buf(100)" by ChatGPT, but it didn't work.