SDKPython SDK

Device discovery & connection

Discover serial candidates, choose automatic or explicit ports, and select named Exo devices.

Current version · 1.0.0

Device discovery & connection

Discover devices

from qnbot_sdk.exo import discover_exos

for candidate in discover_exos():
    if candidate.error:
        print(candidate.port, candidate.error.code, candidate.error.message)
    else:
        print(candidate.port, candidate.device_info.product)

Each DiscoveredExo contains either device_info or error. Error codes are PORT_OPEN, PROTOCOL_ERROR, and INCOMPATIBLE.

Automatic and explicit selection

from qnbot_sdk import Sdk, SerialConnection
from qnbot_sdk.exo import ExoConfig

automatic = ExoConfig()
fixed = ExoConfig(
    name="primary-exo",
    connection=SerialConnection(port="/dev/ttyUSB0"),
)
sdk = Sdk(devices=(fixed,))
device = sdk.exo().device("primary-exo")

Windows ports look like COM3. Exo does not support locating through SerialConnection.serial_number; serial numbers are read-only device information. Give every device a unique logical name and explicit port in multi-device configurations.