← index #14458Issue #14097
Related · high · value 2.114
QUERY · ISSUE

Pico-W OSError: [Errno 22] EINVAL bluetooth module

openby redhead-popened 2024-05-09updated 2026-03-24
bugport-rp2

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

BLE-OSError22.zip

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.

CANDIDATE · ISSUE

rp2: code sometimes hangs when doing `bluetooth.BLE().active(True)`

openby dpgeorgeopened 2024-03-15updated 2025-03-03
bugport-rp2

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

rp2 port with RPI_PICO_W

MicroPython version

RPI_PICO_W-20240105-v1.22.1.uf2

Reproduction

Run the application at https://github.com/Gaudon/zephyr-cycling:

  • install RPI_PICO_W-20240105-v1.22.1.uf2 to a Pico W board
  • copy all files from the above repo to the board (omit firmware directory)
  • copy config/template-primary.txt or config/template-secondary.txt to the board at config/config.txt (they can be changed to assign different GPIO if needed)
  • reset the board to run the code in main.py

Expected behaviour

Application starts and continues to run.

Observed behaviour

Code sometimes hangs at ble.active(True).

Additional Information

This is branched off from issue #6423 at https://github.com/micropython/micropython/issues/6423#issuecomment-1995163998

Note that I cannot reproduce this issue, but @Gaudon can in the above thread.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied