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

Re-architect mavlink UDP forwarder #154

Merged
merged 6 commits into from
Aug 20, 2024
Merged

Re-architect mavlink UDP forwarder #154

merged 6 commits into from
Aug 20, 2024

Conversation

wvarty
Copy link
Contributor

@wvarty wvarty commented Aug 11, 2024

This PR does a number of things:

  1. It extracts the majority of the mavlink parsing code out from the devWifi lib, and moves it into the mavlink lib, which is a much more fitting place for it.
  2. The original implementation used a special mavlink cmd msg to tell the backpack that we are using mavlink mode on the TX. This was flaky, because it injected itself into a running mavlink serial stream without checking if a packet was already in-flight. This meant that sometimes the message was unsuccessful, and the backpack could be set to the wrong mode. The message has now been moved to MSP, which is handled reliably in between mavlink packets.
  3. The original implementation monitored the Link Mode option from the main firmware, and if the user changed the TX to mavlink, it set the backpack to boot to wifi for UDP forwarding. It also detected mavlink heartbeats and auto-triggered wifi UDP forwarding. This has all been removed, so that we can decide to send telem to a receiver via ESPNOW, or to bluetooth (future).
  4. The telem mode of the backpack is now controlled in LUA via the Backpack->Telemetry option, which has 3 states (as of this PR):
    Off = don't foward telem at all
    ESPNOW = forwards the telem stream (either CRSF or mavlink, depending on what the TX is getting from the craft) to the tx-backpack, and then on to the backpack receiver via ESPNOW (for trackers etc, like the sentinel integration). This prevents the mavlink data from triggering the wifi. NOTE: Only CRSF is supported in this PR. A future PR is incoming for forwarding mavlink.
    WiFi = forward telem to the TX-backpack, and trigger wifi for UDP forwarding.
  5. This PR also removes the /logging web endpoint, which was rarely used as a dev debugging tool
  6. It also fixes a bug where the backpack no longer responded with the version string because it jumped straight to wifi if in mavlink mode.

@wvarty wvarty added the V1.5 🍰 Version 1.5 label Aug 11, 2024
src/Tx_main.cpp Outdated Show resolved Hide resolved
src/Tx_main.cpp Outdated Show resolved Hide resolved
@jonasniesner
Copy link

I don't know if this is relevant but this PR(+ the associated main project PR) works on my hardware TX: RM16S RX: Betafpv SuperD 2.4GHz FC: Ardupilot

@hyp0dermik-code
Copy link

hyp0dermik-code commented Aug 18, 2024

image

LGTM, Zorro/Rp4TD @ 3e07de8

@wvarty
Copy link
Contributor Author

wvarty commented Aug 19, 2024

@JyeSmith @pkendall64 @MUSTARDTIGERFPV
Are we waiting on anything else here?
PR has been tested by a few people now, and all the requested code changes have been made... whats the hold up on getting this ticked?

@wvarty wvarty merged commit 476d7c5 into master Aug 20, 2024
78 checks passed
@wvarty wvarty deleted the rework-mavlink-udp branch August 20, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V1.5 🍰 Version 1.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants