BLE notifications
# help
o
Question for @mikkel.damsgaard -- I'm trying to interact with a button via BLE, but I must be missing something. I've tried this both with an "AB Shutter3" button, and a "VR-PARK" joystick. I scan, discover, and connect to the device. Then I retrieve the relevant service, and the characteristic.The properties are 18 and 26 respectively, ie they support notifications. I subscribe to the characteristic, and then
wait_for_notification
on it. This blocks, and nothing happens, even if I press the button(s) to create events. (Actually, even reading out the characteristic without bothering with the notification doesn't yield any changed values). Any idea what I'm missing? For the VR-PARK, there is some sample code which I'm trying to replicate: https://github.com/BigJBehr/ESP32-Bluetooth-BLE-Remote-Control/blob/master/BLE-VRBOX.ino
f
@mikkel.damsgaard any idea?
o
Here is my test program
m
Nothing springs to mind as to what the problem can be. I would probably need the HW to debug.
o
I'm just puzzled that it happens on both devices -- I got the VR-PARK after the AB Shutter3 didn't work, but that doesn't either. Is there another way I can test whether they work? I assuem I cannot run that on my Ubuntu machine, as that won't have BLE?
I've got a third button on order to arrive in about two weeks...
m
BLE scanner on the android is my go-to tool to verify if the device is working as expected. It can subscribe and show updates.
It is not unreasonable to expect the toit-ble has issues. So we need to narrow it down.
o
Alas I have an iPhone 😦
When I pair either device with my phone, I can use them to change the volume (as the AB Shutter3 simulates a camera remote, and the VR-PARK is intended for media applications), so they definitely send something via bluetooth.
m
Moat likely it is the pairing part. The toit implementation does not support pairing (yet).
o
Ah, OK...
Just for planning purposes: is that on the cards to be added? If not then I need to find a different solution for my project.
m
It is very much on my list of things to do soon. We also need a remote control in our project and I already ordered the sony vr controller
o
Great! I'd be happy to help with testing if needed.
m
Ok. So I kind of implemented the secure/pairing stuff. Unfortunately, it seems to not be enough. These devices uses L2CAP stuff. I will keep trying to find a solution.
o
Thanks. As I said, happy to help with testing, I’ve got three bluetooth buttons now to play with!
m
Right. So, I got the VR-PARK working. The root cause was that the HID service uses the same UUID for several characteristics. That was not anticipated by the code. I am getting data now when pressing keys and using the joystick.
12 Views