Problems with compass configuration on PixHawk Mini

I’ve been setting up a new Pixhawk mini on the bench, originally following the video guide in Basic Configuration. I’m having issues with using a compass with the latest stable PX firmware (1.8.2 stable).

I calibrated the gyro and accelerometer, worked OK. I then went through the compass calibration, and was guided through rotationing the pixhawk box through all the 3 orientations, but although it appeared to be successful the compass status indicator in the list stayed red.

After some research, I realised that I should connect the GPS+Compass included in the kit. Connecting this gave the setup shown:

This still gave the same problem, including a “No MAG 0” error in QGroundControl. Following some threads in this discussion I tried the following commands:

ls /dev

This did not list a mag0 device.I also tried

sensors status

Which did not list any magnetometers.

I have downgraded the firmware to 1.6.5. This now does show 1 magnetometer in the sensor status list, and I can calibrate it. However this appears to be a magenetometer in the pixhawk box itself, not one one the gps unit (as it responds when i rotate the box, not the gps unit). Thus I appear to still have no external magnetometer, and I have read that the internal pixhawk mini magnetometer should not be used. The GPS is detected and if I take my setup outside I can get a GPS fix.

I’ve not been able to work out how to generate detailed log files of the boot sequence to debug why no compass is detected. I’m going to continue trying to set up my quadcopter with the firmware I have using the internal compass, but I’m happy to test things out to try and get the external compass working, and working with the latest firmware, if people can point me in the right direction.

I personally disable the internal mag at CAL_MAG1_EN then temporarily mount the GPS/Compass on top of the Pixhawk Mini with double-sided tape then do all the sensor calibrations. I usually start with Gyro, Accel then Compass.

Good luck.

Thanks, I’ll try to disable the internal mag, however I worry that because no second magnetometer is listed, it will then have no magnetometer to calibrate with. Do you know if your mini’s detect 1 or 2 magnetometers? Also is there a consistent version of firmware you use, or do you just use the latest?