MetawearRG reconnection/connection TimeOut Issue
Hi,
I m using MetawearRG for live data streaming. I am configuring Accelerometer and Gyrometer in range of 16G and 2000 deg/sec respectively, and using packedAcceleration and and PackedAngularVelocity for high data streaming. And using both at the same time.
I am disconnecting the board using board.disconnectAsync() function.
I am facing the problem when I try to reconnect the board after disconnecting it manually.
Issue: On selecting the board from the scanned list it stays on connecting state, and never complete.
On thorough debugging I found that, when ever the connection fail it goes for reconnection automatically, and the same procedure is carried on and on which lead to a infinite loop.
On further debugging I found that the value of task.isFaulted() in connectAsync() s always true whenever this condition arises, and the reason is that it throws an unhandled TimeOut Exception
everytime for this condition.
If I kill the app and try connecting again, it connect without ant hassle in 1st attempt, and the problem start occurring from 2nd attempt to connect
Please Help me out on handling this TimeOut Exception
Comments
1.Here is the Logcat when Scanning for devices.
2.Here is the logcat while connecting the board with android devices for successful attempt.
3.Here is the logcat when disconnecting manually
4.Here is the logcat for unsuccessful Connection attempt.
board is connecting with android device only for the first time, and after dissconnecting it its not able to connect with device.
Logcat #4 (unsuccessful Connection attempt) keeps on appearing again and again without giving any error message.
Yes, I am always stopping accelerometer and gyro meter before disconnecting the board , since I am using PackedAcceleration and PackedAngularVelocity, I am using these lines for stopping acclero and gyro meter
accelerometer.stop();
gyro.stop();
accelerometer.packedAcceleration().stop();
gyro.packedAngularVelocity().stop();
accelerometer.acceleration().stop();
gyro.angularVelocity().stop();
board.tearDown();
after these function I am using board.disconnectAsync() to disconnect