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

If you have an Arduino , you may try this

1 Like

I am not a coder, I feel way more at home on a Linux CLI than an Arduino. I try the Linux approach 1st and see what happens :wink:

Thanks
Jan

Did raise a question in Mission Planner tag - no response. Looking at the app history nothing has happened with it in years.

Not sure if people noticed, but when implementing this I also added a script to switch the mode back and forth from UART <-> I2C. See Tools/scripts/tfminiplus.py in ArduPilot’s repo.

Thanks Lucas
Here is the link

Well finally this whole thing inspired me to push for this

1 Like

How are you making out Patrick

1 Like

Did you read the blog?

Yes very cool.
You tried very hard to hit your garage door with no luck. lol.
What would be interesting at some point is to design a drone with this hardware taken into account. So the drone looks like its a drone and not a drone wearing a big hat hahaha.

Please add comment on blog and I will answer there

i fricking love you guys. i was beating my head against the wall trying to make my tfmini plus work on i2c last night. i thought i bricked it so i exchanged it and was about to give up when i found this thread. thank you @ppoirier and @rickyg32

1 Like

Glad you got to where you needed to go. But it’s all down to @ppoirier. He is the genius here. I just follow what he is doing. Lol

:nerd_face: lol thanks @rickyg32

@ppoirier I have the tfmini plus and I am using a uart port rather than i2c. I can see it working in the Benewake app, and I know my rx and tx are correct on my flight controller, but I am using a custom firmware. I am running the Omnibus F4 Nano V6 and I was curious is maybe that firmware hasn’t caught up with lidar support? Also, when I check the Pix Mode box in the app, the graph stops and doesnt continue until I uncheck that box. Could that be related?

You can change mode so it outputs clear ascii text and be used as a standard UART rangefinder

I thought I did that by entering 42 57 02 00 00 00 04 06 and sending the command. Is there another command to send to save? It doesnt seem to keep after removing power

image

@ppoirier This is what my Tera Term looks like after entering 04 06

According to the TFMINI PLUS reference manual

5A 05 05 02 66 to get in PixHawk - Clear text
5A 04 11 6F to save

btw I dont think you can use TeraTerm for this you need something like RealTerm that can send command strings

Is this with or without the Pix Mode box selected? This should be the alternative to selecting the box, correct?

You need to have communication working before sending commands
The mode should change once you issue the save command