User:Muaddib: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==Understanding XMLRPC Blocks==
==Understanding XMLRPC Blocks==
This tutorial presents the GNU Radio XMLRPC blocks. There are two blocks in this collection: [[XMLRPC_Client|'''XMLRPC Client''']] and [[XMLRPC_Server|'''XMLRPC Server''']]. Both blocks have IP address/port fields while the client block also has callback and variable fields. The blocks are simple implementations of the Python XMLRPC module and use a limited subset of the full features of XMLRPC.
This tutorial presents the GNU Radio XMLRPC blocks. There are two blocks in this collection: [[XMLRPC_Client|'''XMLRPC Client''']] and [[XMLRPC_Server|'''XMLRPC Server''']]. Both blocks have IP address/port fields while the Client block also has callback and variable fields. The blocks use the Python XMLRPC module and use a subset of the full XMLRPC spec.


To understand how GNURadio implements XMLRPC, look at the block documentation linked in the paragraph above.  
XMLRPC is an '''XML'''-based '''R'''emote '''P'''rotocol '''C'''ontrol mechanism that does just that. It uses HTTP transport and allows a client to use SET commands to change parameters on a server or use GET commands to obtain the value of parameters on the server.
 
To understand better how GNURadio implements XMLRPC, look at the block documentation linked in the paragraph above.  


To understand the XMLRPC protocol and Python implementation in detail, the reference links below are a good starting point.
To understand the XMLRPC protocol and Python implementation in detail, the reference links below are a good starting point.


==Reference Links==
==Reference Links==
http://xmlrpc.com/
http://xmlrpc.com
 
https://docs.python.org/3.8/library/xmlrpc.html
https://docs.python.org/3.8/library/xmlrpc.html


Line 15: Line 18:


==Introduction: ''What does XMLRPC do in GNURadio and Why Should I Care?''==
==Introduction: ''What does XMLRPC do in GNURadio and Why Should I Care?''==
WHAT: XMLRPC is an '''XML'''-based '''R'''emote '''P'''rotocol '''C'''ontrol mechanism that does just that. A client with access to the server may use SET commands to change a parameter on the server or GET commands to obtain the value of a parameter on the server.
'''WHAT''': In GNURadio placing the XMLRPC Server block in a flowgraph will create an XMLRPC server that exposes all the variables in the flowgraph and allows a client to control them at runtime. The XMLRPC Client block allows the user to control all the parameters of another flowgraph that contains the XMLRPC Server block.
WHY: In many cases, we have need to adjust the variables of a flowgraph at runtime.We usually do this with a QT GUI block. But what if you want to have the same control, but want to have the controller on a different computer? XMLRPC will allow you to run one flowgraph and control all of its variables from a second flowgraph. In fact, the second flowgraph doesn't even have to be on the same computer!
 
'''WHY''': In many cases, we have need to adjust the variables of a flowgraph at runtime. We usually do this with a QT GUI block in the flowgraph we want to control. But what if you want to have the same control interface in a different flowgraph? XMLRPC will allow you to control all of a flowgraph's variables from a second flowgraph using HTTP. In fact, the second flowgraph doesn't even have to be on the same computer!
 
==Building on Knowledge==
 
*First we will start with running the basic client/server example flowgraphs from the GNU Radio source tree (gr-blocks/examples/xmlrpc).
 
*Next, we will add XMLRPC control to flowgraphs from the Narrow Band FM GNURadio tutorial to add remote control capability.
 
*Finally, we will combine ZMQ sockets to stream data into to our control flowgraph so we can display streaming data, allowing us to see the effect of the control messages we send.


A few examples where this might come into play are:
*(OPTIONAL) As a bonus step we will run the server/client pair using 2 computers.
* Remote Narrow Band FM Receiver Station. You have a roof antenna with a short cable run going into a weatherproof box. In the box is an RTL-SDR dongle connected to a Raspberry PI 4 running the flowgraph from the Narrow band FM receiver tutorials. You can hear the audio, but would like to change the frequency at runtime. You'd also like to adjust the gain settings and squelch level while it's running. You can of course use an application to
*control from inside, full visualization (good enough), low-data rate


<talk about XMLRPC server/client>
==Simple Example==
==Simple Example==
<run the source examples>
<run the source examples>


==Headless DSP/GUI Control==
==Add Control Functionality to the NB FM Example==
*Run on localhost
*Run on localhost
*Run on separate machines
*Run on separate machines
Line 32: Line 41:
   *notes about streaming IQ vs Decimated I/Q
   *notes about streaming IQ vs Decimated I/Q
   *show data usage of I/Q vs. decimated I/Q
   *show data usage of I/Q vs. decimated I/Q
==Expand the Remote Controller with Streaming Data==
*audio output to ZMQ

Revision as of 07:49, 22 November 2021

Understanding XMLRPC Blocks

This tutorial presents the GNU Radio XMLRPC blocks. There are two blocks in this collection: XMLRPC Client and XMLRPC Server. Both blocks have IP address/port fields while the Client block also has callback and variable fields. The blocks use the Python XMLRPC module and use a subset of the full XMLRPC spec.

XMLRPC is an XML-based Remote Protocol Control mechanism that does just that. It uses HTTP transport and allows a client to use SET commands to change parameters on a server or use GET commands to obtain the value of parameters on the server.

To understand better how GNURadio implements XMLRPC, look at the block documentation linked in the paragraph above.

To understand the XMLRPC protocol and Python implementation in detail, the reference links below are a good starting point.

Reference Links

http://xmlrpc.com

https://docs.python.org/3.8/library/xmlrpc.html

Prerequisites

Introduction: What does XMLRPC do in GNURadio and Why Should I Care?

WHAT: In GNURadio placing the XMLRPC Server block in a flowgraph will create an XMLRPC server that exposes all the variables in the flowgraph and allows a client to control them at runtime. The XMLRPC Client block allows the user to control all the parameters of another flowgraph that contains the XMLRPC Server block.

WHY: In many cases, we have need to adjust the variables of a flowgraph at runtime. We usually do this with a QT GUI block in the flowgraph we want to control. But what if you want to have the same control interface in a different flowgraph? XMLRPC will allow you to control all of a flowgraph's variables from a second flowgraph using HTTP. In fact, the second flowgraph doesn't even have to be on the same computer!

Building on Knowledge

  • First we will start with running the basic client/server example flowgraphs from the GNU Radio source tree (gr-blocks/examples/xmlrpc).
  • Next, we will add XMLRPC control to flowgraphs from the Narrow Band FM GNURadio tutorial to add remote control capability.
  • Finally, we will combine ZMQ sockets to stream data into to our control flowgraph so we can display streaming data, allowing us to see the effect of the control messages we send.
  • (OPTIONAL) As a bonus step we will run the server/client pair using 2 computers.

Simple Example

<run the source examples>

Add Control Functionality to the NB FM Example

  • Run on localhost
  • Run on separate machines
  *<ssh -L vs. direct IP>
  *notes about streaming IQ vs Decimated I/Q
  *show data usage of I/Q vs. decimated I/Q

Expand the Remote Controller with Streaming Data

  • audio output to ZMQ