Skip to content

Experimental CRWF Wi-Fi trainer input and CRSF telemetry - #249

Closed
RCSIM-Git wants to merge 1 commit into
ExpressLRS:masterfrom
RCSIM-Git:codex/crsf-wifi-trainer-bridge
Closed

RCSIM-Git wants to merge 1 commit into
ExpressLRS:masterfrom
RCSIM-Git:codex/crsf-wifi-trainer-bridge

Conversation

@RCSIM-Git

@RCSIM-Git RCSIM-Git commented Oct 9, 2026 •

Copy link
Copy Markdown

PC applications currently cannot send RC channel input to a TX Backpack over ordinary Wi-Fi UDP. This draft adds an opt-in CRWF v1 service on UDP 8888, forwarding validated packed CRSF channels through the existing MSP/EdgeTX trainer path and returning CRSF telemetry to the active client.

Behavior

  • Main ExpressLRS TX remains in Normal mode; receiver firmware and RF protocol are unchanged.
  • Dedicated ESP32-C3 build: ESP32C3_TX_Backpack_via_CRSF_WIFI. Ordinary targets keep this feature disabled.
  • Ingress accepts RC channels and session release only; arbitrary CRSF configuration passthrough is outside the scope.
  • Endpoint/session ownership, CRC and sequence checks, a 300 ms renewable lease, immediate headtracking-gate revocation and a bounded 16-token retired-session history.
  • Telemetry returns to the same UDP socket. Existing MAVLink and telemetry paths remain available.
  • Includes wire-format/setup documentation, a production-parser C++ test harness and an offline-by-default Python reference client.

Setup and compatibility

Requires ExpressLRS 4, EdgeTX 2.11+, HT Start Channel: EdgeTX, Master/CRSF, configured TR channel mixes and a physical local-control switch. Enable Backpack telemetry over Wi-Fi. The first build target is the ESP32-C3 TX Backpack used by RadioMaster Nomad; other hardware has not been validated.

Validation

  • Standard ESP32C3_TX_Backpack_via_UART and opt-in ESP32-C3 PlatformIO builds passed.
  • C++ production parser checks passed: decoding, CRC/length rejection, ownership, duplicate sequences, sequence/clock wrap, release, expiry and retired-token rejection.
  • Python reference-client offline checks passed; no control packets were sent to hardware.
  • A matching RCSIM adapter has been implemented and tested separately.

Review and hardware validation still required

This is an experimental bench draft.

Tokens are not cryptographic authentication. Retired history is bounded and reset on reboot; no sender timestamp proves packet generation age. Use trusted networks. After downstream link loss or headtracking disable/re-enable, the client must reconnect with a fresh session.

Seeking review of the protocol and trainer integration before broader hardware support or enabling this service by default.

@pkendall64

Copy link
Copy Markdown
Contributor

If this has not been tested then please don't open draft PRs! Keep it in a branch on you for till you have at least tested it.

@pkendall64 pkendall64 closed this Oct 9, 2026
@RCSIM-Git

RCSIM-Git commented Oct 9, 2026 •

Copy link
Copy Markdown
Author

@pkendall64 Understood, and apologies for opening Draft it slightly prematurely before the bench test!

The physical hardware validation on RadioMaster Nomad (ESP32-C3) + ER5C V2 was just completed and fully verified end-to-end (detailed in the comment and video).

Could you please reopen this PR for review, or would you prefer me to reopen it / handle it differently? Thank you!

https://www.tiktok.com/@rcsim_gcs/video/7694747812843588896

Hardware Bench Validation Update: Confirmed Working on ESP32-C3 (RadioMaster Nomad)

I have successfully tested and validated the experimental CRWF Wi-Fi trainer bridge on physical hardware.

Test Bench Setup:

  • Radio & OS: RadioMaster Pocket / MT12 running EdgeTX 2.11+
  • TX Module: RadioMaster Nomad (ESP32 main MCU + ESP32-C3 Backpack)
  • Firmware: Custom build with CRSF_WIFI_CONTROL_ENABLED (ESP32C3_TX_Backpack_via_CRSF_WIFI)
  • Receiver: RadioMaster ER5C V2 (PWM output to steering servo)
  • Client: RCSIM GCS sending CRWF UDP datagrams to port 8888 over Wi-Fi

Verification & Observations:

  1. End-to-End Control Pipeline:

    • Control chain verified: RCSIM (PC) → Wi-Fi UDP 8888 (CRWF v1 envelope) → ESP32-C3 Backpack → MSP Trainer Input → Main ELRS TX → EdgeTX Master/CRSF (TR1) → Mixer Replace → ELRS RF → ER5C V2 → Servo.
    • Latency and response were crisp and predictable; servo movement tracked PC input without noticeable jitter or drops.
  2. Initialization & Reboot Requirement:

    • Once configured in the ExpressLRS Lua script (Backpack: On, HT Enable: On, HT Start Channel: EdgeTX, and Telemetry: WiFi), a full power cycle / radio reboot was required for the main module to properly sync and bring up the ESP32-C3 Backpack in Wi-Fi telemetry service mode. After the reboot, the Backpack connected to the network and opened UDP 8888 as expected.
  3. Takeover & Safety:

    • Physical switch takeover in EdgeTX worked instantly — toggling the configured switch immediately yielded control back from PC (TR) to local radio gimbals/steering wheel.
    • Session handling and disconnection behaved cleanly without radio lockups or lingering PWM outputs.

The prototype is confirmed functional on physical ESP32-C3 hardware (RadioMaster Nomad).

@RCSIM-Git

Copy link
Copy Markdown
Author

Hardware Validation Update: ESP8285 (RadioMaster Pocket Internal ELRS)

In addition to the previous ESP32-C3 test on RadioMaster Nomad, I have now extended and validated support for ESP8285 (ESP8266) hardware, specifically the internal TX Backpack in the RadioMaster Pocket.

New Commits Added:

  1. Target environments for ESP8285:
    • ESP_TX_Backpack_via_CRSF_WIFI (for Web UI OTA update)
    • ESP_TX_Backpack_via_ETX_CRSF_WIFI (for EdgeTX USB Passthrough flashing)
  2. Wi-Fi Latency & Stability Fix (WiFi.setSleepMode(WIFI_NONE_SLEEP)):
    • By default, the ESP8266 core enters modem sleep between DTIM beacons, causing periodic 50–200ms latency spikes and dropped UDP packets on high-rate trainer streams.
    • Disabling modem sleep in both STA and AP modes keeps the receiver active, providing consistent, jitter-free packet reception.

Bench Verification on RadioMaster Pocket:

  • Radio: RadioMaster Pocket with internal 2.4 GHz ELRS TX (ESP8285 Backpack)

  • Radio OS: EdgeTX 2.12.4 in Master/CRSF trainer mode https://github.com/RCSIM-Git/edgetx
    feat(radio): support CRSF Trainer over USB-VCP- #7630

  • Flashed via: Web UI OTA (firmware.bin.gz)

  • Results:

    • Connected to home AP alongside the PC running the ground control application.
    • Successfully streaming 16 RC channels over UDP port 8888 (CRWF envelope) at 50Hz into EdgeTX trainer inputs (TR1–TR16).
    • EdgeTX mixer and local switch takeover confirmed working seamlessly.
    • Zero link dropouts after applying the WIFI_NONE_SLEEP fix.

Both ESP32-C3 and ESP8285 architectures have now been bench-tested and verified on physical hardware. Ready for reopening for review.

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.

3 participants