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

Cannot connect to device #118

Open
ShashwatMDas opened this issue May 1, 2020 · 6 comments
Open

Cannot connect to device #118

ShashwatMDas opened this issue May 1, 2020 · 6 comments

Comments

@ShashwatMDas
Copy link

ShashwatMDas commented May 1, 2020

I get this error whenever I try to connect a bluetooth device via my react native app:

Error: read failed, socket might closed or timeout, read ret: -1
Unable to connect to device

Here's what I'm trying to do:
connectToDevice () { if (this.state.discovering) { return false } else { this.setState({ discovering: true }) console.log("searching"); BluetoothSerial.list() .then((Devices) => { this.setState({ Devices, discovering: false }) for(var i = 0; 1; i++) { if(Devices[i]["name"] == "JBL Flip 3 SE") { console.log(Devices[i]["id"]); BluetoothSerial.connect(Devices[i]["id"]).then((res) => { console.log(res); }).catch(err => { console.log(err); }) break; } } // console.log(unpairedDevices); }) .catch((err) => console.log(err.message)) } }

Same happens even when I clone the example repo.

Any idea why this is happening?

@diarynar
Copy link

diarynar commented Aug 10, 2020

It's all the same to me. Is there anyone we can help us with? Please!

@NChandan
Copy link

Same with me. Is there any solution?

@aftabGalaxy
Copy link

aftabGalaxy commented Sep 13, 2021

Same with me. Is there any solution?

@rusel1989 Please help us to resolve this?

@shadahmad7
Copy link

Use react-native-bluetooth-devices to connect with device

@shadahmad7
Copy link

just send device id

@joseph2000k
Copy link

any update here?

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

6 participants