Downloading acceleration data logs
We are trying to make a basic app where we log accelerometer data onto the board and then tries to empty the log once every minute.
We have looked at the free fall example app and modified that and also the example app that comes with the Android API.
It works for a few times to download the logs but after some downloads the app start throwing exceptions and no more data is being correctly downloaded.
Most often there is a NoSuchElementException but sometimes out of memory and null pointer exceptions in the DefaultMetaWearBoard class.
To reproduce: Start the example app in the Android API, click connect, turn on accelerometer, click download. After a few downloads the app start throwing exceptions. Anyone else experiencing these issues?
Background task reported an error
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: java.util.concurrent.ExecutionException: java.util.NoSuchElementException
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.concurrent.FutureTask.report(FutureTask.java:93)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.concurrent.FutureTask.get(FutureTask.java:163)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.MetaWearBleService$3.run(MetaWearBleService.java:1126)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.Timer$TimerImpl.run(Timer.java:284)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: Caused by: java.util.NoSuchElementException
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.LinkedList.removeFirstImpl(LinkedList.java:689)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.LinkedList.removeFirst(LinkedList.java:676)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.LinkedList.poll(LinkedList.java:895)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.impl.DefaultMetaWearBoard$VariableLoggable.processLogMessage(DefaultMetaWearBoard.java:543)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.impl.DefaultMetaWearBoard.processLogData(DefaultMetaWearBoard.java:2686)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.impl.DefaultMetaWearBoard.access$4500(DefaultMetaWearBoard.java:70)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.impl.DefaultMetaWearBoard$6.process(DefaultMetaWearBoard.java:2372)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.impl.DefaultMetaWearBoard.receivedResponse(DefaultMetaWearBoard.java:3026)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at com.mbientlab.metawear.MetaWearBleService$2$6.run(MetaWearBleService.java:909)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
10-13 14:48:39.112 17044-17068/com.mbientlab.metawear.test E/MetaWear: at java.lang.Thread.run(Thread.java:841)
This discussion has been closed.
Comments
Is there any example, app note, etc. that shows how to stream or log either the sum or average - instead of raw accelerometer and gyro data. Especially if you want to analyze the x, y, z values PRIOR to and AFTER an event (e.g. RMS>Threshold).
As you correctly pointed out in multiple posts - both streaming and logging raw accelerometer and gyro data for high frequency application have issues (BLE/storage). It would be helpful for everyone who may be doing high frequency apps (>50Hz) if there is an example showing how to stream/log processed data PRIOR to and AFTER a triggering event.
Also, the logger is not meant for recording high frequency data, such as
acceleration data; the sheer volume of data will quickly consume all
the flash memory. You should think about what you want to do with the acceleration data and log processed data rather than raw data.
This is sort of what we were trying also. Is there a limit on the number of process you can have on board [remember seeing something about it on a doc, but can't find it now]?
We tried this with both 100Hz (what we need) and 50 Hz without success. Will try with 12.5 and see if we can get the data we need - and then wait for firmware update for higher frequencies.
Thank you again for looking into this --
Vinod