VOXL2 J19 QUP3
-
Hi,
I connected Lightware LW20/C on one of the I2C port on VOXL2 J19.
It is QUP3, and the pins I used are7 I2C3 SDA 3P3V slpi_proc, SSC_QUP3 8 I2C3 SCL 3P3V slpi_proc, SSC_QUP3and power & ground.
I also installed a customized voxl-px4 which will startlightware_laser_i2cwith the I2C address0x66.
On VOXL2, I editedvoxl-px4.conffile by addingDISTANCE_SENSOR=LIGHTWARE_SF000.
However, I cannot see any parameter regarding rangefinder... likeSENS_EN_SF1XX.I have done using LW20/C with UART connection successfully, but I2C does not work..
Can anyone give me any advise to use it via I2C? -
@voxltester That is not a normal option to choose via voxl-px4.conf. You will need to hand modify the startup script
/usr/bin/voxl-px4-startto properly start the driver in i2c mode. Use option-b 4to select that i2c bus. -
Hi, Eric.
I triedqshell lightware_laser_i2c start -a 0x66 # I2C address 102it did not work..
So are you meaning
qshell lightware_laser_serial start -b 4or
qshell lightware_laser_i2c start -b 4?
-
@voxltester I would try
qshell lightware_laser_i2c start -b 4 -
@Eric-Katzfey
Eric, this is not working...Please refer to the driver for i2c....
https://github.com/modalai/px4-firmware/blob/main/src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cppDefault i2c address is defined
0x66(102) in this code.
I am wondering what is the i2c address of theVOXL2 J19 - QUP3port.I am not familiar with the above cpp driver code... could you please have a look the code and teach me how to enable the i2c connection for the lightware rangefinder?
Thank you in advance....
-
@voxltester We have never used the device that you are connecting so I am only offering suggestions to help out. When speaking of i2c addresses it is related to the device being attached to the bus, not the bus itself. You can attach multiple i2c devices to the same i2c bus if they have different addresses. But, there are multiple i2c buses to choose from. So, address 0x66 (which is default for that device and doesn't need to be specified on the command line) is for the device and port 4 specifies which i2c bus it is connected to. Also, please look at this file: https://github.com/modalai/px4-firmware/blob/main/src/drivers/distance_sensor/lightware_laser_i2c/parameters.c. There are 2 parameters that need to be set properly for the driver to work. If the default values are not correct then you will need to set them accordingly. For SENS_EN_SF1XX it should be set to 6 for LW20/c.
-
@Eric-Katzfey
Understood. I just figured out address and bus. I am sorry for disturbing you for the basic concept.Now, I am trying to run it with
SENS_EN_SF1XX=6, the command inpx4-startis justqshell lightware_laser_i2c start.By the way, I am wondering where the
businfo is described in the driver cpp file. Should I change the code? Becauselightware_laser_i2caccepts onlyRas an option.. -
@voxltester It's all done in the base class. See: https://github.com/modalai/px4-firmware/blob/main/platforms/common/i2c_spi_buses.cpp
-
@Eric-Katzfey
the versions of px4 are different...
I am git clone from https://gitlab.com/voxl-public/voxl-sdk/services/voxl-px4
in which there is only one parameter in https://github.com/modalai/px4-firmware/tree/0a47ec5d8650f4e97f1eb929405df5dcdb91989f/src/drivers/distance_sensor/lightware_laser_i2cAnyway,
qshell lightware_laser_i2c startis not working withI2C port on VOXL2 J19 - QUP3 -
@voxltester Why are you not adding
-b 4?