miniDjiController icon indicating copy to clipboard operation
miniDjiController copied to clipboard

Also Works for Mavic 2 Pro remote controller but with Latency Issue

Open PanterSoft opened this issue 2 years ago • 14 comments

Hello I tried this with the mavic 2 Remote Control and the sticks also work as expected the only issue I am encounter is that over time when I am using the controller the Stick commands are more and more getting laggy

Does someone have the same issue and Knows how to fix this ?

PanterSoft avatar Sep 27 '23 12:09 PanterSoft

Did you comment out the print lines? So the lines 59 and 87.

Cause printing to console makes it really have a lot of latency.

Miniontoby avatar Oct 21 '23 11:10 Miniontoby

@Miniontoby

Yes I tried that and it only gave me a small improvement. but it still got worse over time

PanterSoft avatar Oct 21 '23 21:10 PanterSoft

If you look at the code that exists in IvanYaky/DJI_RC-N1_SIMULATOR_FLY_DCL -> main.py L191-192, then you will see this code:

    # enable simulator mode for RC (without this stick positions are sent very slow by RC)
    send_duml(s, 0x0a, 0x06, 0x40, 0x06, 0x24, bytearray.fromhex('01'))

This snippet actually uses a function to create a message, but it translates into 550e04660a06eb3440062401d9ec. This you can use in an:

s.write(bytearray.fromhex('550e04660a06eb3440062401d9ec'))

But where do I put that?

Put it, with 4 spaces in front, after line 53 as it is in main.py at the moment of writing.

resulting into:

(...)

try:
    # enable simulator mode for RC (without this stick positions are sent very slow by RC)
    s.write(bytearray.fromhex('550e04660a06eb3440062401d9ec'))
    while True:
        # Ping device (to get new data).

(...)

Of course, this has ONLY been tested for the RC-N1 and could be different for the Mavic 2 Pro controller.

If that would be the case, then you could (if you have the knowledge [or if we just do it together remotely]) just mitm/reverse-engineer it yourself, just like the others did to make this possible. [I have Discord if you want me to help]

Miniontoby avatar Oct 23 '23 14:10 Miniontoby

Hello @Miniontoby

I am not at home at the moment where my controller is.

I would love to reverse engineer it with your help as soon as I am at home and got my controller on hand. As I am pretty new to reverse Engineering I would need the help.

PanterSoft avatar Oct 23 '23 14:10 PanterSoft

First just try the code I supplied, if it doesn't work, let me know where I can find you. (Perhaps Discord or even IRC)

Miniontoby avatar Oct 24 '23 11:10 Miniontoby

А на Mavic Pro почему-то не работает, хотя очень надо!(

K177ok avatar Oct 25 '23 07:10 K177ok

Traceback (most recent call last): File "C:\Users\k177o\Desktop\DJI SIM\MiniDJIController\main.py", line 6, in import serial, pyvjoy, argparse ModuleNotFoundError: No module named 'serial'

K177ok avatar Oct 25 '23 07:10 K177ok

It seems like I've done something in python for the first time in my life. Remote control from Mavic PRO - works! But there is a big delay, which gets even worse with each click. I tried inserting the data suggested above, but it didn't help. It didn't work out to comment out either. I will be glad to help.

K177ok avatar Oct 25 '23 09:10 K177ok

Traceback (most recent call last): File "C:\Users\k177o\Desktop\DJI SIM\MiniDJIController\main.py", line 6, in import serial, pyvjoy, argparse ModuleNotFoundError: No module named 'serial'

You need to installl the deps first: pip install -r requirements.txt

Miniontoby avatar Oct 25 '23 12:10 Miniontoby

It seems like I've done something in python for the first time in my life. Remote control from Mavic PRO - works! But there is a big delay, which gets even worse with each click. I tried inserting the data suggested above, but it didn't help. It didn't work out to comment out either. I will be glad to help.

You should put an # before EVERY print code lines after the while line, this will reduce the lag (a little bit, it will still get more delay after a while)

Miniontoby avatar Oct 25 '23 12:10 Miniontoby

It seems like I've done something in python for the first time in my life. Remote control from Mavic PRO - works! But there is a big delay, which gets even worse with each click. I tried inserting the data suggested above, but it didn't help. It didn't work out to comment out either. I will be glad to help.

You should put an # before EVERY print code lines after the while line, this will reduce the lag (a little bit, it will still get more delay after a while)

Unfortunately, the latency after the first iteration grows with each click. Increases to 3-5 seconds :(

K177ok avatar Oct 27 '23 15:10 K177ok

yeah, I personally don't have the according controller for this, so I cannot try to fix it myself

Miniontoby avatar Oct 27 '23 15:10 Miniontoby

myself

Maybe we can try to do it together? For example, via AnyDesk? :)

K177ok avatar Oct 27 '23 15:10 K177ok

I would prefer Zoom or VNC Viewer. Those I already have installed and those I trust and those I know that work.

Miniontoby avatar Oct 27 '23 15:10 Miniontoby