Skip to content

Make CRSF telemetry accessible over WIFI as UDP broadcast#211

Open
xNuclearSquirrel wants to merge 4 commits intoExpressLRS:masterfrom
xNuclearSquirrel:CRSF_TLM_UDP
Open

Make CRSF telemetry accessible over WIFI as UDP broadcast#211
xNuclearSquirrel wants to merge 4 commits intoExpressLRS:masterfrom
xNuclearSquirrel:CRSF_TLM_UDP

Conversation

@xNuclearSquirrel
Copy link

This PR adds access to CRSF telemetry over Wi-Fi, which currently only works for MAVLink while CRSF telemetry is only available over ESP-NOW.

This is a minimal implementation that broadcasts CRSF telemetry packets via UDP. It reuses the existing Wi-Fi/MAVLink networking path and uses mavlinkUDP.write() on MavlinkSendPort.

UDP broadcast is active when telemetry mode is set to WIFI in the ELRS Lua script.

This should not interfere with MAVLink in normal use, since CRSF and MAVLink telemetry are not used at the same time as far as I know. I could not test how it behaves with real ESP-NOW receivers since I don't have the hardware.

Previously, ESP-NOW was active whenever telemetry mode was not OFF (so even when set to WIFI). I kept this behavior in place and added UDP broadcast. The behavior is now:

  • WIFI: CRSF telemetry is sent via ESP-NOW and UDP broadcast.
  • ESP-NOW: CRSF telemetry is sent via ESP-NOW only.
  • OFF: no telemetry forwarding.

In my tests, this works in both AP and STA mode. I can receive the packets over UDP and parse/display telemetry fields successfully.

image

@xNuclearSquirrel
Copy link
Author

Oh and it works with GCS that support CRSF telemetry natively, such as MWPtools.
image

@osirisinferi
Copy link

Great work!

Patched this PR to my local master and flashed my Boxer backpack succesfully. And now it's broadcasting UDP packets nicely. 👍

Now I can use that for my next to develop Android app! Beats messing around with the MAVLink stuff, this looks way more easy to parse and use. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants