Value problem in magnetometer data

Hi ! I use metamotionR+ to get magnetometer data ,I use the example data in pymetawear package. But the data seems to be all the same even I rotate my device. Below is the tutorial code:

!/usr/bin/env python

-- coding: utf-8 --

"""

:mod:magnetometer

Created by hbldh henrik.blidh@nedomkull.com
Created on 2016-04-10
"""

from future import division
from future import print_function
from future import absolute_import

import time

from pymetawear.discover import select_device
from pymetawear.client import MetaWearClient

address = select_device()
c = MetaWearClient(str(address), debug=True)
print("New client created: {0}".format(c))

print("Get possible magnetometer settings...")
settings = c.magnetometer.get_possible_settings()
print(settings)

time.sleep(1.0)

print("Write accelerometer settings...")
c.magnetometer.set_settings(power_preset='REGULAR')

time.sleep(1.0)

print("Check accelerometer settings...")

settings = c.accelerometer.get_current_settings()

print(settings)

print("Subscribing to magnetometer signal notifications...")
c.magnetometer.notifications(lambda data: print(data))

time.sleep(10.0)

print("Unsubscribe to notification...")
c.magnetometer.notifications(None)

time.sleep(5.0)

c.disconnect()

And my output is

Also how to set different sample rate of magnetometer, I try the code but get wrong.
Here is my code: c.magnetometer.set_settings(odr='_20Hz', power_preset='REGULAR')

Thanks a lot!

Comments

  • MbientLab does not provide support for third party libraries; contact the package owner for help using his library.

    As for your magnetometer data, does the same behavior occur if you use the MetaBase app? Have you tried resetting the board and / or reflash the firmware?

  • @Eric said:
    MbientLab does not provide support for third party libraries; contact the package owner for help using his library.

    As for your magnetometer data, does the same behavior occur if you use the MetaBase app? Have you tried resetting the board and / or reflash the firmware?

    I try to read magnetometer data in MetaBase in my Win10 ,The setting and the output is below:

    It seems that the data remain the same no matter what movement I made .

    Is there any specific way how to resitting the board or reflash the firmware?
    Thanks !

  • Use the Android or iOS MetaBase app try both methods.

This discussion has been closed.