Skip to content

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

Open
@redhead-p

Description

@redhead-p

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions