Skip to content

Reads a binary file and produces a stream output with packet_len tags for GNU Radio

Notifications You must be signed in to change notification settings

duggabe/gr-File_Source_to_Tagged_Stream

Repository files navigation

gr-File_Source_to_Tagged_Stream

Reads a binary file and produces a stream output with 'packet_len' tags for GNU Radio. Functionally it replaces a File Source block, a Stream to Tagged Stream block, and parts of a Burst_Shaper block. The advantage of this block is that when the input file size is not an exact multiple of the selected packet length, the remainder at the end of the file is not lost in the 'Stream to Tagged Stream' buffer. This block performs the following functions:

  • Send a preamble to allow the receiver to synchronize.
  • Send the selected file with "packet_len" tags.
  • Send a post-file filler to assure that any buffers have been flushed.

Development History

During the development of the Packet Communications tutorial I decided to make an Out of Tree block to take the place of the File Source and the Stream to Tagged Stream blocks. That was the first version of this module.

After that I worked on the File transfer using Packet and AFSK tutorial and made several improvements to the Embedded Python Block.

Next came follow-on work to the Packet Communications tutorial which resulted in the File transfer using Packet and BPSK tutorial. It added several features such as Base64 encoding of the data, sending the originating filename in the postamble, and specifying the input file on the Python command line.

Installation

  1. Open a terminal window.
  2. Change to the home directory.
cd ~/  
  1. If you don't have 'git', enter
sudo apt install git  
  1. Execute the following commands:

cd
git clone https://github.com/duggabe/gr-File_Source_to_Tagged_Stream.git
cd ~/gr-File_Source_to_Tagged_Stream
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

Using the block in GRC

After starting "gnuradio-companion", the "File Source to Tagged Stream" block will be listed in the Block Tree Panel under the "customEPB" group.

Example flowgraph

An example flowgraph for sending packets is shown in the examples folder.

About

Reads a binary file and produces a stream output with packet_len tags for GNU Radio

Resources

Stars

Watchers

Forks

Packages

No packages published