-
Notifications
You must be signed in to change notification settings - Fork 586
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
Iot.Device.Imu.Mpu6050 - System.IO.IOException on .CalibrateGyroscopeAccelerometer() #2356
Comments
It's been a long time I haven't look at it. But seems you have to set a specific bandwidth before calibrating. Have you tried this? The error message seems to indicate that. |
Thanks for the reply. Yes I have tried this, see the example code below;
The output logs shows it appears to be set to the (To note it is only this class using the device so it can't be set elsewhere). I've tried setting this both in the constructor and directly prior to calling On top of this I have tried setting the MPU bandwidth directly on the pi
and then confimed the change with
which confirms the output is set to However, then when I run my service and run Just to note as well if I call;
I do get values returned from the unit the example output first time is
which then after the calibration failing just then outputs 0? Equally if do not calibrate the MPU I can read data from the unit (though I am I not sure how accurate this is). |
[Triage] @mfitconsultants can you share the stack trace within our code? (current shows only inside your code). Are you perhaps interested in creating a PR with a fix? |
No problem. I will put together a basic test program and PR for it. Stack trace
Is there any other information I can try to get? I've ordered another mpu6050 to see if it is the unit as well. |
Added a public repo here |
The local company ran out of the 6050 so sent me a Adafruit TDK InvenSense ICM-20948 9-DoF IMU (MPU-9250 Upgrade) (STEMMA QT / Qwiic) × 1 as a replacement. This looks like it isn't supported? I know not really the right forum, but in the short term to get this project off the ground, could you recommend a unit that works well with this library please? |
Supported, see here: https://github.com/dotnet/iot/tree/main/src/devices/Mpu6xxx9xxx |
@Ellerbach It doesn't appear the ICM-20948 is supported - whilst it mentions 9250 (it does mention upgrade) it appears not to be supported. I have tested to make sure and receive the error;
|
Clone the repository and use the project itself to debug. This clone may have a different signature. We saw this in the past and for some devices, we added the possibility to bypass the check. Also make sure it is at the proper address. |
I am struggling to calibrate an Mpu 6050 specifcially it is a;
Adafruit MPU-6050 6-DoF Accel and Gyro Sensor - STEMMA QT Qwiic
which is connected to a Raspberry Pi 2.
When I try to call the .CalibrateGyroscopeAccelerometer(); method I get the error;
System.IO.IOException: Can set GyroscopeBandwidth, desired value Bandwidth0184Hz, stored value Bandwidth0250Hz
From the logger the device is initilised;
MPU6050 initialized with I2C address 104 on bus 1.
From running sudo i2cdetect -y 1 on the pi I get
So the unit is present - i have also tried the a python sript which is returning data from the unit.
I have also tested
Prior to calling the
CalibrateGyroscopeAccelerometer()
method which return values. attmepting after the exception leads to 0,0,0 being returned.I cannot find any detail on this specific error? Can anyone tell me how to debug this and what I may be doing wrong please?
The text was updated successfully, but these errors were encountered: