Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. ioBroker simple-api adapter requests.exceptions.ConnectionError

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    UNSOLVED ioBroker simple-api adapter requests.exceptions.ConnectionError

    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      apfelschorle last edited by

      Hallo zusammen,

      ich nutze neben dem iobroker-Pi einen weiteren Pi welches mittels eines Python Skripts und der Request Bibliothek Flags im IoBroker abfrage und einen bestimmten Befehl auszuführen.

      Hier ein abgespeckter Auschnitt aus dem Quellcode welches per requests.get Flags ausließt:

      import requests
      import backoff
      
      @backoff.on_exception(backoff.expo,requests.exceptions.ConnectionError,max_tries=20)
      
      while (True):
       x = requests.get('http://192.xxx/getPlainValue/javascript.0.sendPictureFlag')
      
       if (x.text == "true"):
         #print "save pic..."
         subprocess.call("raspistill -hf -vf -w 640 -h 480 -o /home/xxx/capture.jpg"", shell=True)
      
      

      Irgendwann steigt das Programm mit folgender Error Meldung aus:

      requests.exceptions.ConnectionError: ('Connection aborted.', error(101, 'Network is unreachable'))
      

      Den iobroker anpingen funktioniert ohne Probleme, habe das Gefühl es liegt an der ioBroker simple-api?

      Gibt es jemanden der einen Workaround kennt? Try-Except ist nicht so toll, da ich die Flags im iobroker auf false setzen muss und dort kann der gleiche Fehler mit ConnectionError auftreten sodas das Flag auf true bleibt und nicht zurückgesetzt wird.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate

      730
      Online

      31.8k
      Users

      80.0k
      Topics

      1.3m
      Posts

      iobroker simple-api adapter
      1
      1
      315
      Loading More Posts
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
      The ioBroker Community 2014-2023
      logo