DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

FIX Incompatible Gimball Error 40021 on Mavics (02-2020)

Joined
Feb 9, 2021
Messages
12
Reactions
35
Age
69
Location
France
Hello everyone

After changing the Gimball on Mavic mini1 and Power ON, the Gimbal is not in the correct position with DJI Fly screen messages:
Incompatible gimbal data
Incompatible IMU gimbal
IMU Error Code: 40021

FIX with WIN 10:
INSTALL ASSISTANT 2
Assistant 2

OTHER REQUIREMENTS:
PYTHON WIN 10
PYTHON
PYSERIAL
pyserial-3.5.tar
DJI TOOLS
DJI TOOLS

Create a DJI folder in C:
Put all these files that you have downloaded in this DJI folder

NOW:
The hard thing is to find the SERIAL PORT COM
Launch Device Manager, leave it open
The COM port does not appear at the moment

Turn on the Mavic mini
Connect it to the USB port

The SERIAL PORT COM will come for 15 secondes and will disappear from Device Manager

So, as soon as it appears in Device Manager
Launch Assistant 2
The Mavic mini will appear in Assistant 2
It will use automatically the good number of SERIAL PORT COM
(you can change the firmware if you want)

The COM port will be filled in and will remain present in Device Manager
Note this COM number (for me it is the COM4)

Close Assistant 2 (because it uses the PORT COM)

Open the Terminal Command Line under Administrator

Type these command lines:
CD..
CD..
cd \ DJI

py setup.py install

----
Prepare your two lines (with port number and model, for me Mavic mini WM160 and COM4, below are the other codes)
py comm_og_service_tool.py ComX MODEL ...
-----

Type your command lines one by one watching the gimbal and the waiting messages

py comm_og_service_tool.py Com4 WM160 GimbalCalib JointCoarse

py comm_og_service_tool.py Com4 WM160 GimbalCalib LinearHall

When it lights up the Gimbal is in the correct position
The Mavic will now be fixed


I think this will help to understand how the SERIAL PORT works on a USB connection.
There is no reason to criticize DJI for their software.
It can be said that there is a lack of explanation, as follows
thanks to the GitHub community and Python

Follow me on Instagram et YouTube

ENJOY
-----------------------------------------------------------------------
For others Models change WM160 with
WWM610 = Inspire 1
P3X = Phantom 3 Professional
P3S = Phantom 3 Advanced
MAT100 = Matrice 100
P3C = Phantom 3 Standard
MG1 = Agras MG-1
WM325 = Phantom 3 4K
WM330 = Phantom 4 (now referenced as Phantom 4 Standard)
MAT600 = Matrice 600
WM220 = Mavic Pro/Platinum
WM620 = Inspire 2
WM331 = Phantom 4 Pro
MAT200 = Matrice 200
MG1S = Agras MG-1S
WM332 = Phantom 4 Advanced
WM100 = Spark
WM230 = Mavic Air
WM335 = Phantom 4 Pro V2
WM240 = Mavic 2 Pro/Zoom
WM245 = Mavic 2 Enterprise
WM246 = Mavic 2 Enterprise Dual
WM160 = Mavic Mini
WM231 = Mavic Air 2
reference DroningON
 
Last edited:
I think it should work on all Windows version.
(I used Win 10 (32bits) that I had on an old PC laptop)

Dji Assistant 2 doesn't specify a version
Python neither
So use my guide without worrying about the versions
Tell your result here because a lot of people are struggling.
Good luck to you
 
Has anyone seen a fix for the 40021 and 40011 errors after changing the gimbal on the mavic mini? Linearhall and jointcoarse was a great find. But this error is brutal!
Thanks,
B
 
  • Like
Reactions: b1xn00d
Salut Patrick, Impossible de faire fonctionner ton tuto :(
Lorsque je lance "py setup.py install" j'ai le droit à :
C: \ DJI \ python.exe: impossible d'ouvrir le fichier 'C: \ DJI \ setup.py': [Errno 2] Aucun fichier ou répertoire de ce type

Ton poste est super mais c'est dommage qu'il ne soit pas plus détaillé vers le début. Néanmoins c'est déjà super d'avoir partagé ca avec nous :)

Help me Patrick ! :)
 
Notes to running the Python script:
WinRar is needed to unpack the .gz file. Then unzip the file thats in there.
The words LinearHall & JointCourse must be spelled EXACTLY like I just typed. Capital L,H, J & C.
Heres a video
 

Attachments

  • Files in directory.JPG
    Files in directory.JPG
    125.4 KB · Views: 52
  • Mudule not found.JPG
    Mudule not found.JPG
    20 KB · Views: 54
Last edited:
Thanks for that info Patrick. I was missing the part with DJI Assistant 2. I did that and the COM port really stay in the device manager. Unfortunately, it didn't help me, I still have an error when I run th py command.

C:\dji>py comm_og_service_tool.py com7 'WM160' GimbalCalib JointCoarse
usage: comm_og_service_tool.py [-h] (--port PORT | --bulk) [-b BAUDRATE] [-w TIMEOUT] [--dry-test] [-v] [--version]
product command ...
comm_og_service_tool.py: error: argument product: invalid choice: 'COM7' (choose from 'A2', 'P330', 'P330V', 'P330Z', 'P330VP', 'WM610', 'P3X', 'P3S', 'MAT100', 'P3C', 'MG1', 'WM325', 'WM330', 'MAT600', 'WM220', 'WM620', 'WM331', 'MAT200', 'MG1S', 'WM332', 'WM100', 'WM230', 'WM335', 'WM240', 'WM245', 'WM246', 'WM160', 'WM231', 'WM232', 'WM260')

1642443355086.png

Any idea?
 


Stou

il y a 0 seconde
I found the problem with the command. Probably because of an update in the tools, the command structure as changed. It worked for my DJI Mini with those commands:
py comm_og_service_tool.py --port COM2 -vv WM160 GimbalCalib JointCoarse
py comm_og_service_tool.py --port COM2 -vv WM160 GimbalCalib LinearHall.

But unfortunately it didn't removed those 180016, 180030 and 180031 errors I have :-(
 

Stou

il y a 0 seconde
I found the problem with the command. Probably because of an update in the tools, the command structure as changed. It worked for my DJI Mini with those commands:
py comm_og_service_tool.py --port COM2 -vv WM160 GimbalCalib JointCoarse
py comm_og_service_tool.py --port COM2 -vv WM160 GimbalCalib LinearHall.

But unfortunately it didn't removed those 180016, 180030 and 180031 errors I have :-(
I tried your commands on my dji mini 2 I get error argument product invalid choice
 
Maybe that depend on the "comm_og_service_tool.py" version. I looked in the py file and mine is version 0.0.7.... kind of strange, James Bond version lol.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

""" OGs Service Tool for Dji products.

The script allows to trigger a few service functions of Dji drones.
"""

# Copyright (C) 2018 Mefistotelis <[email protected]>
# Copyright (C) 2018 Original Gangsters <Slack>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <Licenses - GNU Project - Free Software Foundation>.

__version__ = "0.0.7"
__author__ = "Mefistotelis @ Original Gangsters"
__license__ = "GPL"
 
  • Like
Reactions: takeshi
Hello everyone

After changing the Gimball on Mavic mini1 and Power ON, the Gimbal is not in the correct position with DJI Fly screen messages:
Incompatible gimbal data
Incompatible IMU gimbal
IMU Error Code: 40021

FIX with WIN 10:
INSTALL ASSISTANT 2
Assistant 2

OTHER REQUIREMENTS:
PYTHON WIN 10
PYTHON
PYSERIAL
pyserial-3.5.tar
DJI TOOLS
DJI TOOLS

Create a DJI folder in C:
Put all these files that you have downloaded in this DJI folder

NOW:
The hard thing is to find the SERIAL PORT COM
Launch Device Manager, leave it open
The COM port does not appear at the moment

Turn on the Mavic mini
Connect it to the USB port

The SERIAL PORT COM will come for 15 secondes and will disappear from Device Manager

So, as soon as it appears in Device Manager
Launch Assistant 2
The Mavic mini will appear in Assistant 2
It will use automatically the good number of SERIAL PORT COM
(you can change the firmware if you want)

The COM port will be filled in and will remain present in Device Manager
Note this COM number (for me it is the COM4)

Close Assistant 2 (because it uses the PORT COM)

Open the Terminal Command Line under Administrator

Type these command lines:
CD..
CD..
cd \ DJI

py setup.py install

----
Prepare your two lines (with port number and model, for me Mavic mini WM160 and COM4, below are the other codes)
py comm_og_service_tool.py ComX MODEL ...
-----

Type your command lines one by one watching the gimbal and the waiting messages

py comm_og_service_tool.py Com4 WM160 GimbalCalib JointCoarse

py comm_og_service_tool.py Com4 WM160 GimbalCalib LinearHall

When it lights up the Gimbal is in the correct position
The Mavic will now be fixed


I think this will help to understand how the SERIAL PORT works on a USB connection.
There is no reason to criticize DJI for their software.
It can be said that there is a lack of explanation, as follows
thanks to the GitHub community and Python

Follow me on Instagram et YouTube

ENJOY
-----------------------------------------------------------------------
For others Models change WM160 with
WWM610 = Inspire 1
P3X = Phantom 3 Professional
P3S = Phantom 3 Advanced
MAT100 = Matrice 100
P3C = Phantom 3 Standard
MG1 = Agras MG-1
WM325 = Phantom 3 4K
WM330 = Phantom 4 (now referenced as Phantom 4 Standard)
MAT600 = Matrice 600
WM220 = Mavic Pro/Platinum
WM620 = Inspire 2
WM331 = Phantom 4 Pro
MAT200 = Matrice 200
MG1S = Agras MG-1S
WM332 = Phantom 4 Advanced
WM100 = Spark
WM230 = Mavic Air
WM335 = Phantom 4 Pro V2
WM240 = Mavic 2 Pro/Zoom
WM245 = Mavic 2 Enterprise
WM246 = Mavic 2 Enterprise Dual
WM160 = Mavic Mini
WM231 = Mavic Air 2
reference DroningON
I have a mini 2. Followed your instructions perfectly many times. I still have had zero luck. After entering joint coarse and linear hall it shoots back an error message everytime saying com5 was wrong and that I needed a [-h]--port PORT -b baudrate as well as a couple other ones also it needed to be one of the product numbers e.g WM160 in the com5 spot?? I'm very confused. Any advise or guidance would be much appreciated.
 
I think it should work on all Windows version.
(I used Win 10 (32bits) that I had on an old PC laptop)

Dji Assistant 2 doesn't specify a version
Python neither
So use my guide without worrying about the versions
Tell your result here because a lot of people are struggling.
Good luck to you
I ran everything through and got the normal error message after jointcoarse and linearhall. Alit of posts I have read state that their gimbals worked after that but they still received the errors. After I ran the script my gimbal was still a little to the right and I still can't move it at all. Help?
 
I ran everything through and got the normal error message after jointcoarse and linearhall. Alit of posts I have read state that their gimbals worked after that but they still received the errors. After I ran the script my gimbal was still a little to the right and I still can't move it at all. Help?
I can help you with this. First, are you using a laptop?
 
Lycus Tech Mavic Air 3 Case

DJI Drone Deals

New Threads

Forum statistics

Threads
131,139
Messages
1,560,284
Members
160,109
Latest member
brokerman