# How to decode packets in Gnuradio

**URL:** <https://www.ruby-forum.com/t/how-to-decode-packets-in-gnuradio/240823>\
**Category:** GNU Radio\
**Created:** [May 2, 2014, 2:44am UTC](https://www.ruby-forum.com/t/how-to-decode-packets-in-gnuradio/240823 "2014-05-02T02:44:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 2, 2014, 2:44am UTC](https://www.ruby-forum.com/t/how-to-decode-packets-in-gnuradio/240823/1 "2014-05-02T02:44:46Z")

</div>

Hi All,

I am new to Gnuradio and trying to decode of bit stream transmitted from  
a simple FSK  
transmitter like RFM22 without utilizing any OOT block (only using basic  
GRC blocks available). Packet format is

8 nibbles (4 octets) PREAMBLE  
2 octets SYNC 0x2d, 0xd4  
4 octets HEADER: (TO, FROM, ID, FLAGS)  
1 octet LENGTH (0 to 255), number of octets in DATA  
0 to 255 octets DATA  
2 octets CRC computed with CRC16(IBM), computed on HEADER, LENGTH and  
DATA

At this point I can demodulate and receive the byte stream ((with LSB  
with relevant bit value) without issues. I also passing it though  
digital\_correlate\_access\_code\_bb and correctly identifying the end of  
the sync word. After that I can not figure out what to do to pack the  
bits and extract the length and extract the DATA

Can this be done without utilizing OOT blocks. If so can you please give  
me some guidance how to do  
it.

Thank You

---

<div class="post-metadata">

**Author:** ![pinto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/96bed5/32.png) [@pinto](https://www.ruby-forum.com/u/pinto)\
**Post date:** [May 2, 2014, 10:37pm UTC](https://www.ruby-forum.com/t/how-to-decode-packets-in-gnuradio/240823/2 "2014-05-02T22:37:00Z")

</div>

If you want to do it without out of tree modules you could do it outside  
gnuradio with your own programme. Create a fifo and write out with a  
file sink block, then read the data from the fifo in your programme.

Mike

---

<div class="post-metadata">

**Author:** ![pinto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/96bed5/32.png) [@pinto](https://www.ruby-forum.com/u/pinto)\
**Post date:** [May 2, 2014, 11:05pm UTC](https://www.ruby-forum.com/t/how-to-decode-packets-in-gnuradio/240823/3 "2014-05-02T23:05:05Z")

</div>

Thanks Mike for the reply. In fact my specific question is that, Am I  
missing utilizing any readily available block/s to do it function? I  
guess based on your answer that its not the case.
