Android Question bluetooth socket time out, what could be the reason?

MbedAndroid

Active Member
Licensed User
Hello
I checked my APP on a HC06 bluetooth chip and many different handy's and tablets worked ok, now i got somebody with this HC06 reporting cannot make it to work with this error message:
Error Connecting java.io.exception:read failed , socket might closed or timeout, read ret -1

Any idea what could be wrong?
They see the HC06 device, trying to connect, after some time this message comes back
 

walterf25

Expert
Licensed User
Hello
I checked my APP on a HC06 bluetooth chip and many different handy's and tablets worked ok, now i got somebody with this HC06 reporting cannot make it to work with this error message:
Error Connecting java.io.exception:read failed , socket might closed or timeout, read ret -1

Any idea what could be wrong?
They see the HC06 device, trying to connect, after some time this message comes back
I've seen this issue many times, the reason i've always found is that if your device connects once and for some reason gets disconnected, you have to make sure that the connection is closed in your code along with the astream object, if you don't do this when you try to reconnect you will get this error since the connection is still open in the previous instance.

Hope this makes sense.

Walter
 
Top