Skip to content

Commit 1b05844

Browse files
committed
Merge remote-tracking branch 'origin/mergemaster'
2 parents c3b90de + c573fcb commit 1b05844

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

uc2rest/UC2Client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def post_json(self, path, payload, getReturn=True, nResponses=1, timeout=1):
160160
# FIXME: this is not working
161161
url = f"http://{self.host}:{self.port}{path}"
162162
try:
163+
if timeout==0: timeout=.2
163164
r = requests.post(url, json=payload, headers=self.headers, timeout=timeout)
164165
returnMessage = r.json()
165166
returnMessage["success"] = r.status_code==200

uc2rest/motor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def __init__(self, parent=None):
5353
self.motorAxisOrder = [0,1,2,3] # motor axis is 1,2,3,0 => X,Y,Z,T # FIXME: Hardcoded
5454

5555
# register a callback function for the motor status on the serial loop
56-
self._parent.serial.register_callback(self._callback_motor_status, pattern="steppers")
56+
if hasattr(self._parent, "serial"):
57+
self._parent.serial.register_callback(self._callback_motor_status, pattern="steppers")
5758

5859
# move motor to wake them up #FIXME: Should not be necessary!
5960
#self.move_stepper(steps=(1,1,1,1), speed=(1000,1000,1000,1000), is_absolute=(False,False,False,False))

0 commit comments

Comments
 (0)