Downloading logs
I'm trying to use the new Route Manager, but am having difficulty figuring out exactly how to download the log. I am trying to just get the data from the X axis on the Accelerometer for now. I looked at the new API and Sample app, but it only seems to have Streaming functionality.
Is there any kind of quick sample code available for properly setting up and downloading offline logging with the new methods?
I've got this so far for starting the process:
Is there any kind of quick sample code available for properly setting up and downloading offline logging with the new methods?
I've got this so far for starting the process:
AsyncOperation<RouteManager> routeManagerResult= accelModule.routeData().fromXAxis().log("accel_log").commit();
routeManagerResult.onComplete(new AsyncOperation.CompletionHandler<RouteManager>() {
@Override
public void success(RouteManager result) {
accelModule.enableAxisSampling();
accelModule.start();
logModule.startLogging(true); // Starts logging data overwrite is true
}
});
This discussion has been closed.
Comments
I had all this working with the previous API. I am trying to convert my working code over to the new API.
I was going off this for the message type for single axis:
Three axis data can be interpreted as a CartesianFloat (G's) or a CartesianShort (milli G's) whereas single axis data can be interpreted as a float (G) or short/integer/long (milli G).
1.) I did do that and was able to get the streaming to start and stop. I then converted it to logging and I can get the logging to start and stop and download, but I can't get the downloadLog call to invoke public void success(RouteManager result). Stop, Start and Downloading the log all work.
2.) I had all that working with streaming and then logging and then tried to put it in the loop. The loop works to start, stop and download the log but never processes data. I do get a log message that the download is complete.
Again, thank you guys for your patience and helping me with this. My client is looking at 200 units/yr on this project.
One question with the new API - do I still need to stop the logger and/or acc modules to download the log? In the previous API we had to stop both, download the logs, then start them back up again.
I add the receivedUnknownLogEntry method and here are the last few entries of the results:
09-04 03:36:42.634 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 3, data: [-28, -1, 0, 0]}
09-04 03:36:42.634 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 4, data: [27, -4, -8, -1]}
09-04 03:36:42.634 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 5, data: [-28, -1, 0, 0]}
09-04 03:36:42.634 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 6, data: [27, -4, -8, -1]}
09-04 03:36:42.644 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 7, data: [-28, -1, 0, 0]}
09-04 03:36:42.644 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 0, data: [27, -4, 0, 0]}
09-04 03:36:42.644 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 1, data: [-36, -1, 0, 0]}
09-04 03:36:42.644 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 2, data: [27, -4, 0, 0]}
09-04 03:36:42.644 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 3, data: [-36, -1, 0, 0]}
09-04 03:36:42.654 31722-31869/com.project.name I/test﹕ Unknown log entry: {id: 4, data: [27, -4, 0, 0]}
09-04 03:36:42.654 31722-31869/com.project.name I/test﹕ Progress: 0/13056/
09-04 03:36:42.654 31722-31869/com.project.name I/test﹕ Log download completed
I only get this on the first run through the loop. Then I only get this:
Skipped 4719 frames! The application may be doing too much work on its main thread.
on subsequent loops.
It still never goes through the route manager to process. I also tried changing the delay time from 3 seconds to 100 ms and I still got 13056 records from receivedUnknownLogEntry.
09-08 12:10:19.418 13043-13285/com.project.name I/test﹕ Progress: 751/5103/
09-08 12:10:19.588 13043-13285/com.project.name I/test﹕ Progress: 495/5103/
09-08 12:10:19.748 13043-13285/com.project.name I/test﹕ Progress: 239/5103/ (It just stops here)
...several good downloads then...
09-08 14:28:56.788 6635-6887/com.project.name I/dlLog? Log download completed
09-08 14:28:56.788 6635-6887/com.project.name I/VibrationMeterFragment? accList1 size: 536
09-08 14:28:59.648 6635-6887/com.project.name I/test? Progress: 132/146/
09-08 14:28:59.688 6635-6887/com.project.name I/test? Progress: 118/146/
09-08 14:28:59.748 6635-6887/com.project.name I/test? Progress: 103/146/
09-08 14:28:59.818 6635-6887/com.project.name I/test? Progress: 89/146/
09-08 14:28:59.878 6635-6887/com.project.name I/test? Progress: 75/146/
09-08 14:28:59.908 6635-6887/com.project.name I/test? Progress: 61/146/
09-08 14:28:59.928 6635-6887/com.project.name I/test? Progress: 47/146/
09-08 14:28:59.948 6635-6887/com.project.name I/test? Progress: 33/146/
09-08 14:28:59.968 6635-6887/com.project.name I/test? Progress: 19/146/
09-08 14:28:59.988 6635-6887/com.project.name I/test? Progress: 5/146/
09-08 14:28:59.988 6635-6887/com.project.name I/test? Progress: 0/146/
09-08 14:28:59.988 6635-6887/com.project.name I/dlLog? Log download completed
09-08 14:28:59.998 6635-6887/com.project.name I/VibrationMeterFragment? accList1 size: 608
09-08 14:29:01.708 6635-6887/com.project.name I/test? Progress: 0/4/
09-08 14:29:01.708 6635-6887/com.project.name I/dlLog? Log download completed
09-08 14:29:01.708 6635-6887/com.project.name I/VibrationMeterFragment? accList1 size: 608
09-08 14:29:05.548 6635-6887/com.project.name I/test? Progress: 0/4/
09-08 14:29:05.548 6635-6887/com.project.name I/dlLog? Log download completed
09-08 14:29:05.548 6635-6887/com.project.name I/VibrationMeterFragment? accList1 size: 608
09-08 14:29:11.108 6635-6887/com.project.name I/test? Progress: 0/4/
09-08 14:29:11.108 6635-6887/com.project.name I/dlLog? Log download completed
09-08 14:29:11.108 6635-6887/com.project.name I/VibrationMeterFragment? accList1 size: 608
... it just keeps looping and never downloads more data