Logging Acceleration Offline (n00b question)
Hi,
I'm Java developer, beginner with Android Studio. I setup and run on a Nexus 5 the Metawear-SampleAndroidApp. I have a few n00b question:
1. Is there a very simple Android Project to run sample example like:
2. How to perform logging of acceleration offline ?
I would like to stick the board on an object. Then log (offline) motion of that object for 2 weeks. Then download the log and send it by mail.
- I understand I can run code on board (without mobile). The Android app is use to write the code.
- I understand the Android app can read later the data and send it by mail
Do someone have already a dead simple Android project to do that ?
(Something wrapping this blogpost ?)
- I assume I need a button connect/disconnect
- I assume I need a button to write code
- Will the device always run that code ? (On sample app I have to push a button to start)
- I assume I need a filter to log the "motion" with a threashold to limit data stored.
- How to play with sensitivity ? In the sample app the 2G setting still require a strong motion.
- I assume I need to clear the logs on board after downloading it ?
- On sample app time is relative to ??? "start" can I have a timestamp ? Or at least a timestamp stored in the board when it starts ?
Thanks !
Sorry for my n00b question :-/
This discussion has been closed.
Comments
And then use the Trigger Free_Fall to activate the motion detection
Yes, streaming the data will give you immediate feedback.
For my log I only write "1" is there an average Gs or something ?.
We did something like this for Activity but I don't see something similar for Shake:
I know it really relies to activity but do you think that kind of Logger can stand days ? weeks ? months ?
I did some tests of activity on a Door but Activity is not triggered. I have to do a very strong acceleration on door to make it trigger.
2) The spec sheet for the MetaWearR accelerometer calls it "transient" so we have kept that naming convention.
3) Battey life can be retrieved with the readBatteryLevel function. The accelerometer will be constantly draining power doing all the motion detection but the MetaWear should be able to go a few days on a full charge. You'll have to run some live tests to see what works best for you.
4) You can configure thresholds using the withThreshold function.
loggingController.addTrigger(new Logging.Trigger() { ... }
The underlayer is the firmware that will poll the x,y,z every N milliseconds and compute something to detect if it is an activity according to threashold if "yes" then it fire a trigger, etc ... ?
Is it right ? How can I reduce the polling to save the battery ?
https://gist.github.com/JpEncausse/a7d1e7067ca9117a8a06
- I find why it do not log accelerometer I'm so stupid and forget the mma8452qModule.start();
- I start to understand why after disconnect it lost logs
https://gist.github.com/JpEncausse/a7d1e7067ca9117a8a06 1.
1.On connect I create a Logger When I setup my loggers, I provide an ArrayList to an anonymous class and I store all Message inside
2. On disconnect I set the Logger to null So when I disconnect/reconnect the new Logger Instance create a new ArrayList. (To debug I also create a Date) So Loggers use the closure to the Array/Date provided on setup ?! But but the Android may be garbage collected !? There is something I miss here ...