Skip to content

Repository files navigation

RC N1 Bridge

RC N1 Bridge turns a DJI RC-N1 remote into a low-latency virtual Xbox 360 controller for Windows drone simulators and other games.

The application is a clean-room implementation built around the public facts of DJI's USB serial protocol. It does not pretend to be a DJI FPV controller. It creates a normal XInput device, which is the broadly compatible path for games such as Liftoff, Uncrashed, DRL, DCL, Zephyr, and similar simulators.

What is improved

  • One poll is sent at a time; each validated reply is mapped immediately.
  • No busy-spin output thread and no fixed 100 ms/10 Hz delay.
  • Both DUML header CRC and full packet CRC are checked before controls are used.
  • Serial reads time out, disconnects are neutralized, and the bridge reconnects.
  • A short 40 ms retry timeout tolerates the RC-N1's occasional dropped reply pairs without emitting a momentary centered report; sustained loss still neutralizes and reconnects promptly.
  • Port detection is layered rather than tied to one product ID or exact name. Known For Protocol interfaces rank first, DJI USB identity is only a hint, changed-name devices can be protocol-probed, and For Debug is excluded.
  • Inputs are clamped and support calibration, asymmetric ranges, dead zones, expo, per-axis inversion, optional smoothing, and configurable button output.
  • Fn, record, photo/shutter, return-to-home, the Cine/Normal/Sport switch, and both camera-wheel directions can each be mapped to an Xbox button or disabled.
  • Optional anti-deadzone compensation remaps nonzero stick travel above a game's unavoidable inner deadzone while preserving proportional full range.
  • Dependencies are small and pinned. There is no telemetry, networking, persistence service, shell execution, or background updater.
  • A diagnostics mode can validate the controller without creating a virtual pad.

Requirements

  • Windows 10 or 11, 64-bit
  • Python 3.10 or newer (the one-click installer can install Python 3.12 with Windows Package Manager when Python is missing)
  • DJI's USB VCOM driver, normally installed by DJI Assistant 2 (Consumer Drones Series)
  • ViGEmBus for Xbox-controller emulation

ViGEmBus is retired upstream but remains the backend used by vgamepad. Installing vgamepad launches its bundled ViGEmBus installer. Review the driver prompt and accept it only if you are comfortable installing that kernel driver.

Easy installation and startup

  1. Double-click install dependencies.bat.
  2. Allow it to create the local Python environment and install the locked bridge dependencies. If Python is missing, it offers Python 3.12 through Windows Package Manager.
  3. Complete any visible ViGEmBus driver prompt. Windows requires you to approve this virtual-gamepad driver installation manually.
  4. The script downloads DJI Assistant 2 (Consumer Drones Series) from DJI's official CDN, verifies its DJI digital signature, and launches it. Approve the Windows installer prompt and finish that installation manually; it supplies the USB VCOM driver used by the RC-N1.
  5. Close DJI Assistant completely after installation because it can hold the controller's COM port.
  6. Connect the powered-on RC-N1 through the bottom USB-C port between the stick storage slots.
  7. Double-click run.bat to open RC N1 Bridge.

The downloaded DJI installer is cached under %TEMP%\RCN1Bridge; rerunning the dependency installer reuses it only when its Windows signature is still valid.

Manual PowerShell setup

Advanced users can install only the local bridge dependencies with:

.\scripts\setup.ps1

They can then start the desktop interface with run.bat or:

.\scripts\run.ps1

Command line

Use the command wrapper from the project folder:

# See how serial ports are ranked. This does not transmit anything.
.\scripts\rcn1.ps1 scan

# Safely validate input for 10 seconds without creating an Xbox controller.
.\scripts\rcn1.ps1 diagnose --seconds 10

# Force a port when automatic detection cannot recognize a changed name.
.\scripts\rcn1.ps1 diagnose --port COM5 --seconds 10

# Run without the GUI.
.\scripts\rcn1.ps1 run

# Capture center and endpoint calibration.
.\scripts\rcn1.ps1 calibrate

Use scan --probe to send a short, CRC-validated read request to ranked candidates. Unknown serial devices are never probed unless you explicitly add --include-unknown; an explicit --port is the safer compatibility escape hatch.

Game setup

  1. Start RC N1 Bridge and wait for the green Connected status.
  2. Open Windows' game-controller panel (joy.cpl) if you want to verify the virtual Xbox device first.
  3. Open the simulator's controller settings.
  4. Select the Xbox 360 controller and run the simulator's axis calibration.
  5. Bind physical left horizontal/vertical and right horizontal/vertical as the simulator requests. If a direction is reversed, open Control mappings and toggle that axis's Invert option.

All axes now use their direct direction by default. Older version-1 settings are migrated away from the original inverted vertical defaults. Axis inversion stays individually configurable because simulators disagree about axis orientation.

Camera-wheel and physical-button outputs default to Disabled, preventing an unwanted menu action before you intentionally bind them. Open Control mappings to assign any input to A/B/X/Y, shoulder buttons, stick clicks, Start/Back, or a D-pad direction. The same Xbox button may be assigned to more than one RC input safely.

If a game ignores the first part of Xbox stick travel and offers no deadzone setting, enable Anti-deadzone under Input tuning. Start with 0.25; use 0.26 if the game still ignores the boundary. Zero remains exactly centered, while every nonzero stick value is remapped smoothly from that minimum output to full scale. The setting applies to both sticks, not the camera wheel, and is disabled by default because games without a forced deadzone do not need it. If the controller jitters by a count around center, pair anti-deadzone with a small bridge dead zone such as 0.01 or 0.02 so that noise does not jump to the minimum output.

The RC-N1 throttle stick springs to center, unlike a typical FPV radio. Most simulators can still calibrate it, but the feel will differ from a non-centering FPV throttle gimbal.

Configuration

The GUI writes %APPDATA%\RCN1Bridge\config.json. Generate defaults without opening the GUI with:

.\scripts\rcn1.ps1 init-config

Useful settings include:

  • port: null for automatic detection or a value such as "COM5"
  • probe_unknown_ports: permit protocol probing of unrecognized serial devices
  • smoothing: 0.0 for minimum latency; modest values such as 0.1 reduce noise
  • suppress_duplicate_reports: avoids redundant XInput reports while sticks are still
  • camera_button_threshold: wheel travel required before its mapped button is pressed
  • button_poll_interval: number of stick packets between extended-button reads
  • response_timeout_seconds: per-poll retry timeout; 0.04 is hardware-tested
  • anti_deadzone_enabled: enables minimum-output compensation for both sticks
  • anti_deadzone: minimum nonzero output, usually 0.25 or 0.26
  • *_button settings: Xbox binding name, or "NONE" to disable that input
  • per-axis minimum, center, maximum, invert, deadzone, and expo

Safety and privacy

During normal operation, RC N1 Bridge talks only to the selected local serial port and the local virtual gamepad driver; the bridge performs no network requests. The separate dependency installer uses HTTPS to obtain Python packages and the official DJI installer. On sustained input loss or disconnect, the running bridge sends a neutral virtual-controller report, retries after a bounded delay, and releases all mapped buttons during shutdown. Firmware that does not answer the optional extended-button command automatically falls back to axes-only operation for that connection.

The project is unofficial. Use it at your own risk, close it before running DJI Assistant, and never use it as part of real-aircraft control.

Development

The test suite uses generated DUML packets and a fake serial device, so it does not require hardware or ViGEmBus:

$env:PYTHONPATH = "src"
python -m unittest discover -s tests -v

See ATTRIBUTION.md for the protocol-research references. The new implementation is licensed under the MIT License.

Releases

Packages

Contributors

Languages