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 communicate with another android device. #184

Open
AlphaRosh opened this issue Dec 3, 2022 · 7 comments
Open

Cannot communicate with another android device. #184

AlphaRosh opened this issue Dec 3, 2022 · 7 comments

Comments

@AlphaRosh
Copy link

AlphaRosh commented Dec 3, 2022

Hello, I'm attempting to connect and communicate with two Android smartphones.

For testing, I'm using a Vivo V20 Pro and a Samsung Galaxy Tab (SMT515). Both are running the sample serial app.

To duplicate:

  1. Launch the app on both your phone and your tablet, and enable Bluetooth and location services on both.

  2. Making one gadget discoverable and searching for it from another. (I am able to obtain the device and pair it.)

  3. With both phone or tab, go to "Connect to paired device to chat" and select the device to chat.

When I try to chat with the connected device after connecting to it from vs, I receive the following exception

image

Exception has occurred.
PlatformException (PlatformException(connect_error, read failed, socket might closed or timeout, read ret: -1, java.io.IOException: read failed, socket might closed or timeout, read ret: -1
at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:970)
at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:984)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:536)
at io.github.edufolly.flutterbluetoothserial.BluetoothConnection.connect(BluetoothConnection.java:57)
at io.github.edufolly.flutterbluetoothserial.BluetoothConnection.connect(BluetoothConnection.java:64)
at io.github.edufolly.flutterbluetoothserial.FlutterBluetoothSerialPlugin$FlutterBluetoothSerialMethodCallHandler.lambda$onMethodCall$4$FlutterBluetoothSerialPlugin$FlutterBluetoothSerialMethodCallHandler(FlutterBluetoothSerialPlugin.java:1007)
at io.github.edufolly.flutterbluetoothserial.-$$Lambda$FlutterBluetoothSerialPlugin$FlutterBluetoothSerialMethodCallHandler$DZLg1SWj2Aas0tcY7uTlx8xsy4Y.run(Unknown Source:10)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
, null))

Thanks

@AlphaRosh AlphaRosh changed the title Cannot connect to another android device. Cannot communicate with another android device. Dec 5, 2022
@vytautas-pranskunas-
Copy link

Same here

1 similar comment
@swordyy7
Copy link

Same here

@dev9828
Copy link

dev9828 commented Jan 3, 2023

hey? did you solve the issue? i cant connect two phone with same aplication.

@SrinivasaMurthy91
Copy link

anyone solve the issue? i am unable to connect two mobiles

@udit6023
Copy link

BluetoothConnection newConnection =
await BluetoothConnection.toAddress(device.address);
i have passed a raw device's address in the above code still it is not able to connect to that device
were you able to connect to your desired device?

@SrinivasaMurthy91
Copy link

SrinivasaMurthy91 commented Jun 26, 2023 via email

@zamirszn
Copy link

I'm facing this too has anyone been able to figure it out

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

7 participants