Jump to content

[Python] raise Error(Error.TIMEOUT, msg)


phil

Recommended Posts

Hallo zusammen,

 

ich habe mich mal an dem Servo Brick probiert.

Ich bekomme immerwieder diesen Fehler:

 

  File "C:\Users\...\servobrick.py", line 17, in <module>

    ipcon.add_device(servo)

  File "C:\Python27\lib\tinkerforge\ip_connection.py", line 402, in add_device

    raise Error(Error.TIMEOUT, msg)

tinkerforge.ip_connection.Error: -1: Could not add device 94ANbHfcMxy, timeout

 

 

Und das ist mein Code:

 

HOST = "localhost"
PORT = 4223
UID = "94ANbHfcMxy"

from tinkerforge.ip_connection import IPConnection
from tinkerforge.brick_servo import Servo

servo = Servo(UID)

ipcon = IPConnection(HOST, PORT) 
ipcon.add_device(servo)
    
servo.set_degree(0, -9000, 9000)    
servo.set_period(0, 20000)
servo.set_velocity(0, 10000) 
servo.set_acceleration(0, 10000)
servo.set_pulse_width(0, 500, 2200)

for i in range (-180, 180):
    #i = 70.3
    print i
    servo.set_position(0, i*100)
    servo.enable(0)

raw_input('Press key to exit\n') # Use input() in Python 3
ipcon.destroy()

 

 

Wenn ich den Servo Brick wieder aus und einstecke klappt das Programm 1 mal, danach kommt wieder der gleiche Fehler

 

Ich hoffe Ihr könnt mir helfen

Vielen Dank im vorraus

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...