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

    sigfox payload formatting

    Scheduled Pinned Locked Moved SiPy
    sipybytes
    5 Posts 2 Posters 1.9k Views 2 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
      iotmaker
      last edited by iotmaker

      I have aproblem and cant solve it

      i will need you help on this please

      for the sigfox payload i have this

      payload=['0x11', '0x9d', '0x57', '0xae', '0x38', '0xe0', '0xd1', '0x5', '41', '4e', '57', '4e']
      
      s.send(bytes(payload))
      
      

      i get an error TypeError: can't convert str to int

      how can i convert that list to bytes... i think they are already on bytes

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

        @iotmaker said in sigfox payload formatting:
        what about

        payload=[0x11, 0x9d, 0x57, 0xae, 0x38, 0xe0, 0xd1, 0x5, 0x41, 0x4e, 0x57, 0x4e]
        
        s.send(bytes(payload))
        

        think about people first, then computers

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

          how can i remove the ' ' from my payload?

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

            @iotmaker
            you can simply convert it

            b=[int(x, 16) for x in payload]
            

            but question is how do you got this payload?
            on first you have '0x11' but on last '4e' without 0x ?

            think about people first, then computers

            I 1 Reply Last reply Reply Quote 0
            • I Offline
              iotmaker @livius
              last edited by

              @livius said in sigfox payload formatting:

              @iotmaker
              you can simply convert it

              b=[int(x, 16) for x in payload]
              

              but question is how do you got this payload?
              on first you have '0x11' but on last '4e' without 0x ?

              That worked... did some modification and now we are good.

              thank you

              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