-
Notifications
You must be signed in to change notification settings - Fork 1k
aioble: Connecting to the Apple Media Service (Pico-W) #686
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
Comments
Hi! |
No I couldn’t work it out, dug into the code a bit to see if I could find it’s origin but even that didn’t help much (though I might not have gone to a deep enough layer) |
@neil-morrison44 if you want to pico-w to connect to anything you should use central role( scan and connect ) like this aioble example. the code that you're using now is for peripheral mode( aioble.advertise ) |
@puppet13th peripheral mode is correct for the Apple Media Service, the phone is the central device. |
from this picture there is MS and MR. what is pico role there? |
@neil-morrison44 after connection try add these line:
if those config not implemented for pico-w yet you can edit security.py comment out 171 line: |
@puppet13th puppet13th it'd be the |
@neil-morrison44 i have not use any pico-w board yet, have you check if ble pair implemented in pico-w port? on esp32 port pair only implemented since firmware version 1.20 |
Yeah - it seems like |
I'm facing the same issue with my raspberry pico w. I'm trying to read the I guess the gatt error 5 is the That makes somewhat sense when the peripheral is not paired / bonded to the iPhone. However, when adding the As I interepret the code in Also note that the example from the official repo https://github.com/micropython/micropython/blob/master/examples/bluetooth/ble_bonding_peripheral.py does not seem to work anymore, giving the same fault at https://github.com/micropython/micropython/blob/master/examples/bluetooth/ble_bonding_peripheral.py#L70 (using the nightly build version as of 3.2.2024) |
huh looking into it it may not be... since it uses |
Yeah I'm pretty sure bonding is currently only supported on stm32 |
thanks for the feedback. Yeah I feared that a bit... pitty since bonding is sometimes required to readout characteristics. studying the release notes: https://micropython.org/resources/micropython-ChangeLog.txt it was mentioned that the esp32 port is also supporting bonding from 1.20 onward... but haven't tested that. I'll give it a shot with a pyboard d. In general, it would be good to have an overview with a list of |
Ok so the bonding support is not enabled on the pico w, but it can be done via
recompiling and then the However it doesn't continue any further from there. If I confirm it on the mobile it doesn't seem to continue the bonding process. I then enabled the logs via |
Yeah the problem is a bunch of C functions would need to be written to recieve any pairing and bonding events from btstack and convert those events into the form that aioble expects. I wrote some of the initial stm versions of these a few years ago for nimble, but btstack was not supported on my hardware (stm32wb55) so I wasn't able to prepare the code for that stack. If you take a look in https://github.com/micropython/micropython/blob/master/extmod/nimble/modbluetooth_nimble.c at everywhere enabled by |
so I tried - but faced isses... see. micropython/micropython#13639 @andrewleech thanks for the pointers! I had a look around those files and I also think it should be doable. But what I really need is a working (uPy-) example of a platform where bonding is known to work, to get a feeling of how the interactions works during the bonding process. For example, it's still unclear to me if |
Hi,
I'm trying to use a Pi Pico W to connect to the Apple Media Service, but I'm running into a few issues.
This'll connect, find the services, characteristics but then throws:
On the
.subscribe(notify=True)
bit, not sure how / if I can look up theGattError: 5
bit for more info?There is a CircuitPython implementation here, https://docs.circuitpython.org/projects/ble_apple_media/en/latest/index.html
Which uses a "Service Solicitation" advertisement - what's the method for constructing that in aioble? I'm guessing custom
adv_data
&resp_data
but I'm unsure of the format, etc.That implementation also pairs to the connecting device, but when I insert a
await connection.pair()
I getWhich I guess is due to the Pico-W implementation not (currently?) supporting something in
ble.config(bond=bond, le_secure=le_secure, mitm=mitm, io=io)
Thanks
The text was updated successfully, but these errors were encountered: