bleno
bleno copied to clipboard
[email protected] is broken
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
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 !
Please please fix this and put in a release; I just spent an hour figuring out the same thing.
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
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.
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 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.
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
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"
}
}
is current master working fine ?
@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.
but is the problem also in master branch pin git repo instead of npm version
yes -> https://github.com/abandonware/bleno/blob/master/package.json#L49
so please try to identify the failing patch and revert it
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.
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