The code stop when set accelerometer sampling to 100

Hi,
I used the "streaming" example from python documentation in this link ( https://github.com/mbientlab/MetaWear-SDK-Python/blob/master/docs/source/datasignal.rst#streaming ) but when I set mbl_mw_acc_set_odr to 100.0 the software stop with error: ( Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) ) it stops while printing the data
but when set the mbl_mw_acc_set_odr to 25 or less it will work without problem.
I use Raspberry pi 3 and Metamotion R firmware versions 1.5.0 and 1.5.1.
can you please help me to solve this problem?

Comments

  • Looks correct. you might need to post your entire code, I don't think the 100.0 is the issue.

  • @Laura said:
    Looks correct. you might need to post your entire code, I don't think the 100.0 is the issue.

    there's no more code I used the example in the documentation only

  • works but suddenly stop with error: ( Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) ) when the sampling is 100 and when reducing the sampling for 25 as an example it will work for a longer time than 100 sampling.

  • edited August 2021

    Can you share the code you are running? Can you share the data you are receiving that shows 25Hz?

  • @Laura said:
    Can you share the code you are running? Can you share the data you are receiving that shows 25Hz?

    this is the code"

    import sys
    from mbientlab.metawear.cbindings import *
    from mbientlab.metawear import MetaWear, libmetawear, parse_value, create_voidp, create_voidp_int
    from time import sleep
    
    
    class State:
        def __init__(self, device):
            self.device = device
            self.samples = 0
            self.callback = FnVoid_VoidP_DataP(self.data_handler)
    
        def data_handler(self, ctx, data):
            print("%s -> %s" % (self.device.address, parse_value(data)))
            self.samples+= 1
    
    states = []
    for i in range(1):
        d = MetaWear('C6:DF:DC:A1:EB:69')
        d.connect()
        print("Connected to " + d.address)
        states.append(State(d))
    
    for s in states:
        print("Configuring device")
        libmetawear.mbl_mw_settings_set_connection_parameters(s.device.board, 7.5, 7.5, 0, 6000)
        sleep(1.5)
    
        libmetawear.mbl_mw_acc_set_odr(s.device.board, 25.0)
        libmetawear.mbl_mw_acc_set_range(s.device.board, 16.0)
        libmetawear.mbl_mw_acc_write_acceleration_config(s.device.board)
    
        signal = libmetawear.mbl_mw_acc_get_acceleration_data_signal(s.device.board)
        libmetawear.mbl_mw_datasignal_subscribe(signal, None, s.callback)
    
        libmetawear.mbl_mw_acc_enable_acceleration_sampling(s.device.board)
        libmetawear.mbl_mw_acc_start(s.device.board)
    
    sleep(30.0)
    
    for s in states:
        libmetawear.mbl_mw_acc_stop(s.device.board)
        libmetawear.mbl_mw_acc_disable_acceleration_sampling(s.device.board)
    
        signal = libmetawear.mbl_mw_acc_get_acceleration_data_signal(s.device.board)
        libmetawear.mbl_mw_datasignal_unsubscribe(signal)
        libmetawear.mbl_mw_debug_disconnect(s.device.board)
    
    print("Total Samples Received")
    for s in states:
        print("%s -> %d" % (s.device.address, s.samples))
    
  • The output when set the odr to 25 and 100 in the attached file

  • If you set this to libmetawear.mbl_mw_acc_set_odr(s.device.board, 100.0)
    It should work just fine.
    Do you have data to show it does not work?

  • @Laura said:
    If you set this to libmetawear.mbl_mw_acc_set_odr(s.device.board, 100.0)
    It should work just fine.
    Do you have data to show it does not work?

    It looks like you didn't check the output in the attached file. there are two outputs first one is when I set the odr to 25 and the second one is when the odr is set to 100.
    please check the attached file in my previous reply.
    the situation is even worst when set the odr to 100

  • The file doesn't include timestamps so I can't comment.

Sign In or Register to comment.