sending pysense accelerometer data to TTN
-
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 ?
-
@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) -
@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.
-
@dan do we need to convert data into bytes before sending to TTN ? if yes how do we convert float data ?
-
@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. -
@robert-hh how about the negative values ?
-
@abhishek2101 No difference. The sign is part of the binary represenration.
-
@abhishek2101 any idea how can i unpack the values in TTN ?
-
@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.
-
@robert-hh but i dont see the mqtt integration in my console ?
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