Download Problem - Does not stop

The following odd behaviour began today: our metamotionC in a stepCounter mode has begun to do non-stop download.  I have verified this with a variation of the 'freefall' example adapted for stepCounter, and the Metaware app.  

In latter the behaviour is: start logging accelerometer, stop logging accelerometer, download begins and never ends.

In the example the start button had been modified to do the following:
findViewById(R.id.start_accel).setOnClickListener(v -> {
            logging.start(false);
            accelerometer.stepCounter().configure().mode(AccelerometerBmi160.StepDetectorMode.NORMAL).commit();
            accelerometer.start();
        });
And the stop button does the following.
findViewById(R.id.stop_accel).setOnClickListener(v -> {
            accelerometer.stepCounter().read();
            accelerometer.stop();
            logging.stop();
            accelerometer.stepCounter().reset();
            logging.downloadAsync();
        });
What I expect is a single read of the counter sent to logcat.  What I get is a continuous stream with the data looking as follows ie. same nonsensical value each entry separated by ~1/12.5 second.  Initially thought it was related to battery needing changing but that was done with no change in behaviour.  Firmware reset should clear the log, no?
...
{timestamp: 2017-11-09T14:14:16.374, data: [0xc2, 0x3c]}
{timestamp: 2017-11-09T14:14:16.384, data: [0xc2, 0x3c]}
...

Comments

  • [Solved]  Think about your use-case and whether you should have logging.start() set to overwrite 'true' or 'false'.  In this case you can see I had it set to 'false'.  However, I went and did some experimenting with some things without downloadAsync() which seems to have meant that I was accumulating more entries in the log.  When I started using downloadAsync() again what I was seeing was the download of a lot of accumulated stuff (a lot! as I spent many hours fiddling with various sensor features).  The solution was to add a logging.clearEntries() in my reset (have to disconnect for it to take effect though) and switch overwrite to 'true' while I'm more carefully define my use-case.
This discussion has been closed.