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

    sending pysense accelerometer data to TTN

    Scheduled Pinned Locked Moved LoPy
    lopypysense
    10 Posts 3 Posters 1.3k 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.
    • A Offline
      abhishek2101
      last edited by

      Hi

      I have been able to do OTAA join to TTN and also able to print accelerometer data to the local machine. How can I send this data to TTN ?

      robert-hhR 1 Reply Last reply Reply Quote 0
      • danD Offline
        dan
        last edited by

        @abhishek2101 Hi, you can find examples for LoRa in our docs. You can see how to send data with LoRaWAN and OTAA on this page.

        Have you tried s.send(li.acceleration())? (this is after you've set up a LoRa socket)

        A 1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @abhishek2101
          last edited by

          @abhishek2101 TTN is just the transport vehicle. You have to register an integration at your TTN application to receive the data. For a first test, Cayenne can be used. They support various types of sensors.

          1 Reply Last reply Reply Quote 1
          • A Offline
            abhishek2101 @dan
            last edited by

            @dan do we need to convert data into bytes before sending to TTN ? if yes how do we convert float data ?

            robert-hhR 1 Reply Last reply Reply Quote 0
            • robert-hhR Offline
              robert-hh @abhishek2101
              last edited by

              @abhishek2101 For instanve using the struct module. Example.

              import struct
              value = 1.234
              buffer = struct.pack("<f", value)
              

              More information at https://docs.python.org/3.5/library/struct.html
              Note, that micropython does not support all options, but all important ones.

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                abhishek2101 @robert-hh
                last edited by

                @robert-hh how about the negative values ?

                robert-hhR A 2 Replies Last reply Reply Quote 0
                • robert-hhR Offline
                  robert-hh @abhishek2101
                  last edited by

                  @abhishek2101 No difference. The sign is part of the binary represenration.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    abhishek2101 @abhishek2101
                    last edited by

                    @abhishek2101 any idea how can i unpack the values in TTN ?

                    robert-hhR 1 Reply Last reply Reply Quote 0
                    • robert-hhR Offline
                      robert-hh @abhishek2101
                      last edited by

                      @abhishek2101 Not in TTN. the idea is that you define an integration with the application, which deals with the data. The only thing I did was sending data to Cayenne. But you can also define your own service for the data.

                      A 1 Reply Last reply Reply Quote 0
                      • A Offline
                        abhishek2101 @robert-hh
                        last edited by

                        @robert-hh but i dont see the mqtt integration in my console ?

                        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