Closed jonathanfoster closed 2 years ago
Looks like this issue is related to https://github.com/micropython-IMU/micropython-mpu9x50/issues/3. The good news is besides the chip ID, everything is working well for me so far.
I'm getting this error too. module is stamped 9250, but chip id is 0x70. Turns out, it's a 6500 (chinese version). Surprisingly AliExpress now markets them as being chinese vs original. I just ordered a new one, chose original (purple board). let's see what gets delivered...
There is evidently a plethora of 9250-ish chips out there. I've pushed an update which behaves as follows. If the chip ID does not correspond to a true InvenSys 9250 a warning message, with the chip ID, is printed but the driver runs as normal.
At the time when we developed this, clones did not exist :)
damn... a few months back I bought a new MPU9250 from AliExpress. Given all the fakes, some sellers explicitly differentiate fake from original offerings ("chinese version" vs "original" etc) and even provide the originals in a different board layout. The "original" costs noticeably more.
I just soldered & tested the new "original". But it turns out to be the same fake! ID=0x70, again >-(
Btw I added some print() statements so clarify what is going on during initialization and what is going wrong. I can upload the files if interested, but I currently can't PR.
I'm using an MPU-9250/6500 and I get a "Bad chip ID retrieved: MPU communication failure" ValueError after initialization. My sensors chip ID is 0x73, but the MPU9250 class chip ID is set to 0x71.
I was able to work around the issue by simply setting the class chip ID before initialization.
The MPU-9250 register map does in fact list 0x71 as the default value for WHOAMI (see page 44), but there appears to be another variant of the sensor, the MPU-9255, that return 0x73 instead (page 44 of the MPU-9255 register map).
The real problem is I've got a MPU-9255 that's stamped as MPU-9250/6500. It appears others have run into the same issue as well (see https://github.com/miniben-90/mpu9250/issues/13 and https://github.com/kriswiner/MPU9250/issues/47).
It would be easy to make chip ID an init parameter, create a MPU9255 class, or just remove the exception from being thrown all together. I'm happy to submit a PR if either approach would work.