edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

Trainer: allow Master/SBUS Module mode on S.Port pin

Open mha1 opened this issue 1 year ago • 2 comments

... for radios supporting S.Port SBUS input

Fixes https://github.com/EdgeTX/edgetx/issues/3678

Summary of changes:

  • adds Master/SBUS Module Trainer mode (true idle low SBUS required) for Tx16s and other radios on S.Port pin
  • the few Taranis radios not being able to use the S.Port Pin will still work on the HB pin
  • added some comments to radio/src/gui/gui_common.cpp

Tested on NV14 and TX16s

mha1 avatar Feb 22 '24 19:02 mha1

thanks @mha1 for this PR, as i understand, it will allow to store a basic RX with SBUS output into the back of a TX16S and use it as a Trainer source ?

As i understand it's actually not possible even on the AUX1 because of signal inversion ?

From your point of view does a RX with this kind of SBUS output will work then ?

image

(The goal is to use a super cheap Microzone TX with their RX SBUS as a cheap wireless trainer)

Last note: I currently tested this receiver on AUX1 with Master/Serial but it seems to not work.

Moumouls avatar Feb 24 '24 13:02 Moumouls

@Moumouls Yes, this will allow to run a receiver with true SBUS output as a trainer source connected to the JR Bay GND/VCC/S.Port pins. By true SBUS I mean SBUS as Futaba defined it. Idle low/active high bus levels.

You are right, true SBUS can't be decoded on AUX1/AUX2 because the UARTs behind AUX1/AUX2 expect the usual idle high/active low bus levels. Some receivers like the ExpressLRS ones can output both, true SBUS and Inverted SBUS (which inverts the true SBUS levels). Any ExpressLRS receiver set to output Inverted SBUS will work on AUX1/AUX2.

If your receiver outputs true SBUS it'll work with this PR. It looks like your RX does that because there is a transistor inverting the SBUS signal for the MCU's standard UART (which can't decode true SBUS). Also the fact your RX doesn't work on AUX1/AUX2 points to the fact it is actually outputting true SBUS. Your RX should work in the module bay with this PR. But be careful with VCC. Most of the radios output the transmitters battery voltage (up to 8.4V) on VCC. Make sure your receiver can handle 8.4V. If not a 5V voltage regulator is required.

mha1 avatar Feb 24 '24 17:02 mha1

@pfeerick Thanks a lot Peter

mha1 avatar Feb 26 '24 08:02 mha1

thank you, it's ok with TX16s, firmware 2.10.0-rc3, multimodule 1.3.4.0.

TranquilleXav avatar Apr 28 '24 15:04 TranquilleXav

a little remarque: when I turn off the trainer radio, the master radio does not report the loss of trainer when I turn the trainer radio back on, the master radio does not report the return of trainer. if you have time for this , thank you very much

TranquilleXav avatar Apr 28 '24 15:04 TranquilleXav

a little remarque: when I turn off the trainer radio, the master radio does not report the loss of trainer when I turn the trainer radio back on, the master radio does not report the return of trainer. if you have time for this , thank you very much

For EdgeTX there is no way of knowing if the trainer radio is off or not. The only thing that EdgeTX sees is a valid SBUS data stream or invalid/no SBUS data stream. It all comes down to how your trainer radio and receiver handle a loss of communication between the two. Appropriate failsafe settings in your receiver, e.g. setting failsafe to "no pulses" are required. If your receiver goes to failsafe when turning off the trainer radio and failsafe is set to "no pulses", the master radio (EdgeTX) will properly recognize the loss of communication with the slave radio and will also announce the loss of the trainer radio.

Tested with TX16 as master (Master/SBUS) and ELRS receiver RM ER6 set to SBUS output using the default failsafe setting "no pulses" wired to the S.Port pin of the JR module bay.

mha1 avatar Apr 30 '24 17:04 mha1

a little remarque: when I turn off the trainer radio, the master radio does not report the loss of trainer when I turn the trainer radio back on, the master radio does not report the return of trainer. if you have time for this , thank you very much

You need to set your receiver failsafe to "no pulse"

3djc avatar Apr 30 '24 18:04 3djc

ok i understand: with the same radio and model in radio SF700S: failsafe is configured by the receiver, and it's ok (the radio is not transmitting any signal) R820SF: failsafe with the radio only, and it's ko (the radio transmits a signal for failsafe, i suppose) thank you!

TranquilleXav avatar May 01 '24 07:05 TranquilleXav

Hi, maybe you can add proper information about inverted sbus required in Aux in docs: https://manual.edgetx.org/color-radios/radio-settings/hardware and https://manual.edgetx.org/color-radios/model-settings/model-setup/trainer Or maybe there is better to change that option from "SBUS Trainer" to something like "inv SBUS Trainer"

rccam avatar Jul 01 '24 09:07 rccam

Or maybe there is better to change that option from "SBUS Trainer" to something like "Inverted SBUS Trainer"

It is definitely a good idea to document (at least for now). Ideally we would have some options for the serial mode, thus allowing to select the protocol (not just SBUS) and possibly signal polarity, as we'll be able to support changing the signal polarity on the upcoming H5/H7 based targets.

raphaelcoeffic avatar Jul 01 '24 09:07 raphaelcoeffic