espruino / EspruinoTools

JavaScript library of tools for Espruino - used for the Web IDE, CLI, etc.
Apache License 2.0
150 stars 89 forks source link

Add support for BLE on Linux using the node-ble package as noble is o… #145

Closed pelrun closed 2 years ago

pelrun commented 2 years ago

…ld and broken

I've implemented a new serial port plugin using the node-ble module, as it appears to be in much better shape than noble. Successfully detects and connects to my Bangle.js 2.

gfwilliams commented 2 years ago

This looks great - thanks! Really nice to have something that doesn't have anything native in there.

I wonder maybe if /etc/dbus-1/system.d/node-ble.conf doesn't exist, we could log to the console exactly what the user should put into it? That way it's more obvious if EspruinoTools doesn't work what they have to do?

pelrun commented 2 years ago

Oof, was just about to say "hold up, found a couple of bugs!" While scanning and connection are working, reading and writing are still a bit broken (only just confirmed that it was my code). I'm nearly done fixing them, will raise a new PR once I have it actually working :)

pelrun commented 2 years ago

I'll see what I can do about detecting permissions problems; hopefully I get something unambiguous out of the module so I can wave the flag appropriately.

gfwilliams commented 2 years ago

That'd be great - thanks! I can always revert if you need but right now that version of EspruinoTools isn't on NPM so if you can fix stuff soonish then I doubt it'll be an issue