TeraRanger One on I2C port?

Hi, I’m using a navio2 with a Raspberry Pi 3. I desperately need to get some more accurate height sensing for my drone and I have a TeraRanger One available (http://www.teraranger.com/products/teraranger-one/) with the I2C adapter (http://www.teraranger.com/product/teraranger-i2c-adapter/) AND the USB adapter (http://www.teraranger.com/product/teraranger-usb-adapter/).

Also I have this ultrasonic sensor (http://i.imgur.com/FJP9ooB.jpg, http://i.imgur.com/R00teJ9.jpg, http://i.imgur.com/mSG55m9.jpg)

What is the best way to make a rangefinder work with the navio2? Can I get it to work straight away with Arducopter so it used the rangefinder for height sensing or can I read the height on the raspberry pi into a python script? Or both?

Any help appreciated, I need this to work! :smiley:

Yes, it should just work. The only thing that could go awry is that TeraRanger might not support I2C at 1Khz. The solution is to lower it in /boot/config.txt.

Well I have connected the teraranger one to the I2C port on the Navio2, set the parameters according to this (TeraBee TOF RangeFinders — Copter documentation). The Teraranger One says that it supports up to 1kHz in fast mode, up to 600Hz in precison mode. I have tried it both with the config.txt set to dtparam=i2c1_baudrate=1000000, 600000,400000,1000 and 600 but I’m not seeing any output in Sonar Range in mission planner. Any ideas?

This is the output from i2cdetect:

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

I gave up and used the MaxBotix I2C sonar which works on I2C with baud set to 400000 and RNGFND_TYPE = “2".

i2c1_baudrate should be either 100000, 400000 or 1000000. If you’re willing to debug further, we can give it a try.