Page 1 of 1

RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Posted: Fri Feb 14, 2020 3:44 pm
by Rhybot
I have a RC Servo Phidget, PN RCC1000_0.
https://www.phidgets.com/?tier=3&catid= ... rodid=1015

I first attach the Phidget, no problem. Then, when I call rc_servo.getPosition(), I get

Code: Select all

PhidgetException 0x33 (Unknown or Invalid Value)
Code Run (after attachment)

Code: Select all

rc_servo.setTargetPosition(0.0)
rc_servo.setEngaged(True)
rc_servo.getPosition()
Code is based on this code sample: https://www.phidgets.com/?view=code_sam ... id=RCC1000

I am using Python 3.6, Phidget22==1.5.20191113, and Phidget firmware version 110.

Stack Trace

Code: Select all

File "/some_path/rc_servo_driver.py", line 68, in angle_deg
    return self.getPosition()
  File "/usr/local/lib/python3.7/site-packages/Phidget22/Devices/RCServo.py", line 284, in getPosition
    raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException: PhidgetException 0x33 (Unknown or Invalid Value)
The value is unknown. This can happen right after attach, when the value has not yet been recieved from the Phidget. This can also happen if a device has not yet been configured / enabled. Some properties can only be read back after being set.
Any ideas on what I am doing wrong? Is there some property I need to set first?

Re: RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Posted: Fri Feb 14, 2020 3:54 pm
by jdecoux
Try putting a small delay (10-100ms) between setEngaged and getPosition to give the servo controller a bit of time to report its position to your program.

Re: RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Posted: Fri Feb 14, 2020 4:16 pm
by Rhybot
I added a 10 ms delay after completion of the attach handler. It worked, thank you @jdecoux!