-
Notifications
You must be signed in to change notification settings - Fork 35
Building a bluetooth adapter for Taranis S port telemetry for MWP
Unmaintained Article Please check the manual for more up-to-date information.
These instructions are for those people who have a Frsky radio, fly a drone / plane, equipped with a flight controller (like iNav), and want to visualize the S-port telemetry data on a laptop screen, including a moving map / track, while in flight using MWP.
It could be used for any program, but as far as I'm aware, MWP is the only program available, that can be used.
EDIT: it seems, there now also is an Android app, 'iNav SmartPort telemetry viewer and logger', which should work using the same hardware.
MWP is also great to view Blackbox logs, configure waypoint missions, etc. (to upload WP missions, you'll need a direct bluetooth connection to the FC. it cannot be done using S-port).
For MWP to receive the S-port telemetry, you will first need S-port telemetry working between plane and your Taranis radio. See iNav wiki
On the laptop, we'll need to setup MWP https://github.com/stronnag/mwptools
Please be aware that MWP is a Linux program. It won't run directly on Windows.
** Since this article was contributed, it is simple to install mwp in Windows 11 / WSLG ** Documentation
Otherwise, you will have to get Linux running on your computer first. To install Ubuntu (a Linux variant), and install MWP, please see: https://github.com/stronnag/mwptools/wiki/Install-mwp-on-a-Windows-computer-for-Linux-noobs
Running Linux can be done, in a virtual machine, without affecting your windows installation. Please be aware, it will be slow... (but still usable on my 7 year old laptop)
See https://github.com/stronnag/mwptools/wiki/Using-the-smartport-telemetry-with-MWP for details on how to prepare MWP to use S-port
The S-port data will be forwarded to the serial port. You will still be able to see everything as normal on the Taranis screen
For communication of the S-port data, from the Taranis to the laptop, we'll use a Bluetooth connection.
To be able to use the bluetooth connection with any kind of transmitter (Tried with R9M and build-in XJT module), we'll use the build-in Serial port output, located inside the battery compartment of the Taranis.
When opening the battery cover, on the left is the battery connector, in the middle is the SD card slot, and on the right, is the serial port. This we will be using
see: https://github.com/opentx/opentx/wiki/Taranis-I-O-ports
The Taranis serial port can be configured to output the S-Port telemetry. You need to go into the Radio Setup (long press the menu button), then scroll to 'hardware' screen (page 8/9), at the bottom you'll find 'Serial port'. Change the setting to 'S-Port Mirror', and you're done. This setting will forward any received S-Port telemetry, and output (repeat) it on the serial port. Doesn't matter where the telemetry comes from. Could be any receiver using the build-in transmitter module, or for example an R9M module.
There is two issues to be aware of.
- the Taranis serial port is 'inverted'
- the power supply available on the serial port is full battery voltage (depending on the battery type, could be anything from approx 6 to 12.6 volts (3S Lipo). This is too much for our bluetooth dongle, so it needs to be lowered.
To build a bluetooth bridge to be used inside the battery bay, you will need:
- a HC-06 bluetooth dongle (https://www.banggood.com/HC-06-Wireless-Bluetooth-Transceiver-RF-Main-Module-Serial-For-Arduino-p-80364.html?cur_warehouse=CN) (an HC-05 can also be used, but is more difficult to configure)
- a connector for the serial port. For example, https://www.digikey.ca/products/en?mpart=PHR-4&v=455 However, a ordinary servo connector can also be used, but it will require more space, so it might not fit depending on the battery size you use.
- a simple NPN transistor (I used P2N2222AG, search ebay or aliexpress, commonly used on Arduino projects)
- a 1 kOhm resistor (or thereabout)
- a 10 kOhm resistor (or thereabout)
- a 3.3 Volt regulator. For example, a LD1117AV33 (check aliexpress). (5V will probably also work)
- some wire, heatshrink, etc.
- A FTDI adapter, if you haven't got one already, to be able to configure the HC-06 (https://www.banggood.com/FT232RL-FTDI-USB-To-TTL-Serial-Converter-Adapter-Module-For-Arduino-p-917226.html?rmmds=search&cur_warehouse=CN)
Before you solder anything together, you must first configure the HC-06. You can't do this anymore, once everything is connected. You'll need to connect the HC-06 to your computer using some serial adapter, like an FTDI adapter.
Configuring HC-05 or 06 modules can be problematic, because various software versions exists, and you'll never know which you get. The HC-06 (4 pin), is usually the easiest to configure, so thats the one recommended.
Connect VCC (or 5V to VCC, Gnd to Gnd, FTDI TX to HC-06 RX, FTDI RX to HC-06 TX (4 wires only)
insert adapter into the laptop USB port, and a serial com port should be detected.
Use a program like Putty or Tera Term to communicate.
Here is a nice tutorial https://www.youtube.com/watch?v=Iyd4gX0AR54
The default baudrate as delivered is usually 9600 baud, so first connect at 9600 using the FTDI. also enable CR+LF
On the HC-06 you don't need to do anything special for it to be in configuration mode.
Just make sure the HC-06 is not connected to any other bluetooth device when trying to configure. The red led has to blink (it stops blinking if it is connected via bluetooth)
To test if we are talking, open the com port in putty at 9600 baud, 8N1, CR+LF
type: AT
the answer should be: OK (this means, we're talking, and it's ready to be configured)
Try other baudrates if it isnt responding.
You should probably copy/past the complete line at once.... it needs to be entered at once, or it will time-out before you completed the line.
now we need to give it a name
type: AT+NAME:MYNAME
it should respond with OK
You should probably copy/past the line at once.... it needs to be entered at once, or it will time-out before you completed the line.
Set up the module for 57600 baud, as used by S-port.
type: AT+UART:57600,0,0
if that doesn't work, try AT+BAUD7
(this is because different software versions exist... hopefully one of them should work.
If you get an OK, it will switch to 57600.
To be able to talk to it again, you need to switch Putty to 57600 as well...
type AT again (at 57600 baud). if it answers OK, you know it it correctly set to 57600
Now you can try to bind with it using bluetooth. Search for a new bluetooth device with the name you just gave it. the default pin code is typically 1234
If it binds, you're ready to solder everything together.
See diagram on how to connect everything.
https://drive.google.com/open?id=0BwevcPezRywJaVdjQzZSdXJXcE92Z3BvelNXOXVfc0xTUGxv
Here's mine https://drive.google.com/open?id=1iP6sOwo1Rqqm8qFxB87bIfagJuAC7pj1
I've simply soldered the HC-06, back to back to the voltage regulator on one side, and the transistor on the other side, keeping everything as small as possible to fit in the battery bay. You could just use a longer servo cable, and move it somewhere else. make sure you insulate everything, so nothing shorts out.
Alternatively, we could connect to the R9M serial port output on the back of the R9M This is the 3pin plug (next to the 4pin). Top = S-port, mid = +5V, below = GND. In this case, we wouldn't need the voltage regulator, but we still need the inverter (transistor + 2 resistors)
However, this way, it would only work with the R9M module, and not when using the build in XJT radio module
https://github.com/stronnag/mwptools/wiki/Install-mwp-on-a-Windows-computer-for-Linux-noobs
https://github.com/stronnag/mwptools/wiki/Using-the-smartport-telemetry-with-MWP
You will need to start the MWP program from the terminal window.
mwp -S 1024 -M 8 --smartport 00:21:13:02:A6:A0 --force-type 8
replace the MAC code (00:21....) with the code of your bluetooth adapter. After you bound it to Linux, you can find the code in the connect window on the top right of MWP (where it says 'SMARTPORT'), when you try to connect it directly.... Please be aware, it will not work if you connect directly to the BT adapter You have to select SMARTPORT, and then press connect.' Make sure your Radio is powered, and also the plane is powered, and sending telemetry.