bleno icon indicating copy to clipboard operation
bleno copied to clipboard

[email protected] is broken

Open qpre opened this issue 3 years ago • 14 comments

Hello,

Over the last few days we experienced an issue causing bleno to only show advertisement data with no access to services when deployed on a RPI3. It would even make remote apps like Lightblue randomly crash on connection.

in this capture there are supposed to be two services with many characteristics available screenshot

After a few (okay, a lot) investigations, we found out that bluetooth-hci-socket's version in the dependencies is not pinned to a specific revision causing it to be updated when the dependency is updated.

It appears that @abandonware/[email protected] is broken (see: https://github.com/abandonware/node-bluetooth-hci-socket/issues/31 ) and forcing @abandonware/[email protected] solved the issue.

Would it be possible put a warning in the README and to either lock the optional dependency's version in the package.json or move it to a peerDependency so that people can choose the revision they install ? (I can take care of the PR if needed).

Thanks !

qpre avatar Jan 08 '22 09:01 qpre

Please please fix this and put in a release; I just spent an hour figuring out the same thing.

taxilian avatar Mar 10 '22 19:03 taxilian

Yes, I am also witnessing the LightBlue crash issue.

Not sure if this is from the same issue, or situation, but I am getting an error from hcidump that was NOT there when I was first building my app...

> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 64 reason 0x16
    Reason: Connection Terminated by Local Host

shawnnolanjr avatar Apr 09 '22 19:04 shawnnolanjr

It looks like @abandonware/noble has [email protected] as an optional dependency, which we also use in our project.

Using yarn, I tried to resolve hci socket to 0.5.3-7, but it fails to install (incompatible engine darwin) on my mac, so I wasn't able to feel confident opening a PR for pinning the version.

goofiw avatar Apr 10 '22 19:04 goofiw

Hmm... I'm still seeing this issue even when I force @abandonware/[email protected]. Not to complicate things further, as this might be something unrelated (I have yet to find a sanity check that works, but I am basically just trying the test.js on 3 different devices)

I'm trying on node v14.18.1, both ARM and x86

rivertam avatar Jun 23 '22 15:06 rivertam

@rivertam you might have done it already but verify that your yarn.lock contains a single instance of @abandonware/bluetooth-hci-socket and that it's revision is 0.5.3-7 and use yarn install --frozen-lockfile on your device. I also noted that I needed to restart the device if I inadvertently installed the 0.5.3-8 before since it was started.

qpre avatar Jun 28 '22 11:06 qpre

This is currently still an issue, @abandonware/bluetooth-hci-socket on its version 0.5.3-7 should be pinned on the package.json and a new relese should ne publish to npm as the current lastest is completly broken

JP-tech-sh avatar Jul 08 '22 19:07 JP-tech-sh

For anyone struggling with this, you can easily pin the older version in your project using yarn's "resolutions" block.

I got it working by doing this in package.json:

{ 
    "dependencies": {
        "@abandonware/bleno": "^0.5.1-4"
    },
    "resolutions": {
        "@abandonware/bluetooth-hci-socket": "0.5.3-7"
    }
}

ryanthompson0123 avatar Sep 15 '22 19:09 ryanthompson0123

is current master working fine ?

rzr avatar Sep 16 '22 08:09 rzr

@rzr it should for people using npm (package-lock.json is locked on 0.5.3-7) but anyone using another package manager (yarn, pnpm...) will get a broken package because package.json states "@abandonware/bluetooth-hci-socket": "^0.5.3-7" and thus will be resolved to the broken 0.5.3-8

Pinning 0.5.3-7 directly in package.json would solve it for everyone.

qpre avatar Sep 19 '22 14:09 qpre

but is the problem also in master branch pin git repo instead of npm version

rzr avatar Sep 20 '22 13:09 rzr

yes -> https://github.com/abandonware/bleno/blob/master/package.json#L49

qpre avatar Sep 20 '22 14:09 qpre

so please try to identify the failing patch and revert it

rzr avatar Sep 21 '22 09:09 rzr

I was having the same issue with my Raspberry Pi 3B and spent quite a while trying to figure out the problem before I found this thread. Fortunately the same fix worked for me, pinning the version of bluetooth-hci-socket to 0.5.3-7. Definitely seems to be something broken in the latest version, although I don't have a clue what it is.

By the way, thank you so much for your work on this project! I was disappointed to see the original project abandoned, and then I stumbled across this fork. I'm very happy to see it's alive. I've never done anything with Bluetooth before, but I have a reason currently, and it's pretty cool what's possible here.

compeek avatar Oct 15 '22 10:10 compeek

It looks like @abandonware/noble has [email protected] as an optional dependency, which we also use in our project.

Using yarn, I tried to resolve hci socket to 0.5.3-7, but it fails to install (incompatible engine darwin) on my mac, so I wasn't able to feel confident opening a PR for pinning the version.

@goofiw were you able to find a solution to this issue? im running into the same problem

ajtadeo avatar Nov 30 '23 06:11 ajtadeo