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

    Problem with Sigfox Payload

    Scheduled Pinned Locked Moved SiPy
    pytracksipysigfox
    21 Posts 3 Posters 7.7k 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.
    • J Offline
      Jiemde Pybytes Beta @livius
      last edited by

      @livius
      Had already tested this but not the good result.

      jiemde

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

        @Jiemde
        what are results - maybe this hint something

        think about people first, then computers

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          Jiemde Pybytes Beta @livius
          last edited by

          @livius
          Here is the printscreen
          0_1499085211840_Capture d'écran 2017-07-03 14.31.56.png

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

            @Jiemde

            sadly i do not have sipy to test self but
            looking at your values i see that you have variation on most significant bits
            try then this:
            int1:uint::32:little-endian int2:uint::32:little-endian

            if this does not help then post output from corrds recived by pytrack + output packed
            and what you got for this frames on sigfox

            think about people first, then computers

            J 2 Replies Last reply Reply Quote 0
            • J Offline
              Jiemde Pybytes Beta @livius
              last edited by

              @livius
              No change in the displaying data.
              As I don't have my SiPy/Pytrack with me at my office, I will reply this evening to your other question.

              best regards
              jiemde

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jiemde Pybytes Beta @livius
                last edited by

                @livius
                You will find the output you ask:

                def sendtosigfox():

                datatosend = struct.pack('ii', int(coords[0]*100000),  int(coords[1]*100000))
                print('sigfox send: {}\n'.format(datatosend))
                size1=struct.calcsize('i')
                size2=struct.calcsize('ii')
                print('calcsize: ', size1, size2)
                
                sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1)
                s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
                s.setblocking(True)
                s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
                
                s.send(datatosend)
                s.setblocking(False)
                s.close()
                

                while True:
                acc = LIS2HH12(py)
                roll = acc.roll()
                print('X= ', roll)
                pitch = acc.pitch()
                print('Y= ', pitch)
                yaw = acc.yaw()
                print('Z= ', yaw)
                time.sleep(1)
                gps = L76GNSS(py)
                coords = gps.coordinates()
                print(coords)
                sendtosigfox()
                time.sleep(600)

                The output in Atom/Pymakr:
                0_1499096050194_Untitled-3.png

                The output in Sigfox backend
                0_1499096109639_Untitled-2.png

                Regards
                Jiemde

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

                  @Jiemde
                  can you add before struct.pack

                  print(coords)
                  or
                  print(str(coords)) #if above not work cast first to string
                  

                  think about people first, then computers

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

                    @Jiemde

                    is this really your position?

                    b'\xc8\x17M\x00k\xb5\x08\x00'
                    (5052360, 570731)
                    

                    will be really helpfull to see

                    print(coords)
                    

                    as mentioned below

                    think about people first, then computers

                    J 1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jiemde Pybytes Beta @livius
                      last edited by

                      @livius
                      Yes it 's my position !
                      The coords are displayed just before the "sigfox send: " on the output in Atom/pymakr picture.

                      (50.5236, 5.707314)

                      Jiemde

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

                        @Jiemde
                        Ahh i see :) I have missed it.

                        and i see problem (previously i have thinked in opposite direction)

                        try do this (one of this should do the trick)

                        datatosend = struct.pack('>II', int(coords[0]*100000),  int(coords[1]*100000))
                        

                        or not and on sigfox backend (i do not know why little not do the job and suppose that only above line will work for you)

                        int1:uint::32:big-endian int2:uint::32:big-endian
                        

                        think about people first, then computers

                        J 1 Reply Last reply Reply Quote 1
                        • J Offline
                          Jiemde Pybytes Beta @livius
                          last edited by

                          @livius
                          Hi livius, That's work!, now I need to understand how work the "format" of the "pack" function and specialy "little and big-endian.

                          Best regards
                          Jiemde

                          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
                          • 2
                          • 1 / 2
                          • First post
                            Last post

                          Pycom on Twitter

                          Pycom