-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Missing poweredOn event (at least in Ubuntu 24.04) #4
Comments
confirmed with the quick start that the event never happens:
|
Same question As in matter.js ... Are capabolities set correctly? https://github.com/stoprocent/noble?tab=readme-ov-file#running-without-rootsudo-linux-specific ... else try if it works with sudo then it is about this. |
@Apollon77 we have tested both with and without setcap (as non root) and even running directly as root still has the same issue.
|
Which kernel the newest Ubuntu uses? Could it be related to abandonware/node-bluetooth-hci-socket#60 (comment) |
Hi Guys I will have a look but this week is impossible for me. I still have to fix what @Apollon77 was mentioning above and I also plan to do this at the same time and we can test after. |
Ok guys finally got this finished I think. I wanted to refactor entire hci native module to move it to N-API and do some cleanups there first. Ive tested everything on ubuntu 24 and seems to be working just fine. Changes are here: stoprocent/node-bluetooth-hci-socket#2 What I would like you @rgillan or @Apollon77 to do is to:
|
@stoprocent hi! I checked and it seems it is not working on ubunti 24.04.1. My configuration is: # cat /etc/issue
Ubuntu 24.04.1 LTS \n \l
# uname -a
Linux bagger-home 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
# cat package.json
{
"dependencies": {
"@abandonware/noble": "^1.9.2-25",
"@abandonware/bluetooth-hci-socket": "file:node-bluetooth-hci-socket"
}
}
# cat node-bluetooth-hci-socket/.git/config|grep url
url = https://github.com/stoprocent/node-bluetooth-hci-socket.git
# cat node-bluetooth-hci-socket/.git/HEAD
ref: refs/heads/feature/fix_set_filter
# cat test.js
const noble = require('@abandonware/noble');
noble.on('stateChange', function(state) {
console.log(state);
if (state === 'poweredOn' ) {
console.log('on -> stateChange StartScan');
noble.startScanning([], true);
} else {
console.log('on -> stateChange StopScan');
noble.stopScanning();
}
});
# sudo node test.js Nothing happens when I ran |
@ab-kily thats wierd ... |
@ab-kily dont use |
Do this:
|
@stoprocent I can confirm it works! My configuration is: Ubuntu 24.04.1 (kernel 6.8.0). $ cat package.json
{
"dependencies": {
"@stoprocent/noble": "file:noble",
"@stoprocent/bluetooth-hci-socket": "^1.3.0"
}
}
$ cat test.js
cat test.js
const noble = require('@stoprocent/noble');
noble.on('stateChange', function(state) {
console.log(state);
if (state === 'poweredOn' ) {
console.log('on -> stateChange StartScan');
noble.startScanning([], true);
} else {
console.log('on -> stateChange StopScan');
noble.stopScanning();
}
});
noble.on('discover', async (peripheral) => {
console.log(peripheral.address)
});
$ sudo node test.js
sudo node test.js
poweredOn
on -> stateChange StartScan
8c:4b:14:19:af:7a
4a:e1:94:44:70:0b
68:ed:b8:c8:db:81
... @stoprocent thank you very much! |
Perfect! I can update |
) * fix(hci): updating hci dependency to address ubuntu issue #4 * chore(lock): updating package * fix(prebuildify-cross): patching packages to fix prebuilding * chore(package): cleanup of dependencies * chore(lint): minor updates to eslint * chore(lint): enable ES6 syntax * chore(actions): update codecov to v4 --------- Co-authored-by: Marek Serafin <marek.serafin@assaabloy.com>
Ok I'm closing this issue as it was released now under https://github.com/stoprocent/noble/releases/tag/v1.14.2 |
I assume I will also come to test it next days in matter.js |
Hi @stoprocent , I had the same problem (after upgrading to ubuntu 24 several months ago) and your fix solved the issue. But after exactly 60 seconds communication with the bluetooth device the connection gets disconnected by "something". That is an issue I did not have with the previous noble version I used ( "@abandonware/noble": "1.9.2-24" ). But even in a virtualbox vm with Ubuntu 22 and the old version noble will not start anymore, so I am not able to re-test that. |
First thank you for all the work! I confirm it is solving (and seems compatible) issue with node-poweredup on Ubuntu 22. SImple receipe:
(For those you may struggle, package-lock may be removed and a fresh npm install needed. And @stoprocent version will be inside an @abandonware folder within node_modules) I am also seeing regular disconnection, will try to give more details. |
@stoprocent @grougy I found a possible fix for the 60 seconds disconnect problem: see #9 |
@grougy maybe open an issue with node-poweredup to switch the lib :-) |
I will be working on @Apollon77 issue and I can look at @marcelkottmann comments from #9 and will update you guys in #9 |
Ok guys I'm closing this one as for me it is fixed. I will reopen if needed |
Pulling through from here:
abandonware#341
The text was updated successfully, but these errors were encountered: