Vl53l1x cannot connect to pixhawk

hi,

I bought an ATK-PMW3901 module and want to achieve indoor positioning. However, during testing today, the vl53l1x built-in in the module was connected to the I2C interface of pixhawk2.4.8, and the GPS module was unplugged(the SPI interface was not connected to PMW3901 because the wire I purchased had not yet arrived). At the same time, the settings shown in the following figure were made in QGC.
图片
图片
图片
图片

However, distance information is not displayed in the Mavlink Inspector, and the following issues were found when executing instructions in the Mavlink Console.
图片

I have modified the~/PX4 Autopilot/boards/px4/fmu v3/default. cmake file and recompiled and burned it.
图片
图片

May I ask if there is a problem with my settings and if I need to turn off GPS. I hope to receive your help. Thanks.

in Mavlink Console try to use i2cdetect to verify if the device is properly connected.

Thank you for your suggestion. When my I2C interface was connected to vl53l1x, I executed the i2cdetect command and did not display any data;
图片

But when I connect the I2C interface to GPS, it will display as follows:
图片

I don’t know why this is happening. I hope to receive your help. Thanks.

The GPS you are using most likely has an integrated magnetometer connected over I2C. So this 1E address is a magnetometer.

Scan all I2C buses when vl53l1x is connected and disconnected, there is more than one bus. Use
i2cdetect --help to learn about the command.

This is how to scan different buses.
i2cdetect -b 0
i2cdetect -b 1
i2cdetect -b 2

I have scanned all I2C buses, but since the I2C expansion board I purchased has not yet arrived, I can only insert one device at a time. When inserting GPS with a magnetometer, the scanning results are as follows:
图片

When inserting vl53l1x, the scanning results are as follows:
图片

So I think there may be some issues with my vl53l1x sensor, or there may be a problem with the circuit, and I will check it.
If you have any other ideas, I hope you can provide them to me. Thank you for your help.

I think there may be some issues with my vl53l1x sensor

Yes, definitely it doesn’t communicate with the flight controller and this is basic I2C communication (it doesn’t have to do anything with drivers or other software that is needed).

This is the first thing to solve, later you will maybe have an issue with the drivers, but first, take care of this.

1 Like