Open
Description
Hi, I'm getting an issue running protocols using this API. Using a modified version of the example gripper protocol:
import cv2
from serial.tools import list_ports
import sys
import os
sys.path.insert(0, os.path.abspath('.'))
from time import sleep
from lib.interface import Interface
available_ports = list_ports.comports()
print(f'available ports: {[x.device for x in available_ports]}')
port = available_ports[1].device
bot = Interface(port)
if bot.connected():
print('Connected')
else:
print('Not connected')
print('Bot status:', 'connected' if bot.connected() else 'not connected')
#status = bot.get_end_effector_gripper()
#print('Status:', status)
bot.set_end_effector_gripper(True, False)
sleep(2)
bot.set_end_effector_gripper(True, True)
sleep(2)
bot.set_end_effector_gripper(True, False)
sleep(2)
bot.set_end_effector_gripper(False, False)
I'm connected with the correct port (COM4) but there is no response from the bot. When I turn the bot off, I get a response:
available ports: ['COM3', 'COM4']
Connected
Bot status: connected
Traceback (most recent call last):
File "C:\Users\ib816\dobot-python\examples\test.py", line 25, in <module>
bot.set_end_effector_gripper(True, False)
File "C:\Users\ib816\dobot-python\lib\interface.py", line 155, in set_end_effector_gripper
return self.send(request)
File "C:\Users\ib816\dobot-python\lib\interface.py", line 26, in send
return response.params
AttributeError: 'NoneType' object has no attribute 'params'
It seems the bot is connecting but I'm not able to run any commands. I was able to get this script to run previously but after rebooting I can no longer run any scripts. I'm guessing the error flagged in bash is because the bot is off, but I don't get any errors as to why nothing is happening. Running code in Python 3.10.5, dobot firmware 3.7.0, Windows 10.
Metadata
Metadata
Assignees
Labels
No labels