-
Notifications
You must be signed in to change notification settings - Fork 494
Is there a way to configure the connection interval, slave latency and supervisor timeout? (hcitool lecup) #117
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. I'm not sure what the originator of this issue meant, but I'm trying to find a way of setting the above parameters from within BluePy. I have successfully connected to a Yamaha BLE MIDI device (UDBT01) from a Raspberry Pi using BluePy. The UDBT01 is plugged in to my AKAI EWI-USB wind controller and it talks via Bluetooth to the synth running in my RPi. It works, but unless I re-configure the BLE connection parameters after the connection is made, the latency is terrible. I run: So my question is: can the parameters be set in BluePy as part of the connection setup? Ben |
Is there a way to get the connection handle integer from a peripheral, in the meantime? All you'd need is a way to get this identifier and you could run this using subprocess.Popen as a stopgap... |
The short answer is, I think, no. The connection handle (the thing you get out of the Connection Complete event) doesn't ever come out of the internals of the AF_BLUETOOTH socket, as far as I can tell. @gonzob - you're getting the connection handle by looking at hcidump output, or something?? It's looking increasingly like I'm going to give up on BlueZ and write a whole stack just in Python, talking to a raw HCI socket. |
Hi Ian. Ben |
We had a similar issue in our project, and we ended up changing these files to control the connection intervals : echo 16 > /sys/kernel/debug/bluetooth/hci0/conn_min_interval you only need to set the value once, which is easier than calling hcitool (Credits go to Andrew Bartow) |
That looks great! However, on the two systems I have checked (ubuntu and raspbian) those files seem to be re-created each time the bluetooth connection comes up. Won't your values be overwritten? Ben |
Actually, I never noticed that. My code sets these values every time anyway :) |
According to my experience, the parameters set through such method would be reset when the computer restarts. |
echo 16 > /sys/kernel/debug/bluetooth/hci0/conn_min_interval My BLE master was sending a Connection Request with the correct interval values, after I had changed the above 2 files. However, it always accepts the Connection Parameters suggested by the slave. Do you all know how to reject Connection Parameters Update Requests from the slave? |
i think i was observing the same as @yupeng-zglue so i worked out how to detect a new connection in python and then run the hcitool method from python. it's working well. |
@pstanton |
yes, specifically "PropertiesChanged" > "org.bluez.Device1" > "ServicesResolved" |
No description provided.
The text was updated successfully, but these errors were encountered: