A magnetometer is a sensor that measures the strength and direction of magnetic fields. In drones, magnetometers are used for navigation to determine geographical direction and allow precise position hold when stationary
Your magnetometer/compass is not working with INAV? Is the sensor red in Configurator? You are not the only one… Not only most popular compass HMC5883l is discontinued and what you get are Chinese clones, chip labeled 5883 might not be HMC5883l but something completely different. And I2C bus is very very picky and likes to give up on you….
This is how you might fix your problems: add pullup resistors for I2C SCL and SDA lines and/or lower i2c_speed
…
The simplest option is to try lower the I2C Speed. Bear in mind, this should be done ONLY when there are issues caused by the slow devices or long wires. In any other case, I2C Speed should be increased to 800kHz, not lowered.

Of course, if you want to, you can change it in CLI as well. The option is called i2c_speed

# This command sets I2C to 200kHz
set i2c_speed = 200KHZ
But one more time, first try to fix hardware problems and only then lower the speed on the bus. Usually using shorter wires and twisting them will be enough
Leave a Reply