RuntimeError while trying to log several times in a row

I want to connect to the device only once and then run a few test and log data without reconnecting each time.

I'm connecting successfully to the device at first, then creating a signal and using libmetawear.mbl_mw_datasignal_log to create logger,then I log data and finally using libmetawear.mbl_mw_logger_remove to remove the logger.
This works fine in the first or second time and beyond that I get the below error.

result[0] = RuntimeError("Could not create " + (resource if 'resource' in kwarg else "resource") ) if pointer == None else pointer
NameError: name 'kwarg' is not defined

Am i missing something regrading the clean-up after logging session?
Thanks!

Comments

  • edited February 27

    This error is because one of the methods you are using is missing an input.

  • edited March 4

    I did insert an input, sorry for not mentioning it.
    Full code is attached (With main example code for the error received).
    I'm using MetaMotionR

  • You have a reset method, copied below, but you never call it.

    def reset(self):
        try:
            libmetawear.mbl_mw_logging_stop(self.d.board)
            libmetawear.mbl_mw_logging_clear_entries(self.d.board)
            libmetawear.mbl_mw_macro_erase_all(self.d.board)
            libmetawear.mbl_mw_debug_reset_after_gc(self.d.board)
    
            libmetawear.mbl_mw_debug_disconnect(self.d.board)
        except Exception as e:
            return -1
        return 0
    
  • I have to reset after each logging session?

  • Yes but it doesn't affect you negatively in any way.

Sign In or Register to comment.