Resolved: LIS3MDL compass not detected with AC 4.0.7

I am using a Drotek M9N GPS with a built in LIS3MDL compass which is not detected during startup. It’s simply not listed in MP. I double checked the wiring which seems to be ok.
When I attach an older M8N module with a HMC5983 onboard everything works fine.

I thought that the drivers for the LIS3MDL were put back into the AC 4 code?
I am on Arducopter 4.0.7 and a cube black
The module is connected through the GPS1 port of the cube.

Did some further investigation on this issue.
I installed PX4 instead of Arducopter on my Pixhawk Cube black and voila, now the
lis3mdl compass connected via i2c is well recognized and can be calibrated.

So the compass module seems to be ok, so is the cabling.

With Arducopter 4.0.7, yet only the built in compass of the Cube are recognized.

I opened an issue on github https://github.com/ArduPilot/ardupilot/issues/17722
Would be great if someone from the dev team could have a look. Thanks!

CUAV X7 Arducopter 4.0.7
I have also a M9N GPS with I2C LIS3MDL (not from Drotek) as secondary GPS (Serial4 - UART4). Primary is CUAV M9N on main GPS, I2c, Buzzer and Safety switch plug (Serial3-GPS1).

LIS3MDL compass is identified and used.

OK you are using a CUAV X7 board, I am using a Pixhawk 2.1 board. When I read the Arducopter code correctly, if the board type is PX4_BOARD_PIXHAWK2, the lis3mdl is apparently disabled. @rmackay9 can you please comment?

Compass settings are quite messy when changing, adding or removing a component. I had to remove all compasses from calibration screen and redo calibration after adding (plugging) externals one after one.

No success. I just have the Cube with nothing but the m9n connected, and freshly installed AC 4.0.7 with the default parameters.
The lis3mdl is still not recognized. When I install PX4, the lis3mdl is instantly found and operational. In QGC I can then see in the MavlinkInspector the values for HIGHRES_IMU.xmag/ymag/zmag correctly changing when I move the magnetometer around.

I looks like an Arducopter defect in combination with the Pixhawk 2.1 board.

Thanks to @proficnc I could solve it.
The parameter CoMPASS_TYPEMASK is by default disabling the LIS3MDL compass. After changing the bitmask everything works fine now.

1 Like

yes, on Cube we disable that sensor as it is not one we trust anymore. however it is one of the options on rev 1 here+ (which has not been on the market for 3 years)

the Compass_typemask is very useful in ensuring that compasses that you do not want never show up

but if you need it, simply change the typemask