Teraranger One

Hi,
I have a teraranger one distance sensor, and I’m trying to integrate it to a px4_fmu-v5 flight controller. I’m using firmware 1.14 beta.

For the integration I am following this documentation https://docs.px4.io/v1.13/en/sensor/teraranger.html using the teraranger i2c converter. However, it looks like the sensor it is not correctly detected.

Here’s some logs from the terminal when I run i2cdetect -b 1 and dmesg. It says no instance of teraranger is found despite being connected to the I2C A port through the i2c converter

i2cdetect -b 1
Scanning I2C bus: 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
nsh> dmesg
HW arch: PX4_FMU_V5
HW type: V5000000
HW version: 0x000
HW revision: 0x000
PX4 git-hash: 18898f1876ec1be9f86d89aedc56b4918c983afa
PX4 version: 1.14.0 80 (17694848)
OS: NuttX
OS version: Release 11.0.0 (184549631)
OS git-hash: 3f77354c0dc88793a47ff3b57595195ab45f7ba9
Build datetime: Jul  6 2023 19:36:41
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 9.3.1 20200408 (release)
PX4GUID: 000200000000203335375942500f003c002e
MCU: STM32F76xxx, rev. Z
INFO  [param] selected parameter default file /fs/mtd_params
INFO  [param] importing from '/fs/mtd_params'
INFO  [parameters] BSON document size 2732 bytes, decoded 2732 bytes (INT32:50, FLOAT:84)
INFO  [param] selected parameter backup file /fs/microsd/parameters_backup.bson
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
Loading airframe: /etc/init.d/airframes/4015_holybro_s500
INFO  [dataman] data manager file '/fs/microsd/dataman' size is 62560 bytes
INFO  [px4io] IO FW CRC match
Board sensors: /etc/init.d/rc.board_sensors
icm20602 #0 on SPI bus 1 rotation 2
icm20689 #0 on SPI bus 1 rotation 2
ERROR [SPI_I2C] bmi055: no instance started (no device on bus?)
ERROR [SPI_I2C] bmi055: no instance started (no device on bus?)
ms5611 #0 on SPI bus 4
ist8310 #0 on I2C bus 3 (external) address 0xE rotation 10
WARN  [SPI_I2C] ist8310: no instance started (no device on bus?)
WARN  [SPI_I2C] teraranger: no instance started (no device on bus?)
ekf2 [1110:237]
Starting Main GPS on /dev/ttyS0
Starting MAVLink on /dev/ttyS1
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS1 @ 57600B
INFO  [logger] logger started (mode=all)
INFO  [uavcan] Node ID 1, bitrate 1000000

NuttShell (NSH) NuttX-11.0.0
nsh> ERROR [flight_mode_manager] Failsafe task activated

So no I2C device is connected/detected at -b 1

Make sure you try other buses as well when connected and disconnected to see if the device shows up.

i2cdetect -b 0
i2cdetect -b 2
...

There chance that you are looking at the wrong bus. If this is not the case most like it is some issue with the device not receiving power, or it is broken. i2cdetect should detect the address of any I2C device that is connected to the bus. If you have any other I2C device try to connect it.