Range Finder Greyed out

I suspected that was the problem. I wonder what param its looking for,
I will configure it in teh background as soon as I figure out what params need to be set for an I2C version of the TF Mini…thanks all

I don’t have one but it wouldn’t be this?

@rickyg32 just go in mission planner open menu :
configure , full parameter tree and scroll down to rangefinder.
you should set I2C TFMINI as number 25

https://ardupilot.org/copter/docs/parameters.html#rngfnd1-parameters

Tried that and no go…but going to check to see if the cables are connected right.

tfmini measure

Me i’ve set mine in this way

can I get your mission planner settings? Also can you flip that board over and take another pic please?

Good day,
For this application im using mRo Can node f103 flashed with rangefinder firmware.
if you are using the pads under the board you have starting from left:
GND-SDA-SCL-RX2-TX2-RX1-TX1-5V
Solder the black cable to the GND and the power cable to 5V.
Solder the white cable on TX1 pad and the gree n cable on the RX1 pad.
In MP just go to RNGFND1:
RNGFND1_ADDR: 0 (leave in this way)
RNGFND1_ORIENT: 25
RNGFND1_GNDCLEAR: Distance (in cm) from the range finder to the ground ex 5cm to 127
RNGFND1_MIN_CM: me i’ve set 30cm
RNGFND1_MAX_CM: 600
RNFGTYPE: SET IT TO 24(UAVCAN)
I dont have done others modifications.

Lets start can gui settings:
1 CAN_NODE integer 0
2 CAN_BAUDRATE integer 1000000
3 RNGFND_BAUDRATE integer 115200
4 RNGFND1_TYPE integer 20
5 RNGFND1_PIN integer -1
6 RNGFND1_SCALING real 3.0
7 RNGFND1_OFFSET real 0.0
8 RNGFND1_FUNCTION integer 0
9 RNGFND1_MIN_CM integer 30
10 RNGFND1_MAX_CM integer 600
11 RNGFND1_STOP_PIN integer -1
12 RNGFND1_RMETRIC integer 1
13 RNGFND1_PWRRNG integer 0
14 RNGFND1_GNDCLEAR integer 5
15 RNGFND1_ADDR integer 0
16 RNGFND1_POS_X real 0.0
17 RNGFND1_POS_Y real 0.0
18 RNGFND1_POS_Z real 0.0
19 RNGFND1_ORIENT integer 0

After all the settings disconnect the drone from usb…re-strart it

While being really interesting and informative, I do not think that connecting on a UAVCAN gateway is helpfull on the actual problem of @rickyg32 with a TFMINI on I2C… or dod I miss something here ?

Good day on the node you have three I2C options, … on the pads and 2 on top of the boards.
i don’t know which version of tf mini they have,my test is done with the TF mini-S.

I am not lacking in any ports so there is no need for me to use the UAVCAN port and adapter. However it is interesting to see that it can be done. After doing some reading I found that I had set the Rangefinder type to the serial version. I corrected that to the TFMini I2C and now get the message that the rangerfinder is not detected. So this is a positive step I am now getting an error…But the down side is…Now I am getting an error. I suspect its an addressing issue…but I am unsure what to set it too.

In another document I just found this statement…hmmmm. However in the product manual it makes no statement of TTL only that its I2C.

The default communication of TFmini Plus is TTL,IIC and TTL are same cable,so please set TFmini
Plus to IIC communication first,see detail commands in product manual.

Also when I connect my USB to TTL adapter as I did for the UART TFMini there is no data received from the Lidar making me think its really talking I2C.
I connected it direct to the pixhawk bypassing any I2C hubs just to make sure power from the Pix wasn’t a problem…no change.
I really think it’s an address issue but I am at a loss to understand what.
I read in one document to set RNGFND1_ADDR=16 [Address of #1 TFmini Plus in decimal]
But I have no idea if this is correct as the document speaks to using it as a proximity detector for avoidance.
I also confirmed its not a power issue by running the TF on it’s own bec. Pain to setup but I did it…no change.
his is the address which i believe is 16 if I convert it from hex to decimal.

image

If it is speaking I2C you won’t be able to use the TTL converter.

However check out https://github.com/budryerson/TFMini-Plus-I2C He has done a lot of work with the TFmini’s and arduino. If you have a spare arduino laying around you could load up his INO and scan the bus to see if you can see the mini along with the distance scanning it is doing

Hey Smart Dave.
I knew that if it was running I2c as the data format that the TTL converter wouldn’t work. However one document indicated I needed to set it from TTL to I2C. However this doesn’t’ appear to be the case. Also I know about the Arduino work as I pestered the crap out of @ppoirier to get a working version in the past.
However TfMini I2C is now listed as a standard Rangefinder…so I should not need something in between. However I have yet to get it to work in it’s native format.
I have posted my questions in the forum section specific to I2C and the TF Mini but as yet there has been no response.

Yep, just tried my TFMINI PLUS in I2C with Bud Ryerson library and it works fine

To switch to I2C I send this command 5A 05 0A 01 from the BENEWAKE GUI

Question about sending commands in the GUI. Do you get a return code? In the docs it shows that if you send it this command you should get that command back. I have never seen a return. How do you know that the command was received successfully?

This is what I am referring to. I tried sending 5A 04 01 5F for a firmware rev but never got anything back after sending the command

Patrick I ahve the I2C version but when I connect it to the gui there is no data. I find nothing in any documentation that indicates it is in TTL to begin wtth. That said I can’t help but think that this must be the issue. But I am not sure how to prove it if there is no data on the gui when I make the connection.

This is the unit I have.

I am trying to make it work as I2C with my PIXHAWK, so far no reading

The GUI does not read status back
If you want to see it you can use Realterm and send Hex string and then freeze display (or set filter) to read back the TFMINI reply

OK I is working fine, here is my config

2 Likes

I will triple check the connections tomorrow…but my config matches yours.
I assume thats address 16
direction down
type tfmini i2c
Can yo expand the variable column so I can see them easier.

@rickyg32 I just looked in the code and I can’t see any I2C handling for the TFMINI like yours unfortunately. May I suggest that you contact your supplier and ask for an exchange for the TFMINI PLUS ?