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: -1

    Scheduled Pinned Locked Moved LoPy
    adafruitmqttlopy
    6 Posts 4 Posters 2.2k Views 4 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.
    • Y Offline
      YazIdo
      last edited by

      Hello , I'm trying to use Adafruit IO broker for MQTT programm , I get that error ''OSError: -1" , I would know what means that error . Thanks You

      L L 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @YazIdo
        last edited by

        @YazIdo
        without any deails provided noone can help you
        show some sample code and point where you got an error

        think about people first, then computers

        1 Reply Last reply Reply Quote 1
        • Y Offline
          YazIdo
          last edited by

          Thank you for your react , there is the message displayed on the console :

          Traceback (most recent call last):
          File "<stdin>", line 89, in <module>
          File "umqtt.py", line 173, in wait_msg
          OSError: -1

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @YazIdo
            last edited by livius

            @YazIdo said in OSError: -1:

            line 173

            please put some lines e.g. no 168..180 from your umqtt.py
            and mark which is 173

            think about people first, then computers

            1 Reply Last reply Reply Quote -1
            • RobTuDelftR Offline
              RobTuDelft
              last edited by

              This is happening:

              if res == b"":
                          raise OSError(-1)
              

              The response is empty...
              Response is res = self.sock.read(1)

              Without data you're just another person with an opinion.
              Hackster | About me

              1 Reply Last reply Reply Quote 0
              • L Offline
                Leech @YazIdo
                last edited by

                @yazido Do not use "keepalive" in function MQTTClient.

                Examle:
                c = MQTTClient("ESPython", "192.168.0.21", port=1883, user="user", password="pass", keepalive=0)
                or
                c = MQTTClient("ESPython", "192.168.0.21", port=1883, user="user", password="pass")

                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