rpp0 / gr-lora

GNU Radio blocks for receiving LoRa modulated radio messages using SDR
GNU General Public License v3.0
525 stars 113 forks source link

There's more data saved to message file sink than data that's printed #117

Open lusiaold opened 4 years ago

lusiaold commented 4 years ago

Hello, I have a small issue with this block. I transmitted a small packet of data and decoded it successfully with this block, but when I compare the output printed in GNU Radio console:

68 20 d0 42 4d 66 00 00 00 00 00 00 00 3e 00 00
00 28 00 00 00 0a 00 00 00 0a 00 00 00 01 00 01
00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff
00 ff c0 00 00 f9 c0 00 00 f9 c0 00 00 ff c0 00
00 ff c0 00 00 ff c0 00 00 ce 40 00 00 ce 40 00
00 ff c0 00 00 ff c0 00 00 00 5c

And data in message file sink (I previewed it with od -tx1):

0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 1e 00 68
0000020 20 d0 42 4d 66 00 00 00 00 00 00 00 3e 00 00 00
0000040 28 00 00 00 0a 00 00 00 0a 00 00 00 01 00 01 00
0000060 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00
0000100 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff 00
0000120 ff c0 00 00 f9 c0 00 00 f9 c0 00 00 ff c0 00 00
0000140 ff c0 00 00 ff c0 00 00 ce 40 00 00 ce 40 00 00
0000160 ff c0 00 00 ff c0 00 00 00 5c
0000172

I can see that there is some data saved in the file (lots of 0s and also 1e byte) other than the message itself. How could I get rid of this data and leave only the original message with header and other things?

By the way, what exactly is LoRa's header format? I recognized the first byte to be message size, but I don't know what the other two bytes represent.