Sensor stops sending data?

After streaming accelerometer and gyroscope data at 100Hz for a period of time, the sensor seems to just stop sending data values from those sensors.  I have tried using the Metawear app to get accelerometer and gyroscope data from the sensor, but same result - no data is received by the Metawear app. I am able to communicate with the LEDs on the board, but I also cannot communicate with any other sensors on the board as well.

The only thing that fixes the issue is either removing the battery from the sensor or issuing a reset command.  This is very undesirable, as I would like to have streaming for longer periods of time.  The battery levels are not the issue either - when the sensor stopped sending data, the battery level was at 36. It also is not a sensor disconnection problem - the callback methods do not report that a disconnect or error has occurred. I am not using any of the onboard sensor logging methods - I am simply streaming data from the sensor to an Android device.

This issue appears on both an LG G3 (Android 6.0) and a Google Pixel (Android 7.1). The sensors we are using are running the latest firmware (1.2.5).

I've seen in other threads that these sensors have been streamed for an hour or longer at a time - is there any reason that a C/CPRO sensor would exhibit this sort of behavior?

Comments

    • How long is a 'period of time" in your use case?
    • Are you streaming acc and gyro both at 100Hz?
      • Please post the exact code you are using to stream data
  • edited November 2016
    • A period of time is approximately 25 minutes on an LG G3 and anywhere from 1 to 5 minutes using a Google Pixel
    • Yes, I am streaming both acc and gyro at 100 Hz using the standard streaming API
    The following code comes from the connection state handler once a connection has been made with the board:

    accelerometer = board.getModule(Bmi160Accelerometer.class);
    gyro = board.getModule(Bmi160Gyro.class);
    settings = board.getModule(Settings.class);
    settings.configureConnectionParameters()
    .setMinConnectionInterval(7.5f)
    .setMaxConnectionInterval(7.5f)
    .commit();
    accelerometer.configureAxisSampling() .setFullScaleRange(Bmi160Accelerometer.AccRange.AR_4G) .setOutputDataRate(Bmi160Accelerometer.OutputDataRate.ODR_100_HZ)
    .commit();
    accelerometer.routeData().fromAxes().stream("acceleration").commit()
    .onComplete(new AsyncOperation.CompletionHandler()
    {
      @Override
      public void success(RouteManager result)
      {
        result.subscribe("acceleration", new RouteManager.MessageHandler()
        {
          @Override public void process(Message message) { ... }
        });
        accelerometer.enableAxisSampling();
        accelerometer.start();
      }
    });
    gyro.configure()
    .setFullScaleRange(Bmi160Gyro.FullScaleRange.FSR_2000)
    .setOutputDataRate(Bmi160Gyro.OutputDataRate.ODR_100_HZ)
    .commit();
    gyro.routeData().fromAxes().stream("gyro").commit()
    .onComplete(new AsyncOperation.CompletionHandler()
    {
      @Override
      public void success(RouteManager result)
      {
        result.subscribe("gyro", new RouteManager.MessageHandler() 
        {
          @Override public void process(Message message) { ... }
        });
        gyro.start()
      }
    });
  • You need to use the high frequency streams (for both acc and gyro) since you are attempting to sample both sensors at 100Hz each.
  • Upon trying to use the high frequency streams, I get data points in groups of three from the accelerometer and gyroscope.  It seems that three points arrive simultaneously, followed by a delay of 0.2 seconds, then another grouping of three points, another delay of 0.2 seconds, etc. 
  • Yes that is the expected behavior as the firmware is utilizing the full 20 bytes allocated for a bluetooth le packet.  Does this fix the lockup issue you described?
  • It appears to have resolved the lockup issue with the Google Pixel.  I'll need to verify with the other devices in the next several days. Thank you for your help.

    When using the high frequency axes, is it safe to assume that the delta-T is 0.01 seconds between each of the points for data logging & data analysis?  Since it is impossible to tell delta-T from when the phone receives the data (given how the high frequency logging functions), this is very important.

    In addition, while the accelerometer receives data points in groups of three correctly, the gyroscope receives exactly the same point three times in a row.  Do you have any ideas for why this is occurring? I've tried logging the data in a synchronized logger as well as in the separate route handler functions to separate log files with no success.
  • Also, there was a typo in my comment on November 13 - I am actually receiving 3 data points every 0.03 seconds.
  • You can assume the data is being produced at the ODR specified when configuring the sensors.  

    As to your second point, does the gyro accurately report data if it is the only active sensor?  Is there a difference in behavior when using the normal data stream vs. the high frequency stream?
  • I think the problem has to do with how I am doing data logging at this point - now that the sensor issues have been resolved, I think this is a separate issue. Thank you for your help.
  • @emvasey
    Have you found any solution to this problem? We are facing exactly the same behavior - after a period of time (appr. 60-90 mins) the CPRO stops transmitting sensor data. We are still able to interact with the LED, but to receive sonsor data again the only way is to remove the battery. Even issuing a reset command does not always solve the stalled sensor problem.
    We are retrieving accelerometer and gyroscope data at a rate of 50Hz via the high frequency streams. Additionally we do retrieve magnetometer data with LOW_POWER preset.
    • What mobile device and OS are you using?
    • What firmware revision are the boards running?
    • What is the code you are running?
This discussion has been closed.