jeremiedecock / pyax12

Python library to control Dynamixel AX-12 actuators.
MIT License
18 stars 10 forks source link

TypeError : 'NoneType' object is not subscriptable #10

Closed allefenes closed 7 months ago

allefenes commented 10 months ago

TypeError : 'NoneType' object is not subscriptable

Hi,

I am working on RPI-4B for dynamixel AX12-A control. I can send it to any position I want. . But i have a problem. I have shown my codes and response script below. My circuit diagram is same circuit in main library page. And i tried add logic level shifter(BSS138) to circuit for 3.3V-5V conversation. But it doesn't work. Here are the codes;

This is try01.py named python codes :

from pyax12.connection import Connection
import time

serial_connection = Connection(port="/dev/ttyAMA0", baudrate=1000000, rpi_gpio=True, timeout=0.1)
serial_connection.goto(1,130,speed=128,degrees=True)
time.sleep(5)
serial_connection.get_firmware_version(1)

serial_connection.close()

AX12-A goes to 130 degrees but i can't get get firmware version for example or present temperature.

And this is the response script :

/usr/local/lib/python3.11/dist-packages/pyax12-0.5.dev3-py3.11.egg/pyax12/connection.py:78: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
Traceback (most recent call last):
  File "/home/DELTA/Desktop/try01.py", line 8, in <module>
    serial_connection.get_firmware_version(1)
  File "/usr/local/lib/python3.11/dist-packages/pyax12-0.5.dev3-py3.11.egg/pyax12/connection.py", line 518, in get_firmware_version
    return byte_seq[0]
TypeError: 'NoneType' object is not subscriptable
allefenes commented 7 months ago

When i use recommended communication circuit from AX12-A datasheet (Web Page) it does not work. But i use Robotis U2D2 communication module and i have no problem. I did not understand what is the difference between of this two way.

I tried UART/USB converter (FT232) and it did not work again.