Sensor Fusion + Timer Processor + Anonymous Signals

Board Information

MetamotionRL
Hardware revision [0.5]
Firmware revision [1.5.1]
Model number [5]

and

MetamotionS
Hardware revision [0.1]
Firmware revision [1.6.2]
Model number [8]

Host Devices

Ubuntu PC (python with Warble) and also in ESP32 devboard (C++ with Nimble)

Description

I'm trying to use at the same time the sensor fusion, a timer processor to reduce logging sampling and download the logger using anonymous signals, however when I try to download the data using anonymous signals this error arises (python):

terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Aborted (core dumped)

All other configurations that I have tried seems to work just as expected, for example, using this configuration but instead of fuser using any other sensor, such as acc, gyro or mag it worked fine, or using sensor fusion and timer processor but download the logger without anonymous download also work just fine. Therefore, it seems that it is only when these 3 things are used together (sensor fusion, timer, anonymous download) that this error happen.

I first discovered this behavior with C++ with my own implementation of Bluetooth using Nimble, so I tried with linux using your implementation with Warble for Bluetooth, and the same error arises when you try to download the data logged. I have dug a little bit in the C++ code and it seems that something is happening in the metawearRL that doesn't return the expected data in the ble communications, here you can see the Bluetooth output and some prints of the functions in your API where the error happen:

I (54724) METAWEAR_ESP:  board initialized!
GATT procedure initiated: write no rsp; att_handle=31 len=3
I (56735) METAWEAR_ESP: time to init: 1.020000
I (56736) METAWEAR_ESP: STARTING DOWNLOAD
I (57236) METAWEAR_ESP:  anonymus calling
GATT procedure initiated: write no rsp; att_handle=31 len=2
GATT procedure initiated: write no rsp; att_handle=31 len=2
GATT procedure initiated: write no rsp; att_handle=31 len=2
GATT procedure initiated: write no rsp; att_handle=31 len=3
GATT procedure initiated: write no rsp; att_handle=31 len=3
I (57385) DATAPROCESSOR.CPP->static int32_t dataprocessor_config_received: RESPONSE[2]=25,RESPONSE[3]=7
I (57385) LOGGING.CPP->static MblMwDataSignal* guessLogSource: key id: 25
GATT procedure initiated: write no rsp; att_handle=31 len=3
GATT procedure initiated: write no rsp; att_handle=31 len=3
I (57477) DATAPROCESSOR.CPP->static int32_t dataprocessor_config_received: RESPONSE[2]=25,RESPONSE[3]=7
I (57478) LOGGING.CPP->static MblMwDataSignal* guessLogSource: key id: 25
GATT procedure initiated: write no rsp; att_handle=31 len=3
GATT procedure initiated: write no rsp; att_handle=31 len=3
GATT procedure initiated: write no rsp; att_handle=31 len=3
I (57550) DATAPROCESSOR.CPP->static int32_t dataprocessor_config_received: RESPONSE[2]=0,RESPONSE[3]=0
I (57551) LOGGING.CPP->static MblMwDataSignal* guessLogSource: key id: 0

It seems that the last communication for the dataprocessor shouldn't be 0. I don't know if I'm doing something wrong but it would be strange that I could reproduce the error in python and in C++ with different Bluetooth implementations, I can send you the python script that I used if you want. It would be great if you could help me, thank you in advance.

Comments

  • Do you have the code for me to replicate the issue? This will probably be the easiest way to debug.

  • edited September 23

    @Laura said:
    Do you have the code for me to replicate the issue? This will probably be the easiest way to debug

    Sorry for the delay, I attach here the following scripts to reproduce the issue.

    reset_metawear.py -> to reset device
    start_timed_sensors_log.py -> to start logging of acc, gyro and mag with timer processor
    start_timed_fuser_log.py -> to start logging with the fuser with the timer processor
    anonymous_download.py -> to download the logger using anonymous logs

    In order to reproduce the issue you should start the logger and then try to download it. If I reset the board, then run start_timed_sensors_log.py and anonymous_download.py, the logs are download as expected.

    However, if I run start_timed_fuser_log.py and anonymous_download.py the error that I posted before arises.

Sign In or Register to comment.