HMC5883L external APM compass

There is a problem with HMC5883L external APM compass. I am using 3.6.0 plane on Rpi3 + Navio2.
i2cdetect can see a new device has been connected but mission planner does not see any changes in mx3, my3, mz3 values.

Any help?

Can someone guide me through the most important steps for connecting external compass and setup in mission planner?

What address is getting printed in i2cdetect output? ArduPilot expects HMC5583L to be on 0x1e.

Is third compass’ tick checked in GCS? (COMPASS_USE3)?

If this is the case, I suggest looking at the console output (launch ArduCopter-quad without arguments). It usually prints something like External compass connected

Yes, the address is 0x1e and COMPASS_USE3 = 1. After restart COMPASS_DEV_ID3 = 0 in the parameter list.

This is what I get in my terminal window:

pi@navio:~ $ sudo ArduPlane
Raspberry Pi 2/3 with BCM2709!

Init ArduPlane V3.7.0 (9ea82ab9)

Free RAM: 262144
load_all took 2997us
0 0 0 DataFlash_File: buffer size=16384
/sys/kernel/rcio/adc/ch65 not opened: No such file or directory
AK8963: Onboard compass detected
LSM9DS1: Onboard compass detected
? <???!?!?0d???}?
? @??!?!?0d???}??HMC5843: Could not calibrate sensor
HMC5843: External compass not detected

What are the possible reasons for it not being calibrated?

Also, after compass calibration, the 1st and 2nd internal compass values do not match (in particular, the graphs for my vs my2 and mz vs mz2). If I negate the COMPASS_OFS2_Y and COMPASS_OFS2_Z in the parameter list, the graphs suddenly start following each other (as expected in calibrated compasses). Is there a chance there is a typo in the code and the wrong sign is saved in the offset parameter?

Is there a chance you have a faulty HMC?
As far as a I can see, the driver detects that it is in fact HMC and then it fails somewhere in AP_Compass_HMC5883::_calibrate() method.

  1. you’re sure that this is HMC5583L, aren’t you?
  2. you use a GPS kit with a compass onboard or solely a compass?
  3. nothing else interferes with I2C? (You only launch ArduPilot application instance once.)

If nothing rings a bell, I suggest trying to lower i2c_baudrate in /boot/config.txt to 400000.