Getting this RuntimeException onConnectionStateChanged reported non-zero status: 8

Hey,

I am using two CPRO Devices with Firmware 1.2.1.

I can connect them correctly. The streaming of the accelerometer and gyroscope data also works fine. (Both in three axis!)

After some time (more than 2 minutes) I am getting this exception and loose the connection to one of my devices. Then my app is crashing, because of fatal exceptions by calling the Modules -> NullPointerException:

This is the first error which appears in the logcat:

05-24 21:54:39.851 30133-1913/com.basti12354.accelerometer E/External Sensors: Error connecting
                                                                               java.lang.RuntimeException: onConnectionStateChanged reported non-zero status: 8
                                                                                   at com.mbientlab.metawear.MetaWearBleService$2$2.run(MetaWearBleService.java:909)
                                                                                   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
                                                                                   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                   at java.lang.Thread.run(Thread.java:818)


I can't find anything about non-zero status 8  and I have no idea whats wrong with my app. 

I am using an HTC One and LG G4 (both are using Android 5.0.2.)



Comments

  • According to the Bluedroid header files, 0x8 means connection timeout:

    How fast are you streaming data from your boards?
  • I am streaming with ODR_100_Hz with the Accelerometer and the same with the Gyroscope. I am using two CPROS so the streaming rate is 400 Hz at all. Is this calculation correct? 
    After changing the battery of my devices the error doesn't appear at the moment.


    At the end I will use 4 CPros and all of them should take the data with 100 Hz. I think that isn't possible via streaming? How much data can I log to the board. (I need to log 30s-60s of gyro and accelerometer data with 100 Hz. Is this possible or should I reduce the sampling rate?)
  • edited May 2016
    Check out these answers from the FAQ:

    How fast can I stream data from my MetaWear?

    The Bluetooth LE radio can handle
    data throughput of up to 100Hz. For example, you can stream 1 sensor at
    100Hz. However when using multiple sensors, you must decrease the
    sample rate i.e. sampling 2 sensors at 50Hz each.


    How much data can be stored on the devices?

    You can store approximately 5KB of data (~10K log entries).


    Given that gyro and accelerometer consume 2 log entries per XYZ data, 30 seconds is not feasible. If you are willing to sacrifice accuracy for log space, you should be able to log for 30-45 seconds
  • Thanks for your reply, but I can't get the information to answear my question.

    I want to use FOUR cpros and I want to stream the data of their accelerometer and their gyroscope.

    I am not sure if it is possible to stream these sensors at 50 Hz each? So every CPRO can use the full 100 Hz?

    The other option: 100 Hz  for ALL devices? In this case every device could only stream with 25 Hz, which means that every sensor could use 12,5 Hz.

  • The Bluetooth LE radio can handle data throughput of up to 100Hz. For example, you can stream 1 sensor at 100Hz. However when using multiple sensors, you must decrease the sample rate i.e. sampling 2 sensors at 50Hz each.


    The relevant information is in bold. Since you have 4 data creators and 1 consumer, you are bounded by the bandwidth of your 1 consumer so your second idea is the best approach.
This discussion has been closed.