Navio2 + TFMini Plus i2c

Hi,

i’ve got a Navio2 connected to a Raspberry Pi 3B+ and trying to connect two TFMini Plus to it with limited success.

I’ve changed the address of the TFMini Plus (using Bud Ryerson Arduino TFMPI2C_changeI2C) to 20 and the second one to 25. It gets recognized using i2cdetect -y 1 on the Raspberry Pi

In QGroundcontrol

First TFMini Plus
RNGFND1_ADDR: 20
RGNFND1_TYPE: 25
RNGFND1_GNDCLEAR: 10
RNGFND1_MAX_CM: 1200
RNGFND1_MIN_CM: 10
RNGFND1_ORIENT: Forward

Second TFMini Plus
RNGFND2_ADDR: 25
RGNFND2_TYPE: 25
RNGFND2_GNDCLEAR: 10
RNGFND2_MAX_CM: 1200
RNGFND2_MIN_CM: 10
RNGFND2_ORIENT: Down

No readout from both sensors. They are both connected through an i2c hub and i switched the SDA and SCL wires to correspond with the Navio2 pinout. (which works as they get detected by i2cdetect)

Also tried it without the hub. Same result.

Arducopter version is 4.0.3

Any pointers on how to get this working ?

When you set address with Arduino you use hex numbers but ArduPilot uses Dec numbers

So the Hex 20 should be 32 in ArduPilot parameters

The script uses decimal numbers

Show all I2C addresses in Decimal and Hex.
Scanning...
I2C device found at address 020 (0x14 HEX).

First I2C address found: 20.
Enter new address from 1 to 127 decimal (not Hex):

Ahh ok
And you set TFMINI as type 25 ?

Yes, Just edited my first post. Forgot to mention RNGFND_TYPE

Do you have other devices on I2C line?
Please show I2C-detect result

pi@navio:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- 14 -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- 77  

As you can see there is a ms5611 barometer on the i2c as well. Only one TFMini Plus connected at the moment. (without the hub)

OK good
Have you tried to launch ArduCopter manually and check if device is detected at startup?

Unbelievable. It sees it now. Have tried so many different approaches except starting it manually. Well it works. Now for the second TFMini Plus

Raspberry Pi 3 Model B Rev 1.2. (intern: 2)
0 0 MS5611 found on bus 1 address 0x77
AP_Logger_File: buffer size=51200
AK09916: Reset Failed
AK09916: Reset Failed
�	Q}��	Q���	Q� TFMiniPlus: found fw version 2.0.3
�	QC^MPU: temp reset IMU[0] 7232 0
MPU: IMU[0] stop at 24 of 36
MPU[0]: enabled fast sampling rate 8000Hz/1000Hz
Init Gyro**�	Q�.�	Q.P*

Ready to FLY �	Q̉MPU: temp reset IMU[0] 7184 -29668
MPU: IMU[0] stop at 25 of 25
�	Q&��   Q�h�		Q(MPU: temp reset IMU[0] 7168 -529
MPU: IMU[0] stop at 28 of 28
�	
Q��	
        Q���
Q���    Q�f�o:T[QE�	QvQ�	Q�/MPU: temp reset IMU[0] 7136 16639
MPU: IMU[0] stop at 24 of 24
�	Q���	QH��	QϢ�	Q%��	QQ�MPU: temp reset IMU[0] 7136 -514
MPU: IMU[0] stop at 25 of 25
�	Q���	�Q�C�	+=MPU: temp reset IMU[0] 7232 9981
MPU: IMU[0] stop at 23 of 23
�	Q�M�	QF3�	Qx��	Q��MPU: temp reset IMU[0] 7168 5886
MPU: IMU[0] stop at 24 of 24

Thanks a lot !

1 Like

Additional note , the unit looking down is handled as a range finder (sonar range) the unit looking forward is handled as a proximity sensor , so you have to set proximity type as rangefinder (type 4) and you can see the range by invoking the “radar” in Mission Planner (crtl-f and select proximity).

Noted. Thanks for the support. Really appreciate it.

An update about this issue i had. Since the TFMini-Plus works at 400kbps you also have to edit /boot/config.txt to:

dtparam=i2c_arm=on,i2c_arm_baudrate=40000

default is 100000