Setting up Beaglebone Blue with TFMini Serial lidar

Hello all,

I am setting up a Beaglebone Blue with the latest Plane 4.0 and I have been struggling to get the TFmini lidar to work with it.

The details of the setup, I have the lidar connected to UART5 configured from the following setup file

TELEM1="-C /dev/ttyO1"
TELEM2="-A udp:<target IP address>:14550"
GPS="-B /dev/ttyO2"
RANGER="-F /dev/ttyO5"

and I changed the output of the lidar to pix mode. After connecting the lidar to the board, I confirmed that it was working with the command

cat /dev/ttyO5

The output was in fact showing the time sequence of the distance measurements in meters, confirming that it is working. I then went into mission planner and set the following parameters

RNGFND1_TYPE = 20 # the tfmini serial rngfndr type
SERIAL5_BAUD = 115 # the rngfndr buad rate
SERIAL5_PROTOCOL = 9 # the rngfndr protocol

However, when I check the sonar reading in the Mission Planner status window, it still showed zeros and I was getting a bad Lidar health warning in the horizon display. I then tried setting the other serial port protocols and buad rates to see if I just picked the wrong one, but that didn’t change anything. I also rebooted the board to see if the changes would take effect on the next boot, also didn’t help. I then tried connecting the lidar to a Pixhawk 4 mini, and strangely enough, I got it to work with the Pixhawk, and the sonar reading in the status window of mission planner was displaying the range detected. However, going back to the Beaglebone Blue, still no luck.

Anyone have similar troubles or any ideas on what I am doing wrong?


I think you are facing 2 issues here.

A) The TFMini being configured in clear text , you need to use it as a TYPE = 8 (LightWareSerial)

B) The mapping is somehow tricky on a Linux System
You need to map the physical port to the letter corresponding to the logical port
Here is the map

  • uartA - the console (usually USB, runs MAVLink telemetry)
  • uartB - the first GPS
  • uartC - primary telemetry (telem1 on Pixhawk, 2nd radio on APM2)
  • uartD - secondary telemetry (telem2 on Pixhawk)
  • uartE - 2nd GPS
  • uartF - User Configurable
  • uartG - User Configurable
  • uartH - User Configurable

and by experience, here what I know works OK on a BeagleBone:
A console - Serial 0
B 1st GPS - Serial 3
C telem1 - Serial 1
D. telem2 - Serial 2
E. 2nd GPS - Serial 4

Note , I dont remember if “F” was mapped correctly , so I recommend you play safe

So in your example , if you want to assign the /dev/ttyO5 to Serial 4 you set:
RANGER="-E /dev/ttyO5"

and set Serial 4 as:
SERIAL4_BAUD = 115 # the rngfndr buad rate
SERIAL4_PROTOCOL = 9 # the rngfndr protocol

Hope it will help

Thank you very much for the clear instructions. I finally got it working thanks to your help. I reset everything and did exactly what you said. The only extra thing is after setting the parameters in Mission Planner I had to do a reboot and now the sonar range is displaying.

Thanks again for your help!

1 Like