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

Transmission between android device is not working #3

Open
CyborgRahil opened this issue Mar 19, 2016 · 10 comments
Open

Transmission between android device is not working #3

CyborgRahil opened this issue Mar 19, 2016 · 10 comments

Comments

@CyborgRahil
Copy link

each time i got this,

D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5

i use moto g,Hp tablet ,Samsung s4 for testing.

@virl
Copy link
Contributor

virl commented Mar 19, 2016

@Rahil1991 Android bluetooth is very buggy on particular devices.
Thanks for the device models — most probably they have device-specific Bluetooth bugs.

If you happen to fix the issue or find workaround, feel free to submit pull request.

@mrp14
Copy link

mrp14 commented May 24, 2016

Same thing here on Asus Zenfone 2 Laser (ASUS_Z00ED).
Maybe it's because we should call all BLE interaction code in UIThread, as stated here : http://stackoverflow.com/a/20507449/2806497 ?

@virl
Copy link
Contributor

virl commented May 24, 2016

@mrp14 Library is specifically designed to call all Bluetooth API methods only on main threads (except for reading/writing of BluetoothSocket, which is explicitly permitted to be used from another threads).

But, of course, maybe there is a bug somewhere in the code of the library.

@mrp14
Copy link

mrp14 commented May 24, 2016

I finally saw that you queuing system only use UI Thread. I tried to call the connect method into UIThread but with no changes. The problem mustn't be there.

Here is what i'm getting in the log :

bt accept() failed for uuid [[UUID]] java.io.IOException: read failed, socket might closed or timeout, read ret: -1

@virl
Copy link
Contributor

virl commented May 24, 2016

@mrp14 Due to Android models fragmentation and very unstable Bluetooth stack (prior to 7.0), it can either be a bug in stack itself or the library. Anyway, it can be debugged and fixed only using real device that it occurs on.

@mrp14
Copy link

mrp14 commented May 24, 2016

That's exactly what i'm trying to do, maybe it would be useful for others too. Do you have any clue on how I can investigate this IOException ?
I'm gonna try some others BLE librairies and demo apps on this device to see if there is a way to get it working.

EDIT :

Here is the full log :

05-24 10:16:07.976  29907-29907/? D/underdark﹕ bt listening started
05-24 10:16:07.988  29907-29929/? D/underdark﹕ bt listening channel 0 uuid 1B9839E4-040B-48B2-AE5F-61B6000392FB
05-24 10:16:07.989  29907-29930/? D/underdark﹕ bt listening channel 1 uuid 6FB34FD8-579F-4915-88FF-71B2000392FB
05-24 10:16:07.995  29907-29931/? D/underdark﹕ bt listening channel 2 uuid 8CC0C5A1-1E22-4C95-89D7-3639000392FB
05-24 10:16:08.161  29907-29907/? D/underdark﹕ bt listening stopped
05-24 10:16:08.163  29907-29930/? E/underdark﹕ bt accept() failed for uuid 6FB34FD8-579F-4915-88FF-71B2000392FBjava.io.IOException: read failed, socket might closed or timeout, read ret: -1
05-24 10:16:08.163  29907-29931/? E/underdark﹕ bt accept() failed for uuid 8CC0C5A1-1E22-4C95-89D7-3639000392FBjava.io.IOException: read failed, socket might closed or timeout, read ret: -1
05-24 10:16:08.163  29907-29929/? E/underdark﹕ bt accept() failed for uuid 1B9839E4-040B-48B2-AE5F-61B6000392FBjava.io.IOException: read failed, socket might closed or timeout, read ret: -1

As you can see, bt listeting is stopped before the accept method has finished.

I tried to remove the stop call in the activity onStop (to see what happens), and I'm now getting :

ble advertise failed: ADVERTISE_FAILED_DATA_TOO_LARGE

EDIT 2 :

I reduced advertiseData sent (only device name) : I'm not getting the data too large error anymore, but socket accept method hangs and never returns.

@virl
Copy link
Contributor

virl commented May 24, 2016

@mrp14 Maybe it's some specific bug in that version of the BT stack that limits listening to only 3 channels. Or maybe using BLE conflicts with RFCOMM listening methods of Bluetooth API.

You can try to reproduce the bug with pure Bluetooth/BLE Android API — create same amount of listening BluetoothServerSockets and try to advertise something on BLE.

@mrp14
Copy link

mrp14 commented May 24, 2016

I'm going to try it.
BTW, is the Solidarity app source code available somewhere ? I would be interested to dig in it.

@virl
Copy link
Contributor

virl commented May 24, 2016

@mrp14 I've wrote message to your email.

@azizimusa
Copy link

send me the solidarity source code. I want it as well

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

4 participants