-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Can't successfully connect BLE devices on Linux #12
Comments
@MrShinyAndNew It's very little details to work with. I can try something but I only have duplo ble train that is anything close to this. One thing I can tell you is that I took over noble because I'm using it in production environments at work and it has been super stable for us. We are using it all over the place. What is the BLE hci you are using? Do you have any other BLE dongle you can use and see if its the same? Im making thousands request everyday in CI/CD and I do get connection issues but I would say it's like 1 per 10k |
So I did a little digging and I think it could be related to BLE you have either built in or dongle. I have 2 dongles one is BLE 5.3 and the other one is 4.1. With the 5.3 one I do have some inconsistency but 4.1 is like this: IMG_0033.MOVBy this I mean its connecting every single time. No issues |
I'm using a Dell XPS notebook from 2017. I'm not sure how to determine what kind of bluetooth it has. I didn't mean to imply that the noble library doesn't work at all :) but before the kernel changes, everything worked perfectly on this notebook. I don't mind diving in to debug or otherwise dig in to this problem but I don't know where to look - I'm not really an expert in bluetooth. I can try with a different notebook, but it will take some time to get back to you. |
I've tested on my other notebook with the same results. I realize this bug report doesn't have much actionable detail - if there's any test I can run I'd love to help get to the bottom of this. |
If you can |
Okay, here are 4 tests I ran, listed here in the order I ran them. The first two use the node-poweredup library with an override (I've verified it's pulling in the expected noble version). The second two just use plain noble. The address for the remote is "a4:34:f1:99:d0:07". This one, the Lego remote appeared to connect (solid indicator light) right away, but the test program didn't emit the "discovered" event. This one emitted the "discovered" event but then never connected This one instantly failed with "already connected" This one didn't connect. |
I'm trying to connect a Lego Powered Up remote using node-poweredup. I've overridden its dependency to use @stoprocent/noble, but the behaviour is very poor and inconsistent. I think there are still unresolved issues, but I'm not sure how to debug this any further.
The sample program on the noble screen, or the basic sample node-poweredup program both show the same symptoms - they fail to successfully connect to the BLE device 19 times out of 20. Most of the time the program does nothing; sometimes it gives an error "already connected".
I have tried using strace to inspect the system calls and one thing I noticed is that the connect() system call sometimes takes 40s and failes with "Connection refused" - of course my BLE device has given up attempting to connect long before 40s is up.
Example:
connect(24, {sa_family=AF_BLUETOOTH, l2_psm=htobs(0 /* L2CAP_PSM_??? */), l2_bdaddr=07:d0:99:f1:34:a4, l2_cid=htobs(L2CAP_CID_ATT), l2_bdaddr_type=BDADDR_LE_PUBLIC}, 14) = -1 ECONNREFUSED (Connection refused)
The text was updated successfully, but these errors were encountered: