kai-morich / SimpleBluetoothTerminal

Android terminal app for Bluetooth classic devices using SPP profile
MIT License
447 stars 166 forks source link

Android 9(API 28) connection issue. #23

Closed Chuntianhong closed 2 years ago

Chuntianhong commented 2 years ago

I have a connection issue. The app on Android 9 device(API 29) doesn't connect to Bluetooth device. With the same app, the app on Android 7 connects to the same Bluetooth device,

socket = device.createRfcommSocketToServiceRecord(BLUETOOTH_SPP);
socket.connect();

In connect() function, it gives exception. Would you give me any suggestion?

kai-morich commented 2 years ago

what devices do you use, and what is the exception?

Chuntianhong commented 2 years ago

I use Bluetooth PLC device. On Android 7 table connect with PLC. But on Android 9 table doesn't connect with PLC.

This is the error. Thank you for your check and help me.

kai-morich commented 2 years ago

I am not aware of general connection issues with Android 9. Very likely caused by vendor specific Android customization. Does it work with https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal?

Chuntianhong commented 2 years ago

Thank you. I will try with this app.

Chuntianhong commented 2 years ago

Unfortunately, This app also doesn't connect.

kai-morich commented 2 years ago

is the device paired correctly?

Chuntianhong commented 2 years ago

Yes it was correctly paired.

kai-morich commented 2 years ago

then most likely it's an issue with vendor specific Android customization or bad bluetooth driver/hardware in the Android tablet

Chuntianhong commented 2 years ago
Yes I also think so.Thank you for your advice.  From: kai-morichSent: Thursday, December 16, 2021 3:49 AMTo: kai-morich/SimpleBluetoothTerminalCc: chuntianhong; AuthorSubject: Re: [kai-morich/SimpleBluetoothTerminal] Android 9(API 28) connection issue. (Issue #23) then most likely it's an issue with vendor specific Android customization or bad bluetooth driver/hardware in the Android tablet—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.  
SibingWu commented 2 years ago

Hello, I wonder how you solved this issue? I am encountering the same problem. My android app on android tablet can successfully create socket and send out something, but in Serial Bluetooth Terminal side, it keeps showing "read failed, socket might closed or timeout, read ret: -1"

Chuntianhong commented 2 years ago

It appeared in the factory-specific industrial tablets ordered for on-demand. Other Android devices work well with Bluetooth connections. So we reported this issue to the factory and already got new PCBAs recently and still need to test again. I will reply again once we finish the test.

Chuntianhong commented 2 years ago

Hello, I wonder how you solved this issue? I am encountering the same problem. My android app on android tablet can successfully create socket and send out something, but in Serial Bluetooth Terminal side, it keeps showing "read failed, socket might closed or timeout, read ret: -1"

We got new PCBAs with new WAN chip from the factory and tested it yesterday. After change it, Bluetooth module works correctly. So I guess the same issue on your side. You would change tablet device or contact the device manufacturer.