Ejemplo n.º 1
0
    info, error, input, CLIWaitCursor, download, abort, fatal
from drwatson import lpc11c00_can_bootloader as bootloader
from contextlib import closing

PRODUCT_NAME = 'com.zubax.opengrab_epm_v3'
SIGNATURE_OFFSET = 32768 - 128
FIRMWARE_URL = 'https://files.zubax.com/products/com.zubax.opengrab_epm_v3/firmware.bin'


args = init('''OpenGrab EPM v3 production testing application.
This application requires superuser priveleges to function correctly.
Usage instructions:
    1. Connect CAN adapter to this computer.
    2. Start this application and follow its instructions.''',
            lambda p: p.add_argument('--iface', help='CAN interface name, e.g. "can0"'),
            lambda p: p.add_argument('--firmware', '-f', help='location of the firmware file', default=FIRMWARE_URL),
            lambda p: p.add_argument('--only-sign', help='skip testing, only install signature',
                                     action='store_true'),
            lambda p: p.add_argument('--generate-signed-image-for',
                                     help='only generate signed image for the provided unique ID. '
                                     'The ID should be provided as 4 comma-separated integers'),
            require_root=True)

api = make_api_context_with_user_provided_credentials()


def generate_signed_image_for(comma_separated_uid_integers):
    import struct
    import os
    try:
        unique_id_integers = list(map(int, comma_separated_uid_integers.split(',')))
Ejemplo n.º 2
0
from contextlib import closing

PRODUCT_NAME = 'com.zubax.opengrab_epm_v3'
SIGNATURE_OFFSET = 32768 - 128
FIRMWARE_URL = 'https://files.zubax.com/products/com.zubax.opengrab_epm_v3/firmware.bin'

args = init(
    '''OpenGrab EPM v3 production testing application.
This application requires superuser priveleges to function correctly.
Usage instructions:
    1. Connect CAN adapter to this computer.
    2. Start this application and follow its instructions.''',
    lambda p: p.add_argument('--iface', help='CAN interface name, e.g. "can0"'
                             ),
    lambda p: p.add_argument('--firmware',
                             '-f',
                             help='location of the firmware file',
                             default=FIRMWARE_URL),
    lambda p: p.add_argument('--only-sign',
                             help='skip testing, only install signature',
                             action='store_true'),
    lambda p: p.add_argument(
        '--generate-signed-image-for',
        help='only generate signed image for the provided unique ID. '
        'The ID should be provided as 4 comma-separated integers'),
    require_root=True)

api = make_api_context_with_user_provided_credentials()


def generate_signed_image_for(comma_separated_uid_integers):
    import struct
Ejemplo n.º 3
0
END_OF_BOOT_LOG_TIMEOUT = 3

TEMPERATURE_RANGE_DEGC = 10, 80
ESC_ERROR_LIMIT = 1000
STARTUP_DUTY_CYCLE = 0.001
STABILITY_TEST_DUTY_CYCLES = [0.3, 0.6]


logger = logging.getLogger('main')
cli_logger = logging.getLogger('cli')


args = init('''Production testing application for ESC based on PX4 Sapog open source firmware.
If you're a licensed manufacturer, you should have received usage
instructions with the manufacturing doc pack.''',
            lambda p: p.add_argument('iface', help='CAN interface or device path, e.g. "can0", "/dev/ttyACM0", etc.'),
            lambda p: p.add_argument('--firmware', '-f', help='location of the firmware file (if not provided, ' +
                                     'the firmware will be downloaded from Zubax Robotics file server)'),
            require_root=True)

info('''
Usage instructions:

1. Connect a CAN adapter to this computer. Supported adapters are:
1.1. SLCAN-compliant adapters. If you're using an SLCAN adapter,
     use its serial port name as CAN interface name (e.g. "/dev/ttyACM0").
1.2. SocketCAN-compatible adapters. In this case it is recommended to use
     8devices USB2CAN. Correct interface name would be "can0".

2. Connect exactly one DroneCode Probe to this computer.
   For more info refer to https://kb.zubax.com/x/iIAh.
# GNSS constants are very pessimistic, because they largely depend on the environment where boards are tested.
GNSS_FIX_TIMEOUT = 60 * 10
GNSS_MIN_SAT_TIMEOUT = 60 * 15
GNSS_MIN_SAT_NUM = 6


logger = logging.getLogger("main")


args = init(
    """Zubax GNSS production testing application.
If you're a licensed manufacturer, you should have received usage
instructions with the manufacturing doc pack.""",
    lambda p: p.add_argument("iface", help='CAN interface or device path, e.g. "can0", "/dev/ttyACM0", etc.'),
    lambda p: p.add_argument(
        "--firmware",
        "-f",
        help="location of the firmware file (if not provided, "
        + "the firmware will be downloaded from Zubax Robotics file server)",
    ),
    require_root=True,
)

info(
    """
Usage instructions:

1. Connect a CAN adapter to this computer. Supported adapters are:
1.1. SLCAN-compliant adapters. If you're using an SLCAN adapter,
     use its serial port name as CAN interface name (e.g. "/dev/ttyACM0").
1.2. SocketCAN-compatible adapters. In this case it is recommended to use