Logging after Disconnect

I am trying to log MetaTrackr data over a long period of time.  While the device is logging, I need to be able to disconnect from the device and kill the app.  I have a "Start Monitoring" button connected to a function which calls startLoggingAsync on several events.  I also have a "Stop Monitoring" button which calls downloadAndStopLoggingAsync on the same events.  When running *within* the active application, these functions work properly.  However if I kill the app, turn off bluetooth, or switch to a different view within the app while logging, I am unable to retrieve the data upon reopening and downloading. 

I have followed the documentation for logging. 

Any suggestions why the functions don't seem to be working as they are supposed to?

Comments

  • I am running into the same problem.  

    If I call startLoggingAsync() on the raw events from the sensors (accelerometer.tapEvent and mechanicalSwitch.switchUpdateEvent), then everything works fine and I am able to download the log of those events after restarting the app (via downloadLogAndStopLoggingAsync).

    However, if I log the output of a filter applied to the events (for example to only log when the button is released), then I am unable to download the log after restarting.  I can confirm that the event is firing via the LED, but nothing comes back in the log.

    My suspicion is that this has to do with how the log IDs are generated, and for some reason they aren't generated consistently across app restarts causing a mismatch.

  • Any update on this?  

    I still can't figure out how to starting logging filtered/processed values within the persistent configuration, and then later download those values.

    Thank you.


  • See this thread:
    https://mbientlab.com/community/discussion/comment/4342/

    The blog link is no longer valid but the forum members have posted example code.
This discussion has been closed.