Packets lost streaming data from multiple boards

edited January 2020 in Python

Hello,
I'm testing streaming data from four MetamotionR boards
_ Hardware revision [0.4]
_ Firmware revision [1.5.0]
_ Model number [5]
with the integrated bluetooth of a RaspberryPI 3 model B+. On the raspberry pi was flashed the image received from Mbientlab by email (https://mbientlab.com/tutorials/MetaHub.html#download-image). The python code is attached.

I'd like to stream simultaneously accelerometer (25Hz), gyroscope (25Hz) and magnetometer data (20Hz) for 60 seconds from four different boards connected to the same integrated bluetooth antenna of RaspberryPi 3 model B. The expected number of samples is 1500 for accel and gyr, 1200 for magn.

When I use the integrated bluetooth antenna of my Lenovo Z50-70 laptop the number of samples is correct (they are the expected number minus an error of 1%).

When I run the code on the RaspberryPi the results are very bad. The relative error is bigger than 1%.

What did I do wrong?

Thank you,
Francesco

Comments

    • Does performance improve if you reduce to 3 devices?
    • Try using the packed variants of the acc, gyro, and mag signals
    • Use an external USB BT adapter instead of the pi's integrated one
  • I replaced the standard command with these:
    _mbl_mw_acc_get_packed_acceleration_data_signal
    _mbl_mw_gyro_bmi160_get_packed_rotation_data_signal
    _mbl_mw_mag_bmm150_get_packed_b_field_data_signal
    NOTHING is changed.
    The performance when I used only ONE board (60seconds, acc:25Hz, gyr:25Hz, magn:20Hz):
    _acc_samples : 1467
    _gyr_samples : 1440
    _magn_samples : 1182

    I bought the BLE dongle from your shop, but It is not compatible with linux, why you sell it without an announcement?
    So, I bought another dongle (https://www.amazon.it/Plugable-Technologies-USB-BT4LE-Bluetooth-adattatore/dp/B009ZIILLI/ref=sr_1_3?__mk_it_IT=ÅMÅŽÕÑ&keywords=plugable&qid=1579130886&sr=8-3) and, now, I'm waiting.

    P.S.
    1) system info: Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
    2) I have also other problems that appear often and randomly:
    2.1) 'raise result[0] mbientlab.warble.WarbleException: Timed out while trying to connect to remote device'
    2.2) 'RuntimeError: Error initializing the API (16)'
    2.3) 'RuntimeError: Error initializing the API (64)'
    It's very difficult execute the code with success and make some tests, the issues are more than the successes.
    I paid these boards, they are not cheap and there are lot of sw bugs.

  • edited January 2020

    By the way:

    I'd like to stream simultaneously accelerometer (25Hz), gyroscope (25Hz) and magnetometer data (20Hz) for 60 seconds from four different boards connected to the same integrated bluetooth antenna of RaspberryPi 3 model B. The expected number of samples is 1500 for accel and gyr, 1200 for magn.

    This is outside the capabilities of Bluetooth. Bluetooth only allows up to 120Hz or so total.
    You are doing 70Hz * 4 sensors which is beyond the capabilities of a single antenna.
    You need to divide up to two sensors per 2 antennas and not 4 sensors per 1 antenna.

    Basically your system architecture is wrong.

  • Thank you four your answer. Perfect, I will try another architecture with also the new BLE dongle.

    Sorry, but, I don't understand why in the last test that I run with only one baord I had these results:
    _acc_samples : 1467 [(1500-1467)/1500]*100 = 2.2% (relative error) (quite good)
    _gyr_samples : 1440 4% (very bad)
    _magn_samples : 1182 1.5% (good)

  • Hey @FraSabba,
    The gyro samples do seem worse than they should be. What error rates are you getting if you lower the sampling frequency?

  • edited January 2020

    25Hz is already the lowest sampling frequency for BMI160 (https://mbientlab.com/documents/metawear/cpp/0/gyro__bmi160_8h.html#ad345f6ab63af332180c7c66c0fc830fe)

    I run some tests with one board and the RaspberryPI integrated bluetooth, the total time is always 60seconds and the sampling frequencies are 25Hz(acc and gyro) and 20Hz(magn). The results are attached and they are terrible, the error behaviour is completely random!!

    Ok, but the 'great' news is now.

    After the eighth test completed successfully, the board is completely dead!!

    I restart the PI, I reset the PI's adapter, I tried to scan the device with the AndroidApp and another PC, I plug the board to the power and I tried again to scan it, NOTHING. The board is completely disappeared!!! Lost forever! Maybe the battery is dead??

    I attached the python code used for this test. Could you check it carefully and say me if there is something wrong that can damage the boards, I don't want damage the remaining ones.

    This is the third board lost!!. I received these boards two weeks ago, there is a warranty? At this moment my project risks seriously to be compromised!!!

  • Well you should always check that the boards are ok with our MetaBase iOS App. Let me know and confirm this first.
    Python and bluetooth is notoriously unreliable and unfortunately it's nothing to do with us or our code base.

  • edited January 2020

    Sorry, but if the board is invisible now from PI, my Android smartphone and my Linux PC, why do you think that it can be visible from an Apple smartphone?. The bluetooth adapter of this type of smartphone has special powers!! However, at the moment I don't have an Apple smartphone available for the test.

  • edited January 2020

    Ok thanks for the update.

Sign In or Register to comment.