Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/DJI_RC-N1_SIMULATOR_FLY_DCL.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added DJI-RC-N1-Remote-Controller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 47 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,66 @@
mDjiController
DJI RC-N1
===============
- Connect your DJI Remote Controller to your PC and use it to play simulators.
- Currently confirmed working controllers: DJI Phantom 2
Discussion thread: coming soon...

Donate:

<img height="558" src="btc.jpg" width="400"/>

<img height="450" src="monoQR.jpg" width="400"/>

- https://send.monobank.ua/jar/87uNmHPh5v
- https://www.buymeacoffee.com/ivanyakymenko

-----------------------------------------------------------------------------
Latest version V3.0.0 (26.09.2023)
- critical fix, com port open error on some PC's
-----------------------------------------------------------------------------

- Connect your DJI Remote Controller to your PC and use it to play simulators
- Confirmed DJI Mavic 3 RC231
- For Mavic Mini or a Python interface, take a look at [justin97530/miniDjiController](https://github.com/justin97530/miniDjiController)
- For DJI Mini 2 or a Python interface, take a look at [usatenko/DjiMini2RCasJoystick](https://github.com/usatenko/DjiMini2RCasJoystick)
- For DJI Phantom 3 take a look at [mishavoloshchuk/mDjiController](https://github.com/mishavoloshchuk/mDjiController)
-----------------------------------------------------------------------------


This is a program that connects to your DJI Phantom Remote Controller (RC),
reads the stick positions and tells Windows that position. A simplified, wannabe driver.
This is a program that connects to your DJI Mavic 3 Remote Controller (RC-N1) as a XBox360 gamepad,
reads the stick positions and tells Windows that position.

In use:
![](https://raw.githubusercontent.com/Matsemann/mDjiController/master/in_use.png)

Here I'm flying a DJI Phantom in HELI-X5 using mDjiController. Open up the image in big version to see the controller configuration.
<img height="400" src="DJI-RC-N1-Remote-Controller.png" width="400"/>

-----------------------------------------------------------------------------
Installation / Usage
------------

### For a thorough guide on how to get started, see this blog post: [Using a Phantom 2 DJI Controller in AirSim](https://timebutt.github.io/static/using-a-phantom-dji-controller-in-airsim/)

### UPDATE: Slaterbbx has added more features to this, you should also check out his fork of this here: https://github.com/slaterbbx/mDjiController
- Install packages before usage:
- dji-assistant-2-consumer-drones-series and close it after installation https://www.dji.com/downloads/softwares/dji-assistant-2-consumer-drones-series
- python 3.9 or 3.x
- pip3 install vgamepad
- pip3 install pyserial

In order for it to work, the original drivers from DJI must be installed, and something called vJoy.
- Power on RC-N1
- Connect via bottom type-C
- run main.py
- run yor simulator

* Download mDjiController.zip from above ( https://github.com/Matsemann/mDjiController/blob/master/mDjiController.zip?raw=true )
* Download DJI WIN Driver Installer from here: http://www.dji.com/product/phantom-2/download
* Download vJoy from here: http://vjoystick.sourceforge.net/site/index.php/download-a-install/72-download
![](connect_ok.png)

* Install both.
* Then connect your RC to your computer via USB and turn it on.
for restart game or recover drone: use camera wheel, left scroll

* Run mDjiController.exe, and select the correct COM port. By default you should try writing "3".
* For vJoy, write 1 unless you use vJoy already and have different configurations.
![](control.png)

Then open a simulator and calibrate the controller.

How does it work?
-----------------
TROUBLESHOOTING
-----------------------------------------------------------------------------
App searching by itself for the serial port with description "DJI USB VCOM For Protocol"
make sure your device attached via bottom Type-C connector
![](connect.png)

* It is possible to ask the controller for its status when it's connected. So this program continuously
reads the status. It connects through COM. The output from the controller is just a list of numbers,
but sampling many enough such lists it's easy to see a pattern for which number means what. The biggest issue
was that the numbers are little endian encoded and uses two's complement, so it took some time to understand how
each number behaved.

* vJoy is a virtual joystick that can be installed on your computer. Windows think it's a normal joystick. mDjiController
takes the stick positions from the controller and tells Windows that this virtual joystick has the same positions.
[Tested with DCL - The game](https://store.steampowered.com/app/964570/DCL__The_Game/)

Preset:
Mode 2
Acro
Zero throttle at stick center

TROUBLESHOOTING
---------------
* If something doesn't work, make sure you have enabled logging, it may tell you the error.

* COM can't connect
Try with other numbers instead of 3. Open up device-manager.
You should see a category named "Ports (COM & LPT) and then a device named "DJI USB Virtual COM (COMX)"
The X should be the number you should use.
If there is nothing there, the driver from DJI is not installed correctly.

If you have any of the DJI Assistant Software installed, make sure they are not running, as this program
cannot connect then.

* vJoy can't connect
The error message should tell you if it's installed or not. Install the vJoy driver if it's not there.

* Not all sticks or buttons work
*If they look correct in the log:*
Your vJoy configuration may be wrong. Open "Configure vJoy" and reset configuration 1, or make a new one
and tell mDjiController.exe to use that configuration.
*If they are NOT correct in the log:*
Your controller sends in a different format, so you need to figure that out, edit the code and recompile.
(A bit advanced)


![](preset1.png)
![](preset2.png)
Binary file added btc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added connect_ok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added control.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed in_use.png
Binary file not shown.
76 changes: 0 additions & 76 deletions inc/vjoyinterface.h

This file was deleted.

Binary file removed lib/amd64/vJoyInterface.dll
Binary file not shown.
Binary file removed lib/amd64/vJoyInterface.lib
Binary file not shown.
Binary file removed lib/amd64/vJoyInterface.pdb
Binary file not shown.
Binary file removed lib/vJoyInterface.dll
Binary file not shown.
Binary file removed lib/vJoyInterface.lib
Binary file not shown.
Binary file removed lib/vJoyInterface.pdb
Binary file not shown.
Binary file removed mDjiController.zip
Binary file not shown.
Loading