Skip to content

CyberGear Python Driver

PyPI version Python versions License: MIT

Python driver for the Xiaomi CyberGear brushless motor over CAN bus.

CyberGear

Built on top of python-can. Tested with SocketCAN on Linux; custom polling threads are used instead of BCM to support other python-can interfaces as well.


Features

  • Five control modes: operation (MIT-style), position, speed, current, and quick-move
  • Auto-scan: discovers motors on the bus without needing to specify a CAN ID
  • Async feedback: can.Notifier-based listener delivers MotorFeedback snapshots without blocking
  • Background polling: portable parameter polling thread keeps properties up to date on any interface
  • Event callbacks: subscribe to feedback, parameter updates, and fault state changes
  • Context-manager API: guarantees clean resource release
  • Fault detection: decodes and monitors over-temperature, over-current, undervoltage, and encoder faults

Quick install

pip install python-cybergear
# or
uv add python-cybergear

With the dashboard (requires Textual and Rich):

pip install python-cybergear[dashboard]
# or
uv add python-cybergear[dashboard]

Then read Getting started to connect your first motor.


Hardware

Tested with a CANable USB adapter and an XT30(2+2) cable.

Canable XT30 cable