Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aioble 'BLE' object has no attribute 'l2cap_connect' on Pico-W #803

Open
mcarlson opened this issue Feb 9, 2024 · 2 comments
Open

aioble 'BLE' object has no attribute 'l2cap_connect' on Pico-W #803

mcarlson opened this issue Feb 9, 2024 · 2 comments

Comments

@mcarlson
Copy link

mcarlson commented Feb 9, 2024

I'm trying to run the l2cap_file_client.py and l2cap_file_server.py examples from https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble on my Pico-W. I'm currently running MicroPython v1.22.0-preview.236.ge1a7aa23f on 2023-12-09; Raspberry Pi Pico W with RP2040

It sounds like the BLE support for the Pico-W is missing l2cap functionality, I get stack traces like:

...
Connecting to Device(ADDR_PUBLIC, d8:3a:dd:94:88:0e)
Discovering...
Connecting channel
Task exception wasn't retrieved
future: <Task> coro= <generator object 'getPrefsFromServer' at 20012c60>
Traceback (most recent call last):
  File "asyncio/core.py", line 1, in run_until_complete
  File "l2cap_file_client.py", line 152, in getPrefsFromServer
  File "l2cap_file_client.py", line 62, in connect
  File "aioble/device.py", line 288, in l2cap_connect
  File "aioble/l2cap.py", line 205, in connect
AttributeError: 'BLE' object has no attribute 'l2cap_connect'

What can I do to get this working? More documentation about what is/isn't supported on a given platform would be really helpful as I just blew an afternoon getting to this point. Seems to be a bit of a theme, see #444 and #686

@andrewleech
Copy link
Sponsor Contributor

Yes unfortunately l2cap support hasn't been added on btstack BLE integration yet which rp2 uses.

https://docs.micropython.org/en/latest/library/bluetooth.html#l2cap-connection-oriented-channels

Note: This is currently only supported when using the NimBLE stack on STM32 and Unix (not ESP32). Only one L2CAP channel may be active at a given time (i.e. you cannot connect while listening).

@mcarlson
Copy link
Author

Okay, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants