Bluetooth connection times out

Hello,

I am trying to connect my tablet to a BT05 Bluetooth serial adapter. The Android version is 5.1, but I also tested a newer device with the same result. I used “Serial Bluetooth Terminal” to connect to the same adapter and it works fine there, so I guess the hardware should be ok.

I have tried several examples I found online, one using ketai and two working with android directly, the behaviour is always the same:

I can scan for devices, I see paired and discovered devices and mac addresses. When I try to connect,
the device gets a connection, the serial side of the adapter says “Connected”, but no data is going through the link in either direction. About 12 seconds later, the connection breaks, the console gives me
“java.io.IOException: read failed, socket might closed or timeout, read ret: -1”.
I have added every permission that has Bluetooth in it, but it makes no difference.

Does anyone have a hint what could be the reason for this or what I could try?

Thanks a lot
un23

Hello,

I did some more research in the last days and found that my devices (BT05) are actually Bluetooth Low Energy devices and need a completely different method to connect to them. It is described in detail here, and ketai does not seem to support it at the moment.

Regards
un23

Hi

The (BT05) module works fine with ketai library
Search here for @noel posts and topics he posted multi working examples

This example without library

Hello,

that was one of the examples I tried and it does not work with bluetooth le. And also it doesn’t use ketai. So if I missed a real le example, please help me out with a link.

In the meantime I have something roughly working, sending characters back and forth, but it’s only a mess of code patches now.

Regards
un23

Hi

I have tried this with android 8