You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
since the uArm firmware is based on Marlin, but has implemented its own way of numbering commands, any Marlin commands that do not have this feature enabled will not work with this python library, even though they work when sent directly.
e.g. if I call send_cmd_sync('M105'), the python library will append #N and expect $N in return, but since it's a Marlin command, it only return ok T:23.3 /0.0 @:0 which means that the library will think that the firmware never actually responded.
I could solve this by modifying packed_in_cb in protocol_ascii.py like so, but it only works if there are no other commands pending.
def packet_in_cb(self, msg):
#print('{}: <- '.format(self.node) + msg)
if len(msg) < 2:
return
if msg[0:1] == '@':
if self.ports['report']['handle']:
self.logger.log(logging.VERBOSE, 'report: ' + msg)
self.ports['report']['handle'].publish(msg[1:])
elif msg[0:1] == '$':
index = msg.find(' ')
index = index if index != -1 else len(msg)
cnt = int(msg[1:index])
if cnt in self.cmd_pend.keys():
# TODO: avoid KeyError
self.cmd_pend[cnt].finish(msg[index + 1:])
else:
pass # warning...
elif msg[0:2] == 'ok' and len(self.cmd_pend) == 1:
cnt = list(self.cmd_pend)[0]
self.cmd_pend[cnt].finish(msg)
Let me know if you would like me to submit a PR.
The text was updated successfully, but these errors were encountered:
Hi,
since the uArm firmware is based on Marlin, but has implemented its own way of numbering commands, any Marlin commands that do not have this feature enabled will not work with this python library, even though they work when sent directly.
e.g. if I call
send_cmd_sync('M105')
, the python library will append #N and expect $N in return, but since it's a Marlin command, it only returnok T:23.3 /0.0 @:0
which means that the library will think that the firmware never actually responded.I could solve this by modifying
packed_in_cb
inprotocol_ascii.py
like so, but it only works if there are no other commands pending.Let me know if you would like me to submit a PR.
The text was updated successfully, but these errors were encountered: