Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    OSError: in error.log file

    Scheduled Pinned Locked Moved WiPy 2&3
    wipylopy
    6 Posts 3 Posters 260 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      Wolli01
      last edited by Wolli01

      I have created an error.log file to find errors.
      Enclosed is an excerpt of the file and below that the Main-File line.
      Who can help more and tell what these error messages mean and how I can avoid them?

      25.12.2019;05:10:21
      Traceback (most recent call last):
      File "main.py", line 790, in <module>
      File "/flash/lib/urequests.py", line 116, in post
      return request("POST", url, **kw)
      File "/flash/lib/urequests.py", line 102, in request
      raise
      File "/flash/lib/urequests.py", line 60, in request
      s.connect(ai[-1])
      OSError: [Errno 113] EHOSTUNREACH

      Main Zeile:
      res = urequests.post(url, data=json.dumps(userdata))

      25.12.2019;05:21:30
      Traceback (most recent call last):
      File "main.py", line 270, in <module>
      File "/flash/lib/urequests.py", line 113, in get
      return request("GET", url, **kw)
      File "/flash/lib/urequests.py", line 102, in request
      raise
      File "/flash/lib/urequests.py", line 62, in request
      s = ussl.wrap_socket(s, server_hostname=host)
      OSError: [Errno -26624] MBEDTLS_ERR_SSL_TIMEOUT

      Main Zeile:
      res = urequests.get(settings.Gateway+'onlinesettings.txt')

      25.12.2019;05:44:25
      Traceback (most recent call last):
      File "main.py", line 296, in <module>
      File "/flash/lib/urequests.py", line 113, in get
      File "/flash/lib/urequests.py", line 102, in request
      File "/flash/lib/urequests.py", line 62, in request
      OSError: [Errno -26624] MBEDTLS_ERR_SSL_TIMEOUT

      Main Zeile:
      res3 = urequests.get(settings.Gateway+'onoff.txt')

      25.12.2019;05:47:11
      Traceback (most recent call last):
      File "main.py", line 790, in <module>
      File "/flash/lib/urequests.py", line 116, in post
      return request("POST", url, **kw)
      File "/flash/lib/urequests.py", line 102, in request
      raise
      File "/flash/lib/urequests.py", line 62, in request
      s = ussl.wrap_socket(s, server_hostname=host)
      OSError: [Errno -26624] MBEDTLS_ERR_SSL_TIMEOUT

      Main Zeile:
      res = urequests.post(url, data=json.dumps(userdata))

      S J 2 Replies Last reply Reply Quote 0
      • S Offline
        svonbentzel @Wolli01
        last edited by

        @Wolli01

        Hello, can you share your code to generate this log file? I try it a few times and don’t get it :-(

        Please 🥺

        W 1 Reply Last reply Reply Quote 0
        • W Offline
          Wolli01 @svonbentzel
          last edited by Wolli01

          @svonbentzel
          Yes, please.

          try: # Ab hier beginnt die Fehlerüberwachung
          

          #Code........................

          # Fehler abfangen und in die error.log speichern------------------------------
          except Exception as e:
              # Fehler Lampe in Rot anzeigen!
              pycom.rgbled(0xFF0000) #Rot
              # Fehler Lampe in Rot anzeigen!
              print("Fehlermeldung")
              print(e)
              # Fehlerdatei erstellen
              import sys 
              with open ('/sd/error.log', 'a') as f: 
              #Fehlerbeschreibung--------------------
                  f.write(str(LogDateTime) + "\n")           
                  sys.print_exception(e, f)
                  f.write("\n")         
              #Fehlerbeschreibung--------------------
          
              time.sleep(10)
              machine.reset() # Neustarten
              #machine.deepsleep (1000)
          
          1 Reply Last reply Reply Quote 0
          • S Offline
            svonbentzel
            last edited by

            Awesome ! Many thanks 😊

            1 Reply Last reply Reply Quote 0
            • J Offline
              jcaron @Wolli01
              last edited by

              @Wolli01 I believe the errors are self-explanatory.

              • The first one is “host unreachable”, which points to a network issue

              • The other one are timeouts during the TLS negotiation. That’s again most likely a network issue.

              Wireless communication is subject to all kinds of issues which makes it not 100% reliable, this is to be expected and managed. When an error occurs, you should retry, either right away (usually with a slight pause which increases each time, a random offset, and a limit to the number of retried), or through some queuing mechanism. The details depend a lot on how important the data is, what kind of delay you can accept, the frequency and size of the transmissions, your dependence on battery, and so on.

              W 1 Reply Last reply Reply Quote 0
              • W Offline
                Wolli01 @jcaron
                last edited by

                @jcaron Many thanks for your info

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom