node-bluetooth-serial-port icon indicating copy to clipboard operation
node-bluetooth-serial-port copied to clipboard

Bluetooth Server is not discoverable

Open fromage9747 opened this issue 1 year ago • 0 comments

@atilag

When using this repo I am unable to discover my Device from multiple different Bluetooth Clients external to my device.

What I have done through various troubleshooting steps over a vast amount of forum posts pertaining to many other elements of a bluetooth/rfcomm server:

  1. Installed "apt-get install build-essential libbluetooth-dev"
  2. Installed node-gyp
  3. Modifed /usr/lib/systemd/system/bluetooth.service to the below:
ExecStart=/usr/lib/bluetooth/bluetoothd --compat
ExecStartPost=/bin/chmod 777 /var/run/sdp
  1. Run rfkill unblock bluetooth
  2. Tried various "C" codes ie: https://github.com/atwilc3000/sample/tree/master/Bluetooth without success, but I encounter compilation errors which may be related to the reason why this is not working for me.

I found some post stating that there is something wrong with BlueZ in Ubuntu 22 but running bluetoothctl works perfectly. The server is discoverable and can be connected to.

I am running Ubuntu 22.04, BlueZ 5.64, Node v16.20.2, tested with two dongles incase the built-in one had issues.

At a loss of what I can try next. I understand that this repo is no longer maintained, but do you still use it for your own devices? Do you have an example NodeJS app that I can peruse to try and troubleshoot mine? I am implementing it using NestJS.

If I could just get one bit of code to work externally of using the direct bluetoothctl commands, then perhaps I could find where the issue is coming from.

A lot of what I found online pertains to Unified Remote Control software, which I installed on my Ubuntu machine and worked without issue. I can only assume that this means SDP is working.

What I have been able to ascertain when having a look at your code is that you have done what Ionic has done where they create a bridge between Native code and JavaScript.

Interestingly enough, in order to not waste your time I dig some more searching online and found this repo: https://github.com/Niels-Be/node-bluez which has almost worked. My Bluetooth device is discoverable. Just having issues with pairing.

At least I can rule out my device being the issue.

Any help/advice would be greatly appreciated.

Cheers

fromage9747 avatar Mar 22 '24 09:03 fromage9747