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

    LoPy4 sending duplicate messager using Sigfox

    Scheduled Pinned Locked Moved LoPy
    5 Posts 4 Posters 66 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.
    • J Offline
      j_mor
      last edited by j_mor

      Hello,

      I've been doing current draw measurement of my LoPy4(with Pysense shield) using Sigfox and I have noticed that it does send the message out multiple times one after another.

      alt text

      In theory one sigfox message takes 2sec to be sent, but as shown in the picture, there are indeed 3 messages being sent with 1sec pause between them.

      The sigfox code is simple (its the example code):

      # init Sigfox for RCZ1 region (Europe)
      sigfox = Sigfox(mode = Sigfox.SIGFOX, rcz = Sigfox.RCZ1)
      
      # create a Sigfox socket
      s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
      
      # make the socket blocking
      s.setblocking(True)
      
      # configure socket as uplink only
      s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
      
      # send data
      s.send(dataToSend)
      

      The two yellow lines in the picture are start and end of s.send() command.
      (I have turned on and off rgb led to full power for short period of time before and after the s.send() to see power spikes on the oscilloscope, that is how i determined that whatever is happenning between those yellow lines is only the s.send() command working. Those led power spikes are not in the picture.)

      Does anyone have more information about why is this happenig?
      Any idea how to avoid this?

      I do not think it is necessary and in my example it does increase power consumption roughly 2x.

      Thank you,
      j_mor

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

        @j_mor From what I understand the Sigfox spec allows devices to send the frame either 1 or 3 times (the "multiple frame" procedure) for redundancy and reducing packet loss. I would have expected a parameter to switch that on or off, but I can't see one in the docs or in the public part of the code.

        1 Reply Last reply Reply Quote 2
        • E Offline
          Eric73
          last edited by

          As jcaron said, sigfox's specification allow 3 or 1 TX for each frame, 3 is done on 3 differente frequency to ensure that message is received by sigfox back end.

          Can you try to add a one line to your code and try if it's work? (as it's not in documentation but i have found it in code i don't know if it work or not)

          # configure socket as uplink only
          s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
          s.setsockopt(socket.SOL_SIGFOX, socket.SO_TX_REPEAT, 1)
          
          J 1 Reply Last reply Reply Quote 3
          • J Offline
            j_mor @Eric73
            last edited by

            @Eric73 said in LoPy4 sending duplicate messager using Sigfox:

            s.setsockopt(socket.SOL_SIGFOX, socket.SO_TX_REPEAT, 1)

            setting to 1 did not work, but setting to 0 did ;)
            Thank you for the idea

            V 1 Reply Last reply Reply Quote 2
            • V Offline
              Vinicius Campos @j_mor
              last edited by

              This post is deleted!
              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