# Encoding message sent to TTN

**URL:** <https://www.thethingsnetwork.org/forum/t/encoding-message-sent-to-ttn/67609>\
**Category:** Heltec CubeCell\
**Tags:** end-devices\
**Created:** [April 16, 2024, 9:46pm UTC](https://www.thethingsnetwork.org/forum/t/encoding-message-sent-to-ttn/67609 "2024-04-16T21:46:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Johan\_Scheepers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/johan_scheepers/32/46550_2.png) [@Johan\_Scheepers](https://www.thethingsnetwork.org/forum/u/Johan_Scheepers)\
**Post date:** [April 17, 2024, 7:27am UTC](https://www.thethingsnetwork.org/forum/t/encoding-message-sent-to-ttn/67609/3 "2024-04-17T07:27:33Z")

</div>

There are a few extent post on working with bytes and how you should send your data over LoRaWAN.

If you encode your data to hex and decode, you save a lot on air time and battery life.

If you search the forum lots of recourses.

> [@Decrypting messages for dummies](https://www.thethingsnetwork.org/forum/t/decrypting-messages-for-dummies/4894/3):
>
> Thank you a lot, you have really clarified some basic facts. For this purpose is LoraEncoder function - for example to change measured value to number representation of this value, isn’t it? To be sure that this is the right way: way from measured Temp=23.45 to 0x09 0x29 on the TTN Application data page with as small payload as it possible is (from Arduino): float Temp = 23.45; LoraEncoder encoder(buffer); encoder.writeTemperature(Temp); LMIC\_setTxData2(1, buffer, strlen((char \*)buffer), 0)…

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/encoding-message-sent-to-ttn/67609)._
