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

    AWS MQTT 'Packet sent. (Length: 2)' periodic message

    Scheduled Pinned Locked Moved WiPy 2&3
    awsmqttwipy3.0
    7 Posts 3 Posters 1.4k 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.
    • I Offline
      InverseEffect
      last edited by

      I am successfully using the AWS MQTT lib but noticed that on my Wipy, every 20 seconds the following message is printed: Packet sent. (Length: 2).

      It does not register on the AWS console as a message, so what is being sent? Maybe a keep alive message, if so, can I change the interval? Is it even a MQTT message being sent?

      Thanks

      1 Reply Last reply Reply Quote 1
      • T Offline
        timh
        last edited by timh

        This will be a keepalive packet. You can set the keepalive frequency in the api

        T 1 Reply Last reply Reply Quote 0
        • I Offline
          InverseEffect
          last edited by

          I tried specifying the keep-alive frequency by passing a value in the connect() method: pycomAwsMQTTClient.connect(900), but still occurs every 20 seconds. Drilling down the source code, this value is thrown away. Look at def _send_connect(self, keepalive, clean_session) method in MQTTClient.py. The keepalive argument is not used. If I remember correctly, AWS specifies a max keep-alive interval of 20 minutes, it's weird that this keep-alive is 20 seconds. Perhaps a result of some late night coding? :)

          1 Reply Last reply Reply Quote 0
          • T Offline
            timh @timh
            last edited by

            @timh I sm only using part of that library, (the lower levels) and the keepalive does work down there. I am not talking to AWS, but another platform that needs to use TLS.

            There are a number of problems with the library as it's currently implemented.

            For instance when you disconnect the background thread is not cleaned up, so a reconnect attempt causes problems, without destroying the thread .

            So I would not be surprised its really only addressing a minimal working set.

            I 1 Reply Last reply Reply Quote 0
            • I Offline
              InverseEffect @timh
              last edited by

              @timh Thanks for the heads-up. Are you satisfied with your implementation of MQTT? Meaning you got everything to work reliably and stable? I don't mind writing my own MQTT lib, as long as I can know my efforts won't be pointless because of unstable firmware/micropython/hardware/etc.

              T R 2 Replies Last reply Reply Quote 0
              • T Offline
                timh @InverseEffect
                last edited by

                @inverseeffect using the underlying library that the AWS work is built on seems to work ok. What I haven't had time to do yet is very long running (many days) tests. I did leave an LTE based MQTT connection active with just keepalives going last week, and ended up with a GURU meditation error, after an un caught exception. But the session was active in a console and no code around it. Will look into this more this week.

                ...
                Packet sent. (Length: 2)
                Packet sent. (Length: 2)
                Packet sent. (Length: 2)
                Guru Meditation Error: Core  1 panic'ed (StoreProhibited)
                . Exception was unhandled.
                Register dump:
                PC      : 0x4017c802  PS      : 0x00060433  A0      : 0x8017d867  A1      : 0x3ffe4da0
                A2      : 0x00000000  A3      : 0x00000041  A4      : 0xffffff40  A5      : 0xfe5440ff
                A6      : 0xfe7d983f  A7      : 0xfe7e9c3f  A8      : 0x8017c802  A9      : 0x3ffe4d80
                A10     : 0x3ffe7d98  A11     : 0x400839f8  A12     : 0x00000100  A13     : 0x3ffe7f9c
                A14     : 0x882072f1  A15     : 0x66316b7d  SAR     : 0x00000008  EXCCAUSE: 0x0000001d
                EXCVADDR: 0xfe544103  LBEG    : 0x4009b194  LEND    : 0x4009b1c2  LCOUNT  : 0x00000000
                
                
                1 Reply Last reply Reply Quote 0
                • R Offline
                  reidfo @InverseEffect
                  last edited by

                  @inverseeffect Did you ever get any resolution on the keepalive timer? I'm running into the same issue. For now I've switched to simple.py, but I would much rather use the AWS library.

                  1 Reply Last reply Reply Quote 1

                  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