Table of Contents

OGs Service Tool for Dji products

By mefisto and the OG's, Github here: https://github.com/o-gs/dji-firmware-tools/blob/master/comm_og_service_tool.py

The script allows to trigger a few service functions of Dji drones. It talks to the drone like comm_serialtalk.py, but provides easier interface for some important functions.

File Download: https://github.com/o-gs/dji-firmware-tools/raw/master/comm_og_service_tool.py

Java UI

Big thanks to Ace-Code1 for a UI for the app https://github.com/Ace-Code1/commOgServiceGUI

Example functions:

Example of listing Flight Controller Parameters 200-300 on Ph3 Pro to CSV format:

./comm_og_service_tool.py /dev/ttyUSB0 P3X FlycParam list --start=200 --count=100 --fmt=csv

Example of getting value of Flight Controller Parameters on Spark:

./comm_og_service_tool.py /dev/ttyUSB0 -vv SPARK FlycParam get g_config.flying_limit.max_height_0 --fmt=2line

Example of setting value of Flight Controller Parameters on Spark:

./comm_og_service_tool.py /dev/ttyUSB0 -vv SPARK FlycParam set g_config.flying_limit.max_height_0 500

Example of performing service “joint coarse” calibration of Spark gimbal:

./comm_og_service_tool.py /dev/ttyUSB0 -vv SPARK GimbalCalib JointCoarse

Example of performing service “linear hall” calibration of Spark gimbal, using Windows host:

python3 comm_og_service_tool.py COM23 -vv SPARK GimbalCalib LinearHall

Supported Aircraft

Types of commands

THis section is a WIP

SERVICE_CMD

  FlycParam = 0
  GimbalCalib = 1
  CameraCalib = 2

FLYC_PARAM_CMD

  LIST = 0
  GET = 1
  SET = 2

GIMBAL_CALIB_CMD

  JOINTCOARSE = 0
  LINEARHALL = 1

CAMERA_CALIB_CMD

  ENCRYPTCHECK = 0
  ENCRYPTPAIR = 1

CAMERA_ENCRYPT_PAIR_TARGET

  ALL = 0
  CAMERA = 1
  GIMBAL = 4
  LB_DM3XX_SKY = 8

Command line

usage: comm_og_Service_Tool.py [-h] [-b BAUDRATE] [-w TIMEOUT] [–dry-test]

                             [-v] [--version]
                             port product command ...

Needs cleaning up from code

    Its task is to parse command line options and call a function which performs serial communication.
  """
  parser = argparse.ArgumentParser(description=__doc__)
  parser.add_argument('port', type=str,
          help="the serial port to write to and read from")
  parser.add_argument('product', metavar='product', choices=[i.name for i in PRODUCT_CODE], type=parse_product_code,
          help="target product code name; one of: {:s}".format(','.join(i.name for i in PRODUCT_CODE)))
  parser.add_argument('-b', '--baudrate', default=9600, type=int,
          help="the baudrate to use for the serial port (default is %(default)s)")
  parser.add_argument('-w', '--timeout', default=500, type=int,
          help="how long to wait for answer, in miliseconds (default is %(default)s)")
  parser.add_argument('--dry-test', action='store_true',
          help="internal testing mode; do not use real serial interface and use template answers from the drone.")
  parser.add_argument('-v', '--verbose', action='count', default=0,
          help="increases verbosity level; max level is set by -vvv")
  parser.add_argument('--version', action='version', version="%(prog)s {version} by {author}"
            .format(version=__version__,author=__author__),
          help="display version information and exit")