And I saw a previous forum discussion said the maximum packet size is 256bytes and payload is 237bytes.
So, i use 256 - 237 = 19bytes , and the upper linked table shows that the header adds up to 14bytes. Then 19 - 14 = 5 bytes . I would like to know where the remaining 5 bytes are used ?
In addition , I would like to know the total packet size.
For example, If I send a 1 byte string to another meshtastic device via the meshtastic python CLI, what is the total packet size it sends?
Please correct me if Iâve made any other mistakes that I havenât noticed.
The protobufs encoding adds some overhead that explains the difference.
Meshtastic also uses text compression in the firmware, so to know the actual payload length, you need to check the serial logs when sending a message (e.g. via Bluetooth connection). Then you have to add the header length to it.
I donât think thatâs possible with the current firmware. But if you send the same text every time, the compressed length will be the same and you can check that length in the serial logs.
What you see in the serial logs is only the size of the payload from a Meshtastic data message. On top of that, there is some overhead from the protobufs encoding and the Meshtastic header. Together that forms the payload of a LoRa packet that is given to the LoRa chip together with its size here. If you want to know this size, you would have to add a print statement to the code there. The LoRa chip then adds the LoRa header and preamble.
Depending on what you consider the real application data and what overhead, you can calculate the actual âgoodputâ.
This picture is my current understanding of the LoRa and Meshtastic packet structure by using gnuradio. gr-lora
However, there are still certain parts that Iâm unsure about.
I would greatly appreciate it if you could provide me with information regarding the composition of the preamble and how many bytes it occupies? as well as the structure of the LoRa header on this picture correct ?
The preamble doesnât contain any information, itâs only used for packet detection and synchronization. But you can read about the relation between symbols and bytes here.
Meshtastic uses an explicit LoRa header, I think what you have is correct but itâs something handled by the chip and not by the firmware.
Also your Meshtastic header contains 2 âalignâ bytes, which isnât correct. The header is only 14 bytes.
I have another question.
The LoRa MTU is set at 256 bytes.
So, if I transmit a payload of 255 bytes, wouldnât it exceed the MTU limit due to the inclusion of the Preamble , LoRa header and Payloaad CRC ?
However, it still seems to work when I actually try it this way.
We use the âsendDataâ function to directly send text messages.
When the âportnumsâ value is set to âIP_TUNNEL_APPâ, I observed through serial logs that the message is not being compressed.