pybldc
1.0.4
코드는 GNU General Public License v3.0에 따라 공개됩니다.
이 도구를 사용하면 Python을 사용하여 CAN 버스 또는 직렬/USB를 통해 VESC를 플래시할 수 있습니다.
설치하려면:
pip install .
또는 PyPI에서 최신 릴리스를 설치하십시오.
pip3 install -U pybldc
편리한 CLI 도구가 포함되어 있습니다:
$ pybldc -h
usage: pybldc [-id CONTROLLER_ID] [-i INTERFACE] [-l CHANNEL] [-p PORT] [-h] [--version] [-B BINARY] [--bootloader] [-t TIMEOUT] [-r PING_REPEAT] [-b BAUDRATE] [--debug] {can,serial} {upload,ping,reset}
positional arguments:
{can,serial} Communicate with the target via either CAN or serial
{upload,ping,reset} upload: write BINARY
ping: send a ping command to the target and check for a response
reset: send a reset command to the target and check for a response
required CAN arguments:
-id CONTROLLER_ID, --controller-id CONTROLLER_ID
The VESC ID used for communication
optional CAN arguments:
-i INTERFACE, --interface INTERFACE
The CAN-Bus interface to use (default " socketcan " )
-l CHANNEL, --channel CHANNEL
The CAN-Bus channel to use (default " can0 " )
required serial arguments:
-p PORT, --port PORT The port to use for serial
optional arguments:
-h, --help Show this help message and exit
--version Show program ' s version number and exit
-B BINARY, --binary BINARY
The binary to upload
--bootloader The binary to upload is a bootloader
-t TIMEOUT, --timeout TIMEOUT
The time to wait in seconds for a response (default 5.0)
-r PING_REPEAT, --ping-repeat PING_REPEAT
The number of times to try to establish a connection by pinging the VESC (default 3)
-b BAUDRATE, --baudrate BAUDRATE, --bitrate BAUDRATE
The baudrate/bitrate to use for serial/can (defaults to 115200 for serial and 500000 for CAN)
--debug Turn on debug logs
업로드
pybldc can upload -id 1 -B VESC.bin
pybldc serial upload -p /dev/ttyACM0 -B VESC.bin
핑
pybldc can ping -id 1
pybldc serial ping -p /dev/ttyACM0
다시 놓기
pybldc can reset -id 1
pybldc serial reset -p /dev/ttyACM0
Linux에서는 TX 버퍼 크기를 늘려야 할 수도 있습니다.
sudo ip link set can0 txqueuelen 1000