Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Feb 26, 2024

Conversation

mha1
Copy link
Contributor

@mha1 mha1 commented Feb 22, 2024

... for radios supporting S.Port SBUS input

Fixes #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/hal/module_port.h

Tested on NV14 and TX16s

@mha1 mha1 changed the title Trainer: allow mode Master/SBUS Module mode on S.Port pin Trainer: allow Master/SBUS Module mode on S.Port pin Feb 22, 2024
@Moumouls
Copy link

Moumouls commented Feb 24, 2024

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.

@mha1
Copy link
Contributor Author

mha1 commented Feb 24, 2024

@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.

@pfeerick pfeerick added bug 🪲 Something isn't working enhancement ✨ New feature or request labels Feb 26, 2024
@pfeerick pfeerick added this to the 2.10 milestone Feb 26, 2024
@pfeerick pfeerick merged commit ba319a7 into EdgeTX:main Feb 26, 2024
43 checks passed
@pfeerick pfeerick deleted the PR_SBUS_Trainer_in-module_bay branch February 26, 2024 00:26
@mha1
Copy link
Contributor Author

mha1 commented Feb 26, 2024

@pfeerick Thanks a lot Peter

@TranquilleXav
Copy link

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

@TranquilleXav
Copy link

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

ETX_MOD_DIR_RX);
const etx_module_port_t *port = nullptr;

#if defined(TRAINER_MODULE_SBUS_USART)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is needed? You could avoid the #if defined() IMHO.

@mha1
Copy link
Contributor Author

mha1 commented Apr 30, 2024

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.

@3djc
Copy link
Collaborator

3djc commented Apr 30, 2024

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"

@TranquilleXav
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Sbus In feature for External module
6 participants