Benewake TFmini-S: How to issue commands to change from UART to I2C?

Had the same problem and it has been reported elsewhere. Advice from supplier was forget I2C - there have been reports of slow updating and other problems. Use a serial port. I put mine on GPS2 port as my GPS uses CAN and Telem1 and Telem2 are both in use on my system. Works fine on serial.

I am using the FMU debug port now, the other UARTs are all busy. I am still puzzled that the I2C display stopped working and I am getting nowhere to get any solid information about other I2C or CAN bus Lidar. The TF03 is also available as CAN version but I cant find any confirmation that it works in Ardupilot.

Jan

I forgot - the other recommendation was use an external 5V supply from Bec or some other device if you have a lot of items running off the Cubeā€™s internal 5V supply or you can get drop outs, or simply failure to work. The TF02 is allegedly I2C or UART, but uses the same rubbish utility program and commands as all the other Benewake offerings and I wouldnā€™t risk good money on one. There are the LightWare ones, but they are expensive but allegedly work, with a caveat that use serial if cable run is long - whatever long meansā€¦

@pilotltd, I am not going for a Benewake again tbh. I use the one I have now obviously but on my next build I go for the LightWare SF11.

Have FuN!
Jan

1 Like

Sorry to hear that as I am pretty satisfied with these products.

The only problem here is the confusion about the I2C driver development that is working EXCLUSIVELY for the TFMINI PLUS as others TFMini are not register compatible.

1 Like

And that is exactly the problem, they have managed to make an entirely different product in a way that had at least me fooled into buying it in the assumption it would perform as a TFmini with I2C as it is listed in the parameter list ā€œ25 BenewakeTFmini/Plus-I2Cā€. The fact that it is a TFmini S only becomes clear after the fact. I consider that a bad naming convention on Benewakes end. I fell for it and have learned. Still having a working range finder, just not the way I intended to use it.

1 Like

ive got both TF mini and lunar working great on serial and do what I want but have some lightware including a SF11 Jan and it is rock solid just works

I dont think we can blame Benewake for this one, because the wiki was a little misguiding on this and I requested a change in in here:

https://ardupilot.org/copter/docs/common-benewake-tfmini-lidar.html

RNGFND1_TYPE = 20 works for TFminiPlus or TFmini, via its UART connection. If TFminiPlus is connected via I2C to the autopilot, use RNGFND1_TYPE = 25 (Benewake TFminiPlus-I2C) and also set RNGFND1_ADDR = 16 (I2C Address of lidar in decimal). The sensorā€™s default I2C address is 0x10 hexademical which is 16 in decimal.

2 Likes

Iā€™m with you on this snoozer. Benewake TFmini-S is I2C compatible according to their documentation. You can issue 5A 05 0A 01 all day but it does NOT switch to I2C mode. Iā€™ve tried a save after it, power off restart but it just comes back in UART mode. :rage:

@pilotltd I have been able to switch it to I2C alright, you have to add the check sum at the end, so 5A 05 0A 01 6A is what you would have to type and after save with 5A 04 11 6F. Then to confirm its on address 0x10 I hooked it up to a R-Pi and checked what I can see with i2cdetect -y 1. So my problem is not that it wont do I2C, its just not compatible with the TFmini I2C on Ardupilot.

Jan

Ahh - thanks for that. From what I was told - itā€™s a plus in a non IP65 housing? Did you try that? RNGFND1_TYPE = 25 (Benewake TFminiPlus-I2C) rather than 20?

This is exactly the issue I explained aboveā€¦NOT COMPATIBLE!

EDIT == WRONG !!! = It is working , see below .

Note to myself = Test before sticking to wrong conclusionsā€¦ stupid

1 Like

ppoirer - the mini-s is a plus - just without the IP65 case as I said earlierā€¦

@pilotltd , wellā€¦ I did my homework, I remembered that I had a TFMINI-s somewhere ā€¦

So I switched to I2C using @snoozer sequence:
5A 05 0A 01 6A
5A 04 11 6F
using RealTerm

And I loaded Bud Ryerson TFMINI PLYS Arduino code:

and it work !!

So 2 things:
A) Yeah , your are right it seems to be the same registers
B) My apologies for being so stubborn :slight_smile:

Now I will try to make it work with ArduPilot

Yes it works with ArduPilot :slight_smile:

Ok I am getting so confused with all this.
Can someone document what TF Minis work with Arducopter and how. I2C versus UART.
I have one TF Mini that is I2C onlyā€¦does that work now and if so what is needed to make it work.

I have the TF Mini Plus which is I2C and UART, IT doesnā€™t work but the vendor is sending me a replacement.

However I am told this does work with Arducopterā€¦I assume on either I2C and UART.
So how do you make it work. I donā€™t mean the Arducopter paramsā€¦thats easy. What commands need to be sent to make it work oh an what Ranger finder do you select in Arducopter.

Anyone.

Great - thank you for sticking with it :slight_smile: So conclusion is Mini-S, Mini Plus both work on I2C as type 25.

Now just need to find a way to get it to put the distance into VTX OSD as either rngfnd or sonarrange distance. Unfortunately not one of the options available in OSD_config :frowning: I can get the data via telem to mission planner, (which sticks it so it overwrites other data on the minimised view) :roll_eyes: but would prefer not to have at two different places to see it.

hud

Right, so that is a bit strange now. I had it hooked up as I2C and only got erratic readings at update times. @pilotltd have you connected yours as I2C yet and is it working ? I am puzzled as to why I had such different experience.

Jan

No Iā€™ve not. I was advised to use UART if possible because of performance issues and I had GPS2 free. There were some reports here about it, not sure if itā€™s still an issue.

@rickyg32
Both TFMini PLUS and TFMini-S can work with I2c,
You need to issue this command
5A 05 0A 01 6A
5A 04 11 6F
using a serial terminal like the Benewake GUI or RealTerm

Then you connect to FC I2C and set rangefinder address 16 and type 25

@pilotltd I just set rangefinder1 and renamed as TFMINI in HUD

@snoozer , make sure you dont have other I2C devices connected for initial test, if all OK then you can try to pinpoint the problem. If you have erratic reading with just the TFMINI connected, then you might have an issue with the I2C lines not pulled-up on your FC. We generally use 2.5k Ohms resistors on both SCL and SDA (Clock and Data) lines pulled-up to VCC for I2C.