Linux joystick driver for DJI RC smart controllers. Connects to the controller over WiFi and exposes it as a standard virtual joystick via uinput.
Confirmed working:
- DJI RC (RM330)
Likely compatible (same Android/DUML platform — untested):
- DJI RC 2
- DJI RC Pro (RM510)
- DJI Smart Controller (RM500)
- DJI RC Pro Enterprise
If you test with a different model, please open an issue to let us know!
- Auto-discovers the RC on your local network (no IP needed)
- 4 stick axes, 2 back wheel axes, 6 buttons, flight mode switch
- Persistent TCP connection with DUML keepalive (~9 Hz update rate)
- Works with any game, simulator, or application that supports joysticks
- Single C file, minimal dependencies
| Input | Joystick Axis/Button |
|---|---|
| Left stick horizontal | ABS_X |
| Left stick vertical | ABS_Y |
| Right stick horizontal | ABS_RX |
| Right stick vertical | ABS_RY |
| Left back wheel | ABS_Z |
| Right back wheel | ABS_RZ |
| Flight mode (S/N/C) | ABS_MISC (0/1/2) |
| RTH / Flight Pause | Button 0 |
| Record | Button 1 |
| Camera (half-press) | Button 2 |
| Camera (full-press) | Button 3 |
| C1 (left back) | Button 4 |
| C2 (right back) | Button 5 |
- libncurses-dev — for the
--visualmode
# Debian/Ubuntu
sudo apt install libncurses-dev
# Fedora/RHEL
sudo dnf install ncurses-devel
# Arch
sudo pacman -S ncursesmkdir build && cd build
cmake ..
cmake --build .Make sure the RC is powered on and connected to the same WiFi network as your computer.
# Auto-detect the RC and create a virtual joystick
sudo ./dji-rc-joystick
# Specify the IP manually
sudo ./dji-rc-joystick 192.168.7.251
# Visual mode — ncurses controller display
sudo ./dji-rc-joystick -V
# Debug mode — print live values
sudo ./dji-rc-joystick -d
# Test mode — print values without creating a joystick
sudo ./dji-rc-joystick -t
# Raw mode — show all channel values (for debugging)
sudo ./dji-rc-joystick -RRoot (or uinput permissions) is required to create the virtual joystick device.
-p, --port PORT TCP port [default: 40007]
-d, --debug Print live axis values
-t, --test Test mode: print values without creating joystick
-R, --raw Raw mode: show ALL channel values
-V, --visual Visual mode: ncurses controller display
-h, --help Show this help
The DJI RC smart controllers run Android internally and expose an undocumented TCP service on port 40007. When a client connects, the controller streams DJI DUML protocol packets containing real-time RC channel data (stick positions, wheel positions, and button states).
This driver:
- Discovers the RC by scanning the local network for port 40007 + DUML protocol magic bytes
- Maintains a persistent TCP connection, sending periodic DUML keepalive commands to sustain data flow
- Parses DUML packets (cmd_set=0x06, cmd_id=0xAE) to extract signed 16-bit channel values
- Decodes the byte-interleaved axis encoding into proper stick/wheel positions
- Maps everything to a virtual joystick created via Linux uinput
If you test this with a different DJI RC model, please open an issue with your results — even if it doesn't work. Bug reports and pull requests are welcome.
If you find this useful, a star helps others discover the project.
MIT — see LICENSE.
