Smartport telemetry for Cleanflight
With their latest transmitters and receivers FrSky changed telemetry protocol. XJT module, Taranis radios, X8R, X4R and X4RSB are using SmartPort telemetry protocol. And that creates few problems. First of all, SmartPort is a serial protocol. That means, flight controller has to have free serial port to connect S.Port device. Second of all, TX and RX lines shares the same wire. The work in half-duplex mode. Third of all, SmartPort signal levels are inverted: logical 0 is in HIGH state, logical 1 is in high state. All of that combined, connecting SmartPort receiver to flight controller and sending telemetry data is not so easy to archive. Specially on FCs without hardware inverters. That applies to most popular STM32F1 devices like Naze32 and Flip32. Not only numer of UARTs there is limited, but also they lack hardare inverters. Of curse, everything is possible and hardware solution for Cleanflight, Naze32 and SmartPort telemetry can be found here.
Luckily, there is simpler solution for Cleanflight that uses SoftSerial and does not require any hardware hacks besides special wire. Requirements:
- Cleanflight capable flight controller (STM32F1 or STM32F3),
- SmartPort enabled receiver: FrSky X8R, X6R, X4R, X4RSB,
- Possibility to enable SoftSerial. Depending on FC type, different fetures like Parallel PWM, Sonar, LED Strip or Current Meter collides with SoftSerial functionality. Check documentation first. In case of Naze32/Flip32 WS2812b LED strips and Parallel PWM can not be used.
Next, we have to make a special cable that will bridge together TX and RX lines from flight controller and connect them to S.Port data line. Do not worry, it's OK to bridge those pins together. Nothing will be broken, it's just like forcing logical state on pin. Electrical diagram looks like this:
You do not have to connect +5V and GND lines. They are already there with RC signal.
When this is done, let's configure Cleanflight.
- Open Cleanflight Configurator
- Open CLI tab end ensure telemetry inversion is enabled by typing
set telemetry_inversion = ON
. Then typesave
to reboot flight controller - Open Configuration tab and enable SoftSerial
- Save settings
- Open Ports tab and enable SmartPort telemetry on selected SoftSerial port with Auto baud rate
- Save settings
- Open Configuration tab and enable Telemetry
- Save settings
Starting from now, Cleanflight will be sending telemetry data back to receiver. So, let's configure it there. In case of FrSky Taranis it would look like this:
- Power up flight controller and radio
- Goto taranis Telemetry screen
- Select and enter Discover new sensors
- New sensor should appear in a list above.
- Because Cleanflight does not sends all data when disarmed, arm flight controller. Be sure to remove propellers before you do it. Safety first!
- More sensors should appear
- Hit Stop discovery
Done. From now on, Taranis can start showing you the data you need, report voltage, etc.
I'm Paweł Spychalski and I do things. Mainly software development, FPV drones and amateur cinematography. Here are my YouTube channels: