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

Allow any serial port to be used for RC input, while detecting the type of protocol #26943

Open
mvrius opened this issue May 1, 2024 · 4 comments
Labels

Comments

@mvrius
Copy link

mvrius commented May 1, 2024

Feature request

Is your feature request related to a problem? Please describe.

I have a Navio2 RPI Hat. While trying to set up Remote Control for the hat, I tried connecting my ELRS receiver, outputing either CRSF or SBUS directly to the UART port of the Navio2.

Using the CMD line arguments I passed in the serial port data from UART to Serial 5. My expectation was that configuring RC to protocol detect + Serial5 to RCIN, would mean that Serial5 input would be used for RCIN, then protocol detection kicks in.

In reality that doesn't seem to happen. The only input considered for RCIN is the actual RCIn Driver provided for Navio2 board.

Describe the solution you'd like

Allow any serial port to be used for RC input, while detecting the type of protocol.

Describe alternatives you've considered

I've unblocked myself by getting a PWM to PPM convertor, but I feel this should be solved in software.

Platform
[ ] All
[ ] AntennaTracker
[X] Copter
[X] Plane
[X] Rover
[X] Submarine

Additional context

Willing to contributed changes to this if somebody can help with some guidance on how this should be implemented. My analysis so far:

Looking at other HAL examples, ESP32 initializes the AP::RC in the RCInput Driver. But this doesn't seem to work as expected on Navio2 because AP_RCProtocol should be initialized after AP_SerialManager. Logging steps on Navio2 shows that find_serial of SerialManager will not find the configured RCIN serial_port.

There seems to be some wiring missing to allow for Serial RCIN to be supported on all types of UARTs and platforms.

@IamPete1 IamPete1 added the Linux label May 1, 2024
@kalzoo
Copy link

kalzoo commented May 3, 2024

Drive-by comment: have you tried sending SBUS to the PPM/SB pins at the end of the servo rail? Is that viable in your build?

@mvrius
Copy link
Author

mvrius commented May 3, 2024

@kalzoo - yes, that works as expected. Build wise I'm not blocked.

Allowing UART/any serial though should work or fail explicitly, so it's clear that RCIN configuration for serial is not support on certain boards.

I think it may also open future avenues, since configuring the protocol as CRSF may allow to send back telemetry to RC transmitters.

@peterbarker
Copy link
Contributor

As luck would have it I was just starting to look at fixing the Linux HAL in terms of RC input so that everything goes via the AP_RCProtocol library.

I don't think this is going to work as-is for getting RC input from the NavIO2's UART, there's going to be inversion problems at a guess. I do have a receiver wired up but haven't tried to configure things yet,

Closed by #27000

@mvrius
Copy link
Author

mvrius commented May 7, 2024

@peterbarker this is great!

Took a quick look at the PR. I did similar changes in my attempt to enable any serial to be used on Navio2, and it seemed to struggle with protocol detection. I think your intuition is right that there is going to be an inversion of problems.

If you need testers for this, I can gladly test this branch in June when I return back home from vacation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants