Proper way of resetting the device from code?

edited January 2016 in Android
What is the proper way of resetting the board from android code?

After debugModule.resetDevice();
The board is disconnected but at connect and setting it up again the following occurs:

java.lang.RuntimeException: Duplicate logging keys found: acceleratordata
at com.mbientlab.metawear.impl.DefaultMetaWearBoard$RouteBuilder$DataSignalImpl.log(DefaultMetaWearBoard.java:885)
at com.mbientlab.metawear.impl.DefaultMetaWearBoard$RouteBuilder$DataSignalImpl.log(DefaultMetaWearBoard.java:877)
at com.sonali.acceldata.MetaWearSensor$7.connected(MetaWearSensor.java:333)
at com.mbientlab.metawear.MetaWearBleService$2$6.run(MetaWearBleService.java:1028)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)

It i possible to get it working by making a whole new instance of metawearboard but must be some other way?

Comments

  • You can remove the routes before readding them.  Once you've reset the board, then the board's state is no longer what the API thinks it is unless you've programmed the setup into the flash memory via the Macro module.
  • Thanks! 
    Worked great.

    For other it's MetaWearBoard.removeRoutes()
This discussion has been closed.