So to preface this, I'm fairly certain this is a problem with the android device I am using (it's old - Samsung S4 mini running Android 4.4.2) and we have new devices that have been ordered for our lab so that will likely solve the problem, but for the time being I'm basically just wasting time in the lab trying to get the MMC sensors to connect because I can't really work on anything without this connection.
For a long time my app was working fine (see my previous thread - streaming multiple quaternions simultaneously from MMC sensors to control a leg in Unity 3D) but at some point last week the sensors stopped connecting entirely. After fiddling with the phone all day and resetting it/reinstalling the app and turning bluetooth on and off it randomly just started working again for a few days. Now yesterday the problem popped back up and I can't seem to get it to go away this time.
The logcat info basically just loops this over and over:
01-01 00:13:04.464 10367-12238/com.mbientlab.metawear.tutorial.starter I/BluetoothGatt: Client registered, waiting for callback
01-01 00:13:04.464 10367-12239/com.mbientlab.metawear.tutorial.starter I/MainActivity: Failed to connect 3
with this error code:
E/BluetoothGatt: Bad connection state: 0 failed to register callback
From the debugger:
01-01 00:19:09.323 12802-13011/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: connect() - device: F6:F6:87:94:33:F3, auto: false
01-01 00:19:09.323 12802-13011/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: registerApp()
01-01 00:19:09.323 12802-13011/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: registerApp() - UUID=dc313569-0bcb-462b-8b33-b85358f3bdb6
01-01 00:19:09.373 12802-12814/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
01-01 00:19:09.373 12802-13011/com.mbientlab.metawear.tutorial.starter I/BluetoothGatt: Client registered, waiting for callback
01-01 00:19:09.694 12802-12818/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: refresh() - device: CF:0D:50:10:CC:16
01-01 00:19:09.704 12802-12818/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: close()
01-01 00:19:09.704 12802-12818/com.mbientlab.metawear.tutorial.starter D/BluetoothGatt: unregisterApp() - mClientIf=6
01-01 00:19:09.724 12802-13012/com.mbientlab.metawear.tutorial.starter I/MainActivity: Failed to connect 2
I'm fairly certain it's the phone itself because even using the nRF Connect app I can't connect to the sensors. It sees them, but just hangs when trying to connect. But my iPhone with the official Metabase app does connect to them still.
I don't expect that there's an obvious solution to this but if you guys have any thoughts while I'm waiting for the new devices I'd love to hear, thanks.