Thread Tools
Dec 09, 2016, 04:39 PM
Registered User
nitbeat's Avatar
Discussion

Modify Betaflight PID & VTX Settings /w TARANIS LUA Script Menu


I wrote a complete tutorial here:
http://www.nitbeatfpv.com/frsky-taranis-pid-settings





UPDATE
Betaflight 3.1.x is now officail -> https://github.com/betaflight/betaflight/releases
which supports the MSP ove S.port method

It requires flashing special TARANIS & Betaflight firmwares and using a LUA Script.
You need to connect the S.port to a free UART# TX pin (choose telemetry SmartPort in Ports tab)

A few Important Notes

1) Many Pilots reports problem with the open-tx RC11 firmware, more info here:
https://github.com/betaflight/betafl...ipts/issues/21

2) F4 Targets and a few other FC doesn't have inverted telemetry feature, so you'll have to solder the s.port uninverted signal.
Quote:
Originally Posted by rehrlich
Ok here's an update and this should be pinned in the beginning. If you're running an f4 board that doesn't have a dedicated s.port uart you will need to invert the signal even with the x4rsb. Just run a wire from this pad here to a free uart on the fc. I hope this saves people all the trouble I've been through to get this going.
https://www.rcgroups.com/forums/show...&postcount=156

Try this guide: https://blck.mn/2016/06/smartport-th...nd-betaflight/






Just make sure you have experience with flashing your TARANIS and Flight controller,
before following the instruction in this guide.
* I don't take any responsibility for damage or malfunction or injury, so be cautious its all in BETA stages.

I tested it on
- FrSky TARANIS and the TARANIS Plus versions
- SPF3 FC and OMNIBUS F3 Flight controllers
- X4R and XSR Receivers


I followed this guide: http://copterjungle.de/betaflight-pi...is-einstellen/ that is written in the German language * Thanks google translate, and this guide owner
Last edited by nitbeat; May 29, 2017 at 07:48 AM.
Sign up now
to remove ads between posts
Dec 09, 2016, 04:40 PM
Registered User
nitbeat's Avatar
If you decided to try it, please share your experience and setup,
good luck
Dec 11, 2016, 07:35 AM
Registered User
Interesting. I didn't think 2 way communication was possible on a hardware uart tx pin. Can anyone explain how this works?
Dec 11, 2016, 07:54 AM
Registered User
nitbeat's Avatar
Quote:
Originally Posted by Gozzz
Interesting. I didn't think 2 way communication was possible on a hardware uart tx pin. Can anyone explain how this works?
SmartPort is a 2 directional protocol, and I guess in the new Betaflight firmware there is implementations to make it work using only TX pin.

Initially I thought it sends data to the FC using the S.BUS, but I disabled it and PID Settings still works even without the S.BUS activated.
Dec 11, 2016, 08:42 AM
Registered User
Ah they must have enabled the optional pin resources on the stm32. Most pins can actually be programmed to do multiple things, kind of like ports on a regular computer. This is pretty cool stuff!

Thanks for sharing this!
Dec 11, 2016, 09:13 AM
I void warranties
Quote:
Originally Posted by Gozzz
Interesting. I didn't think 2 way communication was possible on a hardware uart tx pin. Can anyone explain how this works?
STM32 allows half-duplex (single wire) asynchronous USART comms on its hardware ports (the TX pin) . If you didn't know FrSky receivers all run an STM32F103, they've always been able to do it (half duplex comms) so it's no surprise our F3 and F4's can too.

Maybe one day FrSky will finally make the jump to S.Bus 2 so we can stop waisting a second HW port on doing one job (2-way communication with the rc transmitter) ... The flight controller is not the limiting factor in running telemetry + RC control on the same port / over the same wire... Actually there isn't a limiting [HW] factor, the code just doesn't exist yet...


Here is a paper from STMicro on UART comms, it's about a different family of uC (it's about the L4 series) but the info is very relevant to our use, if you wanted to research more.
Dec 11, 2016, 09:28 AM
Registered User
I am working on getting data to a FrSky sensor to but i don't understand how you receive the data on the sensor when you push it from a Lua script? Could you explain that?
Dec 11, 2016, 10:57 AM
Sagitta Fanboy
Quote:
Originally Posted by Cereal_Killer
STM32 allows half-duplex (single wire) asynchronous USART comms on its hardware ports (the TX pin) . If you didn't know FrSky receivers all run an STM32F103, they've always been able to do it (half duplex comms) so it's no surprise our F3 and F4's can too.

Maybe one day FrSky will finally make the jump to S.Bus 2 so we can stop waisting a second HW port on doing one job (2-way communication with the rc transmitter) ... The flight controller is not the limiting factor in running telemetry + RC control on the same port / over the same wire... Actually there isn't a limiting [HW] factor, the code just doesn't exist yet...
The problem with running S.Bus2 is then you're stuck with Futaba's insanely bad telemetry protocol in the aircraft (Seriously, it feels like Futaba is using something they developed around 1995 for industrial use and repurposed for modern hobby use). I'd honestly rather see SPort get updated to allow channels on the wire than updating to S.Bus2.

The other option is for FrSky to come up with their own bidirectional S.Bus implementation and publish it. It's pretty much guaranteed to be better than what Futaba's doing. Futaba seems to have managed to maintain control of S.Bus2 via sheer bad design.
Dec 11, 2016, 12:27 PM
I void warranties
Quote:
Originally Posted by mawz
I'd honestly rather see SPort get updated to allow channels on the wire than updating to S.Bus2...
Oh I totally agree on this! I only suggested what I did cause people don't like change and S.Bus2 is an existing thing. Yes I too would prefer to see an "S.Port2" with RC control over the [current telemetry protocol] S.Port but one issue with that is required increase in baud rate causing it to not be backwards compatible.

This "S.Port2" wouldn't be able to work with S.Port sensors cause the baud will have to be jacked up, the other way (slowing S.Bus down to 57600) would never be accepted by the community.
Dec 12, 2016, 11:06 AM
Registered User
Quote:
Originally Posted by Cereal_Killer
STM32 allows half-duplex (single wire) asynchronous USART comms on its hardware ports (the TX pin) . If you didn't know FrSky receivers all run an STM32F103, they've always been able to do it (half duplex comms) so it's no surprise our F3 and F4's can too.

Maybe one day FrSky will finally make the jump to S.Bus 2 so we can stop waisting a second HW port on doing one job (2-way communication with the rc transmitter) ... The flight controller is not the limiting factor in running telemetry + RC control on the same port / over the same wire... Actually there isn't a limiting [HW] factor, the code just doesn't exist yet...


Here is a paper from STMicro on UART comms, it's about a different family of uC (it's about the L4 series) but the info is very relevant to our use, if you wanted to research more.
Yeah I was aware they run stm32 micro controller. It is pretty neat stuff, I've been looking into getting a discovery board to mess around with but I don't know which I should get (the F4 or F3...) I've looking into the alternate pin functions and it looks like there could be endless possibilities for future development.

I'll check out that link! Thanks!
Dec 13, 2016, 08:03 AM
Registered User
Quick update, I tried this myself and had the following issues-

The script works with the latest RC build of OpenTX (I used build 2.2.N360 and its associated SD card files). The only issue is that the lua script is not selectable from the Telemetry Display Screen on the Transmitter, when go to select a script I get "No scripts located on SD card". I can select the script from Companion 2.2 but when executing it from the Transmitter Telem Display screen it gives a script error. However the script will execute and work as intended when browsing to it from the Main Menu SD card explorer page.

So when using the OpenTX build linked in the blog post (which seems to be a 2.1.6 bootloader using 2.2.* firmware built on Sept 10) using the SD card files currently available for 2.2.N360 (which are 2.2v0004) I get an SD card version error on startup (it is expecting 2.2v0003). Even if I continue on this build still states there are no scripts on the SD card (even though the script is in the /scripts/telemetry/ directory) and to top it off when trying to configure it in Companion 2.2 the TX will Freeze and only shut off if I pull the battery. I tried to configure it in both Companion 2.2 and Companion 2.1.9... both had the same result.

So, technically it seems to work. Not sure if I fully trust the build linked though as it is using the wrong version bootloader (which I'm theorizing might be causing the TX to freeze when plugged into Companion).

It would be great to get this working with the latest OpenTX build as the scripts seems to work fine but I'm not sure who to explain these issues to...

Mike
Dec 13, 2016, 08:11 AM
Registered User
Since it is not a telemetry script you should only start it through the sd browser.....
Dec 13, 2016, 08:30 AM
Registered User
nitbeat's Avatar
Quote:
Originally Posted by Gozzz
Quick update, I tried this myself and had the following issues-

The script works with the latest RC build of OpenTX (I used build 2.2.N360 and its associated SD card files). The only issue is that the lua script is not selectable from the Telemetry Display Screen on the Transmitter, when go to select a script I get "No scripts located on SD card". I can select the script from Companion 2.2 but when executing it from the Transmitter Telem Display screen it gives a script error. However the script will execute and work as intended when browsing to it from the Main Menu SD card explorer page.

So when using the OpenTX build linked in the blog post (which seems to be a 2.1.6 bootloader using 2.2.* firmware built on Sept 10) using the SD card files currently available for 2.2.N360 (which are 2.2v0004) I get an SD card version error on startup (it is expecting 2.2v0003). Even if I continue on this build still states there are no scripts on the SD card (even though the script is in the /scripts/telemetry/ directory) and to top it off when trying to configure it in Companion 2.2 the TX will Freeze and only shut off if I pull the battery. I tried to configure it in both Companion 2.2 and Companion 2.1.9... both had the same result.

So, technically it seems to work. Not sure if I fully trust the build linked though as it is using the wrong version bootloader (which I'm theorizing might be causing the TX to freeze when plugged into Companion).

It would be great to get this working with the latest OpenTX build as the scripts seems to work fine but I'm not sure who to explain these issues to...

Mike
Hi Mike,

I updated the guide: http://www.nitbeatfpv.com/frsky-taranis-pid-settings
Have you followed the part for the LUA script linking (screen 14/14) in the TARANIS ?

I had the error msg in the splash screen, but its still worked for me when I long press PAGE button it did open the script.

To remove that annoying msg I just took this file: "opentx.sdcard.version"
from: http://downloads.open-tx.org/2.2/nig...s-2.2V0004.zip

I edited the text line inside and changed it to: 2.2V0003
(Just a temporary fix I guess)
Dec 13, 2016, 09:19 AM
Registered User
Quote:
Originally Posted by nitbeat
Hi Mike,

I updated the guide: http://www.nitbeatfpv.com/frsky-taranis-pid-settings
Have you followed the part for the LUA script linking (screen 14/14) in the TARANIS ?

I had the error msg in the splash screen, but its still worked for me when I long press PAGE button it did open the script.

To remove that annoying msg I just took this file: "opentx.sdcard.version"
from: http://downloads.open-tx.org/2.2/nig...s-2.2V0004.zip

I edited the text line inside and changed it to: 2.2V0003
(Just a temporary fix I guess)
nitbeat, I did follow the linking on page 14 (it's the Telemetry Display screen part i mentioned above). For me it is still saying "no script on SD card" when I go to select it. And yes the script is in the /scripts/telemetry/ directory.

I also modified the SD card version as you did but still got the same error (no script on SD card) on the telemetry display screen. That is when I tried to configure it through Companion and it froze when I hooked it up to the computer. I'll give it another go tonight, maybe i'll format the SD card while it's in the TX to see if it helps, not sure if it's a permissions thing or something like that.
Dec 13, 2016, 09:22 AM
Registered User
Quote:
Originally Posted by Tadango
Since it is not a telemetry script you should only start it through the sd browser.....
I gotcha but It seems to work for OP through the telemetry display screen. Do telemetry scripts need to follow a certain naming schema on the latest 2.2 build?


Quick Reply
Message:

Thread Tools