Comments (8)
@mhle please provide debug logs, by setting the DEBUG
env var to *
.
I'm thinking the adapter is not responding to the HCI reset command, but we'll see what the debug logs say.
from node-bluetooth-hci-socket.
I have the same problem with my BLE USB Dongle (chipset: CSR8510 A10).
My code always communicates with the dongle only every 2nd time!!
I found out that although 'this._isUp' is true, it still does not work. The function noble.on() won't run.
In the following you can see the debug output for the case when there is no communication with the dongle:
Thank you for your helps..
from node-bluetooth-hci-socket.
And here is the debug output when there is a communication to the dongle:
from node-bluetooth-hci-socket.
I am still trying to solve this problem. It is strange, that SanDeep's "enter-exit.js" code always runs.
My code is based on "enter-exit.js", so I do not understand why I got this problem? Because I did not change the code in its basic functionality.
Here is the debug output of "enter-exit.js" to compare with those above.
from node-bluetooth-hci-socket.
@boredSinan looks like the adapter is still scanning when you start you app the 2nd time, and then doesn't respond to any HCI commands after the reset command.
How are you exiting your app? noble tries to stop scanning on exit here: https://github.com/sandeepmistry/noble/blob/master/lib/hci-socket/bindings.js#L96
Another thing to try is, adding a delay here, to give the adapter some time before we send other HCI commands: https://github.com/sandeepmistry/noble/blob/master/lib/hci-socket/bindings.js#L96
setTimeout(function() {
this._isUp = true;
}.bind(this), 500);
PS: I like the coloured screenshots, but please also copy/paste the test next time, it's easier to search etc.
from node-bluetooth-hci-socket.
Thanks a lot Sandeep, for your suggestions.
I found out my problem: There is the following function in my code:
//Wait function in ms
function pauseMs(millis) {
var date = new Date();
var curDate = null;
do {
curDate = new Date();
}
while (curDate - date < millis);
}
And the problem always occured when I closed the Node.js application at the same time as the code was running the pauseMs() function (this function was called several times in my code). Because of that, the onExit() function could not be executed.
Now I don't close the Node.js application at the same time as the application is paused (because of pauseMs()), there are no problems anymore!
from node-bluetooth-hci-socket.
@boredSinan cool, thanks for following up!
@mhle any updates from my request in #13 (comment)
from node-bluetooth-hci-socket.
Closing due to lack of activity.
from node-bluetooth-hci-socket.
Related Issues (20)
- Segfaults/assertion errors (when no BT hardware is available?) HOT 1
- Failed Install - Win 10 HOT 1
- Error: No compatible USB Bluetooth 4.0 device found! HOT 1
- Dell precision m4800 Error: No compatible USB Bluetooth 4.0 device found!
- TypeError: Cannot read property 'endpoint' of undefined HOT 1
- . HOT 1
- Maintenance status ? HOT 6
- Add new device HOT 2
- Adapter unavailable in windows bluetooth settings
- Issues with bluetooth adapter 4.2 and 5.0
- raspberry pi3 HOT 3
- Installation fails in Docker-iobroker container on Raspi4 running Raspbian Buster HOT 1
- Add new device intel wireless bluetooth USB\VID_8087&PID_0AAA HOT 1
- Unable to install on Linux Mint HOT 1
- Adapter not found HOT 1
- Error : LIBUSB_ERROR_ACCES HOT 1
- Canβt install HOT 1
- Socket.write not writing commands HOT 1
- Installation fails (Arch Linux, node-gyp 9.3.0) HOT 3
- I need a C++ for windows sample
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-bluetooth-hci-socket.