Jump to content

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


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 zu diesem Kommentar
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.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...