Hello,
I have coded a custom driver for RoboDK to connect to Arduino. From RoboDK GUI, connection works and I am able to send commands (from buttons & program) without any issue.
Though, when I want to use Python API and callsetConnectionParamsmethod, I get the error below.
Here is the connect function from my custom driver:
This seems to happen during setting of params. Thus, I am kinda lost where to start debugging. Any help is much appreciated.
I have coded a custom driver for RoboDK to connect to Arduino. From RoboDK GUI, connection works and I am able to send commands (from buttons & program) without any issue.
Though, when I want to use Python API and callsetConnectionParamsmethod, I get the error below.
Code:
File "/venv/lib/python3.7/site-packages/robolink/robolink.py", line 4017, in setConnectionParams
self.link._check_status()
File "/venv/lib/python3.7/site-packages/robolink/robolink.py", line 363, in _check_status
raise Exception('Problems running function')
Exception: Problems running function
Here is the connect function from my custom driver:
Code:
def connect(self, host: str, baudrate: int):
if not self._connected:
try:
self._serial = serial.Serial(host, baudrate=baudrate, timeout=0.5)
except serial.serialutil.SerialException:
self._robodk.update_status(1)
return
self._connected = self._serial.is_open
if self._connected:
self._robodk.update_status(4) # Ready
else:
self._robodk.update_status(1) # Connection problems
# ----- #
def print_message(self, message):
print('SMS:' + message)
sys.stdout.flush()
def update_status(self, status):
if status in ROBOTCOM_STATUS:
status = ROBOTCOM_STATUS[status]
self.print_message('{status}'.format(status=status))
This seems to happen during setting of params. Thus, I am kinda lost where to start debugging. Any help is much appreciated.