Send double/float data via OTAA


(Yamaha) #1

Hello Everyone,

I want to send double or float data via OTAA the given example is sending just a string and character array.

Can somebody please tell me how can i send double value via lora packet ? for example ( temp or gps)

I have tried different type casting but it’s not working . Please advice

thanks in advance


#2

what node are you using? off the shelf or one of your own and have access to the code?

There are multiple ways to do this depending on the precision needed and number of bytes you want to send.

Andrew


(Yamaha) #3

I am using Seeeduino LoraWan w/gps and yes i have access to the code

No need for multiple ways … the easiest way is enough :smile:


(Arjan) #4

I’d suggest you read about LoRaWAN first, and then search this forum. OTAA is unrelated to sending any data, and you cannot expect people to list all options without even telling us what you’ve tried.

https://www.thethingsnetwork.org/learn
https://www.thethingsnetwork.org/docs/devices/bytes.html
https://www.thethingsnetwork.org/forum/search?q=float


#5

Check my blog http://talk2lora.blogspot.com, last post explains some of what you want to do in detail:
In particular this page: http://talk2lora.blogspot.com/2016/11/building-iot-temperature-sensor-episode_27.html


(Brady Aiello) #6

Try this out. Make sure to use the included payload function. It glues the bytes back together in the right order to compensate for the difference in endianess of the Seeeduino and TTN. https://github.com/brady-aiello/Seeeduino_LoRaWAN_for_hybrid_gateways/tree/master/Seeeduino-LoRaWAN-GPS-app


(Brady Aiello) #7

Unions work well for sending LoRa packets from C. If you’re using Python / Micropython, struct-packing is the way to go. It keeps the message size small.