I am having an issue while trying to setup two i2c lidars simultaneously.
I am using Arducopter 4.5.7 firmware version with a Pixhawk Cube Orange + from CubePilot.
The setup is the following:
1 forward facing lidar from Benewake, TF-02 Pro I2C
1 downfacing lidar from Benewake, TF mini Plus I2C
I am using an I2C extender connected to the I2C 2 port of the FC. I have tested both hardware with an Arduino and they both work fine. The also have different I2C adresses, so there is no conflict. When i plug only one of the sensors they both work correctly and each one is detected in mission planner.
When i use both I2C devices plugged in the I2C extender, only one is working and the second one is not detected.
I also use a Here 4 DroneCAN, connected to the CAN port of the FC, with the CAN_D1_PROTOCOL set to 1 (there might be a conflict there ?)
Both rangefinders’ parameter are set according to the Ardupilot and Benewake manual documentation.
There seems to be a bus conflict (but I cannot change the bus number of each component in this Ardupilot version as there is no such parameter).
Some people on the internet are suggesting it could be due to a power insufficiency issue. Then you have to use external power to power each of them. Application of TF02-Pro IIC in Pixhawk.
Alternatively, you may want to use the GPS 1 port pins 4 and 5 without an I2C splitter to see if it works.
The TF02 pro can be used either with serial protocol or with I2C. The ardupilot rangefinder documentation doesn’t include the TF02 pro i2c, but I got the I2C version from Benewake and the manual says that it is compatible with Pixhawk. I don’t think this is the problem. Both of the Lidars get power from a large 4in1 BEC from Mauch, so I don’t get how it can be a power insufficiency issue.
I will try to power them individually, externally and also use the GPS 1 port.
You can disconnect the I2C bus connector on the FC, connect it to an Arduino and check independently with an i2c_scanner or similar program, and check if the lidars and other I2C devices are detected, with their different addresses.
If that works, try an Arduino program to read the lidars alternatively.
It seems not needed. You can use a passive splitter: