Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bt socket connect failed, code:9 #30

Open
CosminPOP opened this issue Apr 14, 2015 · 2 comments
Open

bt socket connect failed, code:9 #30

CosminPOP opened this issue Apr 14, 2015 · 2 comments

Comments

@CosminPOP
Copy link

Hi

I'm getting this error whenever I try to 'connect' to any device:
"bt socket connect failed" error code: 9

I added an 'error' parameter to the onFail function :

...
var onFail = function (error) {
...

to see this error response that gets called from

...
window.bluetooth.connect(onConnection, onFail, {
uuid: device.uuids[0],
address: self.model.get('address')
});
...

@tanelih
Copy link
Owner

tanelih commented Apr 16, 2015

Have you enabled Bluetooth on both devices? Are you sure the device address is set correctly?

There could be many reasons for this error, the code you are receiving (9), refers to this error. And it seems like the error happens somewhere around here.

Try adding some logging somewhere in the area I pointed out in order to pinpoint the actual error, or failure that is happening. Good luck!

@MalikDrako
Copy link

I'm getting this same error.
I can get UUIDs and pair the devices, but when I try to connect with any of the retrieved UUIDs I get:

Connect error:  Object {message: "read failed, socket might closed or timeout, read ret: -1", code: 9}

I am running the app on a Nexus 9, trying to connect to a Nexus 7 and a Windows 8 PC. I can connect to the PC through the bluetooth settings, it appears on the PC as a stereo audio service.
The example app does the same as my app, although I had to add extra logging in the JS to verify this.

Edit: I found a bluetooth speaker and can connect to that, but I dont think I'm sending data in the right format for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants