Bluettoth connection

Metawear board doesn't connect with my custom app for first time, however once connect board with metawear app and then disconnect and reconnect with my app, it connects instantly. I have implemented the same module and code which is there in metawear sample.
   - Tested with many Android phones and versions
   - updated firmware version
   - check permissions (android.permission.BLUETOOTH_ADMIN" , android.permission.BLUETOOTH" )

Please guide me what is there that i am missing or should be done to establish reliable connection like metawear app.


    • What is the error that is returned by the connect task?
    • Does the app successfully connect the 2nd time?  3rd time? etc.
  • edited September 2017
    The error:
    Error connectingjava.util.concurrent.TimeoutException: Board connection timed out

                                                                           at android.os.Handler.handleCallback(
                                                                           at android.os.Handler.dispatchMessage(
                                                                           at android.os.Looper.loop(
                                                                           at java.lang.reflect.Method.invoke(Native Method)

    I have implemented a loop so that if connection fails at first time, it try to connect until connection is successful. but sometimes board doesn't connect even after several tries and after long time. but can be connected with metawear app.

    I have not implemented scanner module in my app, which I think is implemented in metawear app. Is that can be possible issue?

  • Try connecting to the board using the starter app:

    If that app still fails to ever connect to a board, try restarting the BT adapter when said connection error occurs.
This discussion has been closed.