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

Discussion in 'Android Questions' started by MbedAndroid, Jun 12, 2015.

  1. MbedAndroid

    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
     
  2. walterf25

    walterf25 Well-Known Member Licensed User

    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
     
  3. MbedAndroid

    MbedAndroid Active Member Licensed User

    good hint, will have a check on this in the code
     
Loading...