0

I am trying to write a pyserial command to the uart port to control the robot arm. I have some manual: manual for arm

manual command example

I use pyserial like that:

import serial
from time import sleep

port = serial.Serial("/dev/ttyUSB0", baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=8, timeout=1)

port.write(b"\x055\x55\x0B\x03\x02\x20\x03\x02\xB0\x04\x09\xFC\x03\xaa")
sleep(0.3)
#port.write(b"\x05")
#sleep(0.3)
#port.write(b"\x06")
#sleep(0.03)
#port.write(b"\x08\x01\x00")
print('send')

At first I tried to run it in one line, the buzzer will beep that the command was accepted, but the hand does not move. Then I tried to split the Header separately for the Length in the next line and the Command with Parameters in the next.

Tell me how you can send these commands to the port, maybe there is something ready to do this in Python?

  • https://stackoverflow.com/questions/32018993/how-can-i-send-a-byte-array-to-a-serial-port-using-python Does this help ? – ecsridhar Nov 19 '21 at 23:41

1 Answers1

0

LSC Series Servo Controller Communication Protocol V1.2 manual says:

If the user transmits the correct data to the servo controller, the blue LED 2 on the controller will flash one time, indicating that the correct data have been received. If the user transmits the wrong data, then the blue LED2 will not have any reaction and will keep the bright, then the buzzer will beepbeep twice to remind the user of the data error.

The only thing in that manual about that buzzer is that it beeps 2 times if there is a data error...

DePetrel
  • 11
  • 3
  • Thanks for the answer. But how manage this servos if they don't move? – Кирилл Кулаков Jul 01 '22 at 13:11
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32143166) – Rohit Gupta Jul 07 '22 at 00:30