Skip to content

mavsdk-python Param.select_component() returns UNKNOWN for non-autopilot components (e.g. component 51,123,124) #818

Open

Description

@VamsiTungala

Summary

Param.select_component() exists in mavsdk-python and is documented, but on my setup it returns ParamError: UNKNOWN when selecting non-autopilot components (for example component 51), even though those components are discovered by mavsdk_server.

This prevents using the MAVSDK Param plugin to upload params to components from a .params file (e.g. CAN/UAVCAN peripherals).

Environment

  • MAVSDK server version: v3.15.0 (from logs)
  • mavsdk-python: 3.15.3 (pip install)
  • OS: Linux (Ubuntu, Python 3.10)

What I’m trying to do

Use the MAVSDK Param plugin with:

  • select_component(component_id, ProtocolVersion.V1) or ProtocolVersion.EXT
  • set_param_int/float/custom(...)

to upload parameters to components listed in a PX4 .params file (component IDs like 51, 123, 124 - UAVCAN Devices).

Python Script

#!/usr/bin/env python3
import asyncio
from mavsdk import System
from mavsdk.param import ProtocolVersion
import logging
logging.basicConfig(level=logging.DEBUG)
async def wait_for_connection(drone: System):
    async for state in drone.core.connection_state():
        if state.is_connected:
            return
async def main():
    drone = System()
    await drone.connect(system_address="udpin://0.0.0.0:14550")
    await wait_for_connection(drone)
    print("Connected")
    try:
        await drone.param.select_component(51, ProtocolVersion.V1)
        print("Selected component 51 (V1)")
    except Exception as exc:
        print(f"select_component failed: {exc}")
        pass
    await drone.param.set_param_int("CELL_EMPTY_VOLTA", 3600)
    print("Set CELL_EMPTY_VOLTA = 3600 on component 51")

if __name__ == "__main__":
    asyncio.run(main()) 

Terminal Log

DEBUG:asyncio:Using selector: EpollSelector
DEBUG:grpc._cython.cygrpc:[_cygrpc] Loaded running loop: id(loop)=139374995289184
DEBUG:grpc._cython.cygrpc:Using AsyncIOEngine.POLLER as I/O engine
DEBUG:grpc._cython.cygrpc:[_cygrpc] Loaded running loop: id(loop)=139374995289184
DEBUG:mavsdk.async_plugin_manager:Waiting for mavsdk_server to be ready...
INFO:mavsdk_server:MAVSDK version: v3.15.0 (mavsdk_impl.cpp:33)
INFO:mavsdk_server:Waiting to discover system on udpin://0.0.0.0:14550... (connection_initiator.h:20)
INFO:mavsdk_server:New system on: 10.41.1.1:45177 (system ID: 1) (udp_connection.cpp:263)
DEBUG:mavsdk_server:Component Autopilot (component ID: 1) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 192) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Discovered 2 components (system_impl.cpp:616)
INFO:mavsdk_server:System discovered (connection_initiator.h:62)
INFO:mavsdk_server:Server started (grpc_server.cpp:177)
INFO:mavsdk_server:Server set to listen on 0.0.0.0:50051 (grpc_server.cpp:178)
DEBUG:mavsdk_server:MAVLink: critical: Preflight: GPS Speed Accuracy too low (system_impl.cpp:358)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 155) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 236) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:MAVLink: critical: Preflight Fail: Compass 0 uncalibrated (system_impl.cpp:358)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 40) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:MAVLink: critical: Preflight Fail: Compass 1 uncalibrated (system_impl.cpp:358)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 198) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 97) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Companion Computer (component ID: 191) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:MAVLink: critical: Preflight Fail: Press safety button first (system_impl.cpp:358)
DEBUG:mavsdk_server:MAVLink: emergency: Battery 1: over voltage.         (system_impl.cpp:358)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 51) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 60) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 195) added. (system_impl.cpp:496)
DEBUG:mavsdk_server:Component Unsupported component (component ID: 63) added. (system_impl.cpp:496)
DEBUG:mavsdk.async_plugin_manager:Connected to mavsdk_server!
DEBUG:grpc._cython.cygrpc:[_cygrpc] Loaded running loop: id(loop)=139374995289184
Connected
DEBUG:grpc._cython.cygrpc:[_cygrpc] Loaded running loop: id(loop)=139374995289184
select_component failed: UNKNOWN: 'Unknown'; origin: select_component(); params: (51, <ProtocolVersion.V1: 0>)
DEBUG:grpc._cython.cygrpc:[_cygrpc] Loaded running loop: id(loop)=139374995289184
WARNING:mavsdk_server:Got ill-formed param_value message (param_id empty) (mavlink_parameter_client.cpp:661)
WARNING:mavsdk_server:sending again, retries to do: 5  (CELL_EMPTY_VOLTA). (mavlink_parameter_client.cpp:1163)
WARNING:mavsdk_server:Got ill-formed param_value message (param_id empty) (mavlink_parameter_client.cpp:661)
WARNING:mavsdk_server:sending again, retries to do: 4  (CELL_EMPTY_VOLTA). (mavlink_parameter_client.cpp:1163)
WARNING:mavsdk_server:Got ill-formed param_value message (param_id empty) (mavlink_parameter_client.cpp:661)
DEBUG:mavsdk_server:MAVLink: critical: Preflight Fail: Compass 0 uncalibrated (system_impl.cpp:358)
DEBUG:mavsdk_server:MAVLink: critical: Preflight Fail: Compass 1 uncalibrated (system_impl.cpp:358)
DEBUG:mavsdk_server:MAVLink: critical: Preflight Fail: Press safety button first (system_impl.cpp:358)
DEBUG:mavsdk_server:MAVLink: emergency: Battery 1: over voltage.         (system_impl.cpp:358)
WARNING:mavsdk_server:sending again, retries to do: 3  (CELL_EMPTY_VOLTA). (mavlink_parameter_client.cpp:1163)
WARNING:mavsdk_server:Got ill-formed param_value message (param_id empty) (mavlink_parameter_client.cpp:661)
WARNING:mavsdk_server:sending again, retries to do: 2  (CELL_EMPTY_VOLTA). (mavlink_parameter_client.cpp:1163)
WARNING:mavsdk_server:Got ill-formed param_value message (param_id empty) (mavlink_parameter_client.cpp:661)
WARNING:mavsdk_server:sending again, retries to do: 1  (CELL_EMPTY_VOLTA). (mavlink_parameter_client.cpp:1163)
WARNING:mavsdk_server:Got ill-formed param_value message (param_id empty) (mavlink_parameter_client.cpp:661)
ERROR:mavsdk_server:Error: Retrying failed set param timeout: CELL_EMPTY_VOLTA (mavlink_parameter_client.cpp:1183)
Traceback (most recent call last):
  File "minimum_upload.py", line 31, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "minimum_upload.py", line 27, in main
    await drone.param.set_param_int("CELL_EMPTY_VOLTA", 3600)
  File "/home/user/.local/lib/python3.10/site-packages/mavsdk/param.py", line 585, in set_param_int
    raise ParamError(result, "set_param_int()", name, value)
mavsdk.param.ParamError: TIMEOUT: 'Timeout'; origin: set_param_int(); params: ('CELL_EMPTY_VOLTA', 3600)

Having similar error to get parameters of perticular component. get_all_params() is not downloading other component parameters (my case 51,123,124 - UAVCAN Components)

Activity

  1. julianoes commented on Feb 25, 2026

    @julianoes
    Collaborator

    Does it have the same system ID and component ID 51?

  2. VamsiTungala commented on Feb 25, 2026

    @VamsiTungala
    Author

    I dont know exactly where i can find system id for uavcan devices.
    but when i checked wireshark i see heartbeat message from 51 component it shows sys id 1.

    Image

    I dont see any messages for other two UAVCAN devices one is RM3100(123) and other is ARK RTK GPS (124).

    UAVCAN STATUS

    nsh> uavcan status
    Pool allocator status:
        Capacity hard/soft: 500/250 blocks
        Reserved:  42 blocks
        Allocated: 28 blocks
    
    UAVCAN node status:
        Internal failures: 0
        Transfer errors:   7
        RX transfers:      335117
        TX transfers:      63906
    
    CAN1 status:
        HW errors: 0
        IO errors: 0
        RX frames: 141194
        TX frames: 72838
    CAN2 status:
        HW errors: 33
        IO errors: 33
        RX frames: 1047536
        TX frames: 72838
    
    ESC outputs:
    INFO  [mixer_module] Param prefix: UAVCAN_EC
    control latency: 0 events, 0us elapsed, 0.00us avg, min 0us max 0us 0.000us rms
    Channel Configuration:
    Channel 0: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 1: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 2: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 3: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 4: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 5: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 6: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Channel 7: func:   0, value: 0, failsafe: 65535, disarmed: 65535, min: 1, max: 8191
    Servo outputs:
    INFO  [mixer_module] Param prefix: UAVCAN_SV
    control latency: 0 events, 0us elapsed, 0.00us avg, min 0us max 0us 0.000us rms
    Channel Configuration:
    Channel 0: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 1: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 2: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 3: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 4: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 5: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 6: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    Channel 7: func:   0, value: 500, failsafe: 500, disarmed: 500, min: 0, max: 1000
    
    Sensor 'gnss':
    name: uavcan_gnss
    channel 0: node id 124 --> instance 0
    
    Sensor 'gnss_relative':
    name: uavcan_gnss_relative
    
    Sensor 'mag':
    name: uavcan_mag
    channel 0: node id 123 --> instance 1
    channel 1: node id 124 --> instance 2
    
    Online nodes (Node ID, Health, Mode):
         51 OK         OPERAT    
         123 OK         OPERAT    
         124 OK         OPERAT    
    
    uavcan: cycle time: 2328010 events, 208948918us elapsed, 89.75us avg, min 13us max 24831us 244.067us rms
    uavcan: cycle interval: 2328010 events, 1945.58us avg, min 20us max 151294us 1368.995us rms 
  3. julianoes commented on Feb 27, 2026

    @julianoes
    Collaborator

    Oh, so this is a parameter of a uavcan component. I don't think that's hooked up yet. It would be nice indeed if it was.

  4. VamsiTungala commented on Mar 4, 2026

    @VamsiTungala
    Author

    I remember testing with MAVSDK 2.2, in that i was able to get/set parameters with component ID's.
    I will recheck that over this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions