TFmini does not work on pixhawk2.4.8 with the error message "RangeFinder 1 no data"

Flight controller used: pixhawk 2.4.8
Firmware version : Arducopter4.2.1
LiDAR in use: TFMini-s (not TFmini !)
Symptom: Even after wiring to the SERIAL4/5 port and setting various parameters according to the official documentation (Benewake TFmini / TFmini Plus lidar — Copter documentation), the TFmini value ( sonnar range) remains unchanged at 0 on the misson planner.
Also, the relative altitude that can be checked on QGC does not behave according to the distance between LiDAR and the ground. Since I am using brand new TF-mini and connectors , I think it is the software that has the problem, but what could be wrong?
Here is the screenshot of mission planner. The “Sonar range” is always 0.

P.S. The problem looks similar to TFMini Plus LiDAR Distance Sensor not working with Pixhawk 2.4.8 - #20 by saintofinternet ,so I tried using I2C as in this thread, but still doesn’t work😢.

On the Benewake manual for the TFmini-S there is a quick test, how to program it as UART/I2C, and even how to change its I2C address.

If serial, you can connect it with an USB/UART converter (at 5V levels) and check its binary output using some serial monitor program.

If I2C, you can use an Arduino with an I2C addresses scanner program (default address 0x10).

Thank you for your reply !
I used benewakes official GUI app which has a serial monitor function, and I confirmed that the values behave according to the distance between ground and sensor.
So, my tf-mini-s’s factory default configuration is UART and it properly works. Even though, it doesn’t work when it is connected to pixhawk.
What is wrong ?

  • RX’s to TX’s. Choose correct four pins (or two) on Pixhawk SERIAL4/5 connector.
  • SERIAL4_PROTOCOL = 9 (Lidar).
  • SERIAL4_BAUD = 115 (115200 baud).
  • RNGFND1_TYPE = 20 (Benewake-Serial).
  • If testing with a serial program, check its output is binary (not easily interpreted).
  • Measure with voltmeter 5V pin. For reliability, independent 5V source.
  • Try on other Pixhawk serial port, changing parameters correspondingly.

Thanks for your kind reply !
I’ve tried the items you pointed out, but unfortunately they didn’t cure the problem.

So I read ardupilot discourse a little more thoroughly and found someone in the same situation as me at the following link.

I followed ibrahim’s instructions here and sent the command and was able to read the sonar range value successfully on the misson planner!

I have a question again, but the relative altitude values that I can see in QGC etc. do not match the distance sensor values, even though the sonar range values are changing.When I was using px4, they matched. Is this an ardupilot specification?

I would like to use the distance sensor value as the relative altitude in the range where the distance sensor is readable because I cannot rely on the GPS altitude estimation.

Recall from here:
check its binary output using some serial monitor program
and here:
If testing with a serial program, check its output is binary (not easily interpreted).

Pixmode is not the default, and you lose features if changing and using it. In this mode the output is clean ascii in cm, not binary. I think it would have worked with RNGFND1_TYPE=8.

For precision and status, check logs.