Python - GNURadio interface

Hi guys,
I am interested to send and receive some digital data from python using limeSDR.
Overall, the path is: python_Tx → GNU_Radio_Tx → LimeSDR_Tx → [REAL WORLD] → LimeSDR_Rx → GNU_Radio_Rx → python_Rx

Currently, I am using file source and sink and inside it I use a pipe to stream the bytes between the python and the GNURadio. This doesn’t work too good for me, I see various buffering issues on the way.

Can you tell me what would be a good way to transfer data between python and GNURadio?

Also, can I read from python an indication that the Rx is receiving data (not to read the bits, but to have some triger to use as an indicator for the buffer to start capturing data?

You’ve got several alternatives:

  1. Write your own custom source / sink blocks in Python if you want something more monolithic. Disadvantages: you might run into performance issues, depending on your data transmission rates. It’s also not very simple.
  2. Use TCP / UDP sinks and sources to get or send data from GNU radio to your Python programs. One of these types of blocks is now deprecated, TCP IIRC, the other is still available
  3. Use ZeroMQ sinks and sources in GNU radio to communicate with your Python programs. You need to implement the zmq API in your Python code. This is probably what GNU radio would recommend as well.

There are probably more ways, I’d encourage you to also ask on the GNU radio mailing lists.

1 Like

Thank you!
Indeed UDP and ZeroMQ worked well for me. As oppose to the previously used file based pipe (mkfifo).