-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can´t read the magnetometer #14
Comments
Hi, Did you calibrate your Mag sensor? If yes, did you rotate the sensor in 8 direction while calibration? Were you getting any values without calibration? The issue seems similar to this |
@JGonzalga Try using mag precise calibration and while calibrating move your sensor in ∞ (infinity) shape. |
Were you able to fix this issue @niru-5 @JGonzalga ? I'm still having the same trouble and when I run imu.caliberateMagApprox() get the following error Then when I run imu.caliberateMagPrecise() this is the error |
Hi @marcofariasmx, In MagApprox()
Could check the output on this and see if there is a difference between max and min values captured during the calibration process? I believe it is a similar issue in caliberateMagPrecise(), it is getting a singular matrix, which is normally unlikely. Thank You |
Hello @niru-5 just tried your code but I am still getting the same error, could it have something to do with the registers numbers?? At the beginning I get the error "The name is wrong [117] The mag name is different and it is [0]" I am using a GY-91 device which is supposed to have the MPU9250 with the AK8963 magnetometer. I read something interesting in this repo https://github.com/ricardozago/GY91-MPU9250-BMP280 that may have something to do with changing addresses but I still haven´t figured out where the problem is. Thank you very much for your help. |
@niru-5 I also just tried with another GY-9250 module and got "The name is wrong [112]" but the same error at the end |
@niru-5 I think this might also be related to my issue since I only see the x68 address appear https://www.reddit.com/r/embedded/comments/kurlke/i2cdetect_not_detecting_ak8963_sensor_on_mpu9250/ |
Hi @marcofariasmx, Could you check if you are getting any mag values without calibration? This will show if the mag sensor is being accessed or not.
Thank You |
@niru-5 I got all 0s values. It has something to do with the name (address) 117 which = x75. I think I got a different MPU unit, maybe a fake one and it cannot access the right address for the Mag values. I don´t know how to change the address to try and see if it gets any numbers. |
Hi @marcofariasmx, All the address and config values are present in this file -> link. Changing them directly is not possible but you could use the workaround below. Example of the full code is below.
Thank You |
Hi. I think i'm having same issue. I'm trying to read the MPU9250 values with a Raspberry Pi. When I run the command 'i2cdetect -y 1', it shows the 0x68 address of the accel/gyro, the 0x76 address of the BMP280 and other addresses of some ADS1115 that i have wired (0x48, 0x49, 0x4a and 0x4b). It does not show the 0x0C of the AK8963. When i run the Basic Usage, at the imu.begin() it shows the same issues than the relationed with this post: name is wrong, mag is different, looks like it did not write properly.... I'm new to imu's sensor, and almost new to python, so i'm really lost. I've read about bypass through mode, Fuse ROM, but I'm not understanding anything. Could someone help me please? |
@marcofariasmx Hi. First of all, apologize me for re-open this issue (and for the language, i'm Spanish :) ) Thank you!!! |
@niru-5 Thank you so much for the help, I concluded it was a faulty sensor. Tried a new one and worked well. @locissigtech maybe the same is happening to you. |
Thank you so much!!! I'm trying that tomorrow, hope that's the solution!! |
@locissigtech Hi, have solve the problem? |
No. I went back to MPU6050 and use a LIS3MDL for the magnetometer. Then I used Madgwick Orientation Filter for quaternions and euler angles. Thank you for asking! |
Hello, I am trying this code for the MPU9250 and I am able to obtain the pitch and roll orientations, but I am not able to read the magnetometer for the yaw estimation. This is what I get when running the script:

It seems that the script is not able to configure the magnetometer, when looking into its registers this is what I found:
Neither the Id and the name of the sensor seems right, do you have any advice on how to fix it?
Thanks in advance
Josué
The text was updated successfully, but these errors were encountered: