No readings from external compass on Pixhawk

Hi Guys,

I’m a bit stumped here trying to get my quadcopter with a pixhawk to calibrate (or even recognize) the external compass.

I am running APM Planner on OSX. I bought this Pixhawk second hand on ebay, and have not flown it yet.

After several attempts to calibrate the compass and researching, I discovered the log files do seem to recognize the compass, but don’t seem to get anything from it. Here’s what I’m getting:

Apparently 0 data points from compass 1 ( I assume since it has 2 compasses listed it is actually detecting the external in addition to the on board compass - not sure if this is correct)

[20161229 13:58:04.926 INFO ] - finishCompassCalibration with compass 1: 0  data points
[20161229 13:58:04.927 INFO ] - finishCompassCalibration with compass 2: 92  data points
[20161229 13:58:04.927 ERROR] - Not enough data points for calculation of compass 1:

[20161229 13:57:04.925 DEBUG] - Compass1 offsets x: 0  y: 0  z: 0
[20161229 13:57:04.926 DEBUG] - Compass2 offsets x: -43  y: -1012  z: -558

I originally had tried with the compass built into the GPS, and thought maybe it was faulty, so I also tried with a working HMC5883 (works fine with an arduino.) So basically 2 compasses and same results…

Voltage is correct on I2C pins 5V, 3.3V, 3.3V, Gnd.

Wiring is correct.

Not sure how else to trouble shoot this.

Any ideas??

Does anyone know which fields (if any) on the mavlink inspector would relate to data from the external compass? I see the RAW_IMU shows some data (see the image) but not sure if this is the internal compass or the external.

If you use pixhawk, in full parameter list there is a command called compass_dev_id, if number of id is less than 100000,mabye it is a external compass,otherwise internal compass.

Yes so you can see compass 1 is 73225, which is the external compass (I believe pixhawk will detect if there is an external and then make that the first compass, then make the internal compass the second) and the internal compass is Dev_ID2 with a value of 131594 which is greater than 100K. So this ought to confirm that the compass is detected and I2C is working…

Do these values in the RAW_IMU pertain to the primary (External) compass ?

i have never used APM planner, the gcs i used is Missionplanner. In MP there will be two mag data, it is magx,magy,magz and magx2,magy2,magz2.