UNKNOWN_LOG_ENTRY when logging

edited March 2017 in Android
Hi Eric,

I modified the MetaWear app in the SensorFusionFragment.java to log and download the euler angles data. When debug the app and select quartenion I found that  streamRoute = task.getResult(); returns a route but when i choose Euler Angles, it doesn't.
I guess that's why it shows the error type:UNKNOWN_LOG_ENTRY in the LogDownloadErrorHandler 


Here's a piece of the code:
@Override
protected void setup() {
logging.clearEntries();
sensorFusion.configure()
.mode(Mode.NDOF)
.accRange(AccRange.AR_16G)
.gyroRange(GyroRange.GR_2000DPS)
.commit();

if (srcIndex == 0) {
sensorFusion.quaternion().addRouteAsync(source -> source.stream((data, env) -> {

})).continueWith(task -> {
streamRoute = task.getResult();
sensorFusion.quaternion().start();
sensorFusion.start();

return null;
});
} else {

sensorFusion.eulerAngles().addRouteAsync(source -> source.log((data, env) -> {
Log.i("MainActivity", data.value(EulerAngles.class).toString());
})).continueWith(task -> {
streamRoute = task.getResult();
logging.start(true);
sensorFusion.eulerAngles().start();
sensorFusion.start();
return null;
});
}
}
@Override
protected void clean() {
downloadDados();
sensorFusion.stop();
logging.stop();
//logging.downloadAsync();

}
        protected void downloadDados ()
{
// download log data and send 100 progress updates during the download
logging.downloadAsync(100, new Logging.LogDownloadUpdateHandler() {
@Override
public void receivedUpdate(long nEntriesLeft, long totalEntries) {
Log.i("MainActivity", "Progress Update = " + nEntriesLeft + "/" + totalEntries);

}
}, new Logging.LogDownloadErrorHandler() {
@Override
public void receivedError(Logging.DownloadError errorType, byte logId, Calendar timestamp, byte[] data) {
Log.i("MainActivity", "logid " + logId + " error type:" + errorType + " byte " + Arrays.toString(data));
}
}).continueWithTask(new Continuation<Void, Task<Void>>()
{
@Override
public Task<Void> then(Task<Void> task) throws Exception
{
Log.i("MainActivity", "Download completed");
return null;
}
});
}


Comments

  • edited March 2017
    UPDATE:
    While I was debugging and selected euler angles, when I stepped into streamRoute = task.getResult(); it showed this on the Task.java: 
    image

    "Creating logger timed out." I can't figure out what's wrong with my logging
  • The user was using the previous API v2 but the suggestions are still relevant for API v3.
    http://community.mbientlab.com/discussion/comment/3876
  • I already saw that post. I'm doing exactly what that guy did. I first download the data and then issue the command to stop the logging. I've also removed all the existing routes by using  mwBoard.tearDown(); but I'm still getting this error. What does the error "Creating logger timed out." means and how can I solve this?
  • It means exactly what the error message says, creating a logger took longer than expected.  If you receive such an error, you should call tearDown and try again.

    The MetaWear app isn't structured to easily deal with logging and has other pieces of code running behind the scenes.  I would recommend you instead use the app template to test out your code.

  • Thanks for the fast reply! I'll try that right away
  • Thanks Eric,
    I was able to log and download the linear acceleration and EulerAngles from the sensor by using your freefall tutorial, the documentation and this post right here:  http://community.mbientlab.com/discussion/1935/simultane-gpio-logging-beta-03/p1

    Do you have any tips on how to connect another board to the phone to log them both simultaneously using API 3.0?
    P.S. It seems this page "https://mbientlab.com/docs/apis/java/template-app/" runs an endless script that causes bugs on google chrome and internet explorer.
  • Check out this demo project on our GitHub page:
    https://github.com/mbientlab/MetaWear-Tutorial-Android/tree/master/multimw

    Thanks for the heads up on that page; we'll look into getting it resolved soon.
  • Hi Eric, I figured out how to do that.
    Now I would need to decrease the sample rate of the sensor fusion to reduce the download time. I thought about setting the board to average 4 samples at a time before sending it. Is it possible?
  • Averaging is not supported on sensor fusion data though you can use a data limiter.

  • Thanks, that was a big help. I noticed that the roll values are between -90 and +90 degrees. Is it possible to make it from 0 to 360 or -180 to +180?
  • No, the algorithm only reports roll between [-90, 90]
This discussion has been closed.