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

espruino --list returns "Error: No compatible USB Bluetooth 4.0 device found!" #151

Open
TheLogan opened this issue Jun 27, 2022 · 3 comments

Comments

@TheLogan
Copy link

Hi, so I am trying to see my Bangle.js 2 on my pc, I'd rather use VS Code for development than the app, so I am playing around with commandline.
In the web ide I can connect to my bangle with the button in the top left, no issues.
But in commandline I get the following error:

undefined:55
    } else throw err;
           ^

Error: No compatible USB Bluetooth 4.0 device found!
    at BluetoothHciSocket.bindUser (C:\Users\tlo\AppData\Roaming\nvm\v16.15.0\node_modules\espruino\node_modules\@abandonware\bluetooth-hci-socket\lib\usb.js:91:11)
    at BluetoothHciSocket.bindRaw (C:\Users\tlo\AppData\Roaming\nvm\v16.15.0\node_modules\espruino\node_modules\@abandonware\bluetooth-hci-socket\lib\usb.js:47:8)
    at Hci.init (C:\Users\tlo\AppData\Roaming\nvm\v16.15.0\node_modules\espruino\node_modules\@abandonware\noble\lib\hci-socket\hci.js:121:20)
    at NobleBindings.init (C:\Users\tlo\AppData\Roaming\nvm\v16.15.0\node_modules\espruino\node_modules\@abandonware\noble\lib\hci-socket\bindings.js:93:13)
    at C:\Users\tlo\AppData\Roaming\nvm\v16.15.0\node_modules\espruino\node_modules\@abandonware\noble\lib\noble.js:61:24
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

I suspect that the culprit is bluetooth-hci-socket is in a folder called @abandonware and when I went to their page I could see that the last release was 6 years old and the last code edit was 4 years old.
So it's likely woefully outdated at this point :(

I did find this
noble/node-bluetooth-hci-socket#118
but it doesn't really seem like a viable solution, and I can't get it working for my self either.

It seems that the @abandonware project is an attempt to save orphaned projects, but it hasn't really helped this one xD
Not sure what the solution is though :/

@mariusGundersen
Copy link
Contributor

I had the same problem, and I solved it using the issue you linked to. So edit the file in node_modules adding the values used there, and it should work.

Obviously that's not a very good solution, so maybe a PR to @abandonware could help?

@TheLogan
Copy link
Author

TheLogan commented Jun 28, 2022

I had the same problem, and I solved it using the issue you linked to. So edit the file in node_modules adding the values used there, and it should work.

image
Like this, right? I first tried with the values suggested in the link, and when that didn't work I downloaded zadig got the values relevant to my pc and tried again, but still didn't work.

Obviously that's not a very good solution, so maybe a PR to @abandonware could help?

If it had worked, then certainly, but ... well I at least can't get it to work xD

@gfwilliams
Copy link
Member

Moving this to the EspruinoTools repo...

I think there's a list of supported devices, and you just put your device's USB IDs here: https://github.com/abandonware/node-bluetooth-hci-socket/blob/master/lib/usb.js#L15-L30

A PR to abandonware would be great. Basically the original 'noble' was just totally abandoned so that project sprung up to try and fix the issues with it.

Either way, it's not really a great solution since it goes straight to the USB adaptor. Since Windows 10 you can just access BLE devices via API, and you'd hope there would be a node module to handle that. I'm not sure if there is though.

I did winnus but then Node.js changed their API so it doesn't build for more modern Node.js versions (and even so since then Windows released a better API that should be used instead)

@gfwilliams gfwilliams transferred this issue from espruino/Espruino Jun 28, 2022
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

3 participants