This was touched on in this question, but I was unable to get the solution to work: (Not all devices that are connection via I2C are showing)
I have a GY-87 multi-sensor module and can get the IMU (MPU6050) and Baro to work without issue. Those are i2c addresses 0x68 and 0x77. Supposedly the Compass (HMC5883L) is being blocked by the MPU6050. In the C i2cdev library, there's a call to 'enable bypass' for the compass, which allows it to be accessed. The above question seemingly describes the python equivalent (where you're manually sending the appropriate values to the appropriate registries to enable bypass), but after I run the below code, I don't see the compass appear on i2c detect.
What am I doing wrong?
import smbus
import time
#initialize so we can get the hmc
bus = smbus.SMBus(1) # or 0, depends on the revision of the board
address = 0x68
PWR_MGMT_1 = 0x6B
bus.write_byte_data(address, PWR_MGMT_1, 0x80)
time.sleep(2)
bus.write_byte_data(address, 0x37, 0x02)
bus.write_byte_data(address, 0x6A, 0x00)
Link to module: https://www.amazon.com/Accelerometer-Compass-Barometric-HMC5883L-MPU6050/dp/B017LADTEK