Project

General

Profile

nRfMon - nano spectrum analyzer with the RFM12B

A software spectrum analyzer for the RFM12B transceiver module running in a JeeNode or an Arduino. Use this program to visualize what the RFM12B transceiver module “hears” in the 433, 868 or 915 MHz bands.

nRf Mon tries to visualize what’s happening on the radio waves when transmitting and get an understanding of the physical qualities involved. Based on an idea that initiated in the JeeLab forums, a sample sketch and JeeLib, it provides a basic spectrum analyzer with a waterfall display along with normal frequency and time domain displays of the signals, as they are heard by the very same RFM12B module employed in the board.

This tool is written in the Tool Command Language, TCL, a great scripting language for developing such utilities. It is accompanied by a sketch, which must to be uploaded to the Jeenode or whatever Arduino or compatible board the RFM12B module under test is connected to. The source code can be found here: https://github.com/dzach/nrfmon . This project is also discussed in the JeeLabs forum thread nRfMon - RFM12B forensics .

Here is a snapshot of the main window:

To see what RfMon can do, you need to upload the rf12mon.ino sketch to a JeeNode (or any other Arduino type node) that’s equipped with an RFM12B module, connect the node through USB to a computer and run rfmon.tcl or the binary executable rfmon. That last one will give you the spectrum analyzer GUI. If you want to check a radio communications path, you obviously need two nodes. The second one could be a node running the rf12cw.ino sketch, which transmits on/off signals non-stop that are easily distinguishable from the background noise or other signals that may be present in the band. Power that node up and leave it somewhere at a distance from the computer that runs the spectrum analyzer. Or, you could open two RfMon windows and connect to two different RFM12B nodes running the same rf12mon.ino sketch. RfMon can receive and transmit, so it can be used in both roles as well.

These are the basic commands that the spectrum analyzer, running in the node, understands. They are mostly intended for machine-to-machine use:

       v : version string and summary of system information
    g : JeeLib group, same as in RF12Demo
    i : Node id, same as in RF12Demo
   c : transmitter channel. Changing frequency in the RFM12B is done in steps of 5kHz 
           (for the 868MHz band). These steps define 5kHz wide channels. 
           There are 3808 channels in an RFM12B band.
    b : band number, 1 for the 433, 2 for the 868 and 3 for the 915MHz band. 
           Different numbering than the RF12Demo
   l : defines the lower channel for a scan.
   u : defines the upper channel for a scan
    z : defines how many channels the analyzer should skip to move to the next frequency
           to measure. This depends on the receiver bandwidth, too small a number and we 
           might be receiving the same signal, despite having moved to another channel
           during a scan. l,u and z sent to the analyzer stop the ongoing scan.
       s : start scanning. If the scan was stopped with an l, u or z command,
           sent an 's' to restart it
      1s : Start ASCII art waterfall. Send this command if you don't want 
           (or cannnot) run RfMon GUI and you only have the Arduino IDE 
           to play with. The waterfall is centered on channel 1600 (868.0000MHz)
           and is 800 channels wide (4MHz). Can be changed with l, u and z.
    p : attenuate the power output (in steps of 2.5dB). 0 is no attenuation
           (full power), 7 is full attenuation (-17.5dB)
   x : transmit a carrier for  seconds continuously, on the chosen channel, 
           with the selected power, and then stop.
,x : transmit for  seconds then pause for  seconds and repeat non-stop. 
           Send anything to stop the transmission, preferably z (or s to start scanning)
,..r : set registers in RFM12B. You have to know what you are doing, to use this one

  where:
   is an unsigned integer, values from 0 to 255 (0xFF)
   is an unsigned integer, values from 0 to 65535 (0xFFFF)

Here are some “secrets” that could be useful:
# Connect to the spectrum analyzer by choosing (or typing) the comms port in the combobox on the upper right of the GUI window. Disconnect by choosing ‘Disconnect’ or the empty space.
# On the lower right side of the window there is a little console showing what is sent or received between the RfMon GUI and the RFM12B equipped JeeNode, running the rf12mon.ino sketch. The console also accepts user commands, in the form described above.
# Click on the waterfall to change the transmitter frequency.
# Roll the mouse over the RX Bandwidth field in the Quick settings panel, to see the green band, indicating the receiver’s bandwidth, grow or shrink. As the bandwidth increases so does the noise received from the wider band. With a wider band you need a stronger signal to defeat the increased noise. But you can also pass data faster.
# Shift drag on the waterfall, or right click and choose ‘Limit scan width’ and drag, to limit the width of the scan to the zone that is specified (red rectangle while dragging). The smaller the size of the zone, the faster the scan. Right click on the spectrum screen and choose ‘Full scan width’ to reset the scan width.
# Shift click (aim carefully) to run a single channel “scan” in 1-7ms time per line. That’s actually not a scan but a display in the time domain of the signal strength of whatever exists within the RX bandwidth of the chosen channel.
# LNA gain reduces the sensitivity of the receiver and may help with problems e.g. when a nearby transmitter is overloading the front end of the receiver, but it also reduces the desired signal. Now, increase the RX bandwidth to, let’s say, 400kHz. The receiver gets very noisy, and you may need about 14dB of LNA attenuation to clear the signal. Set the LNA gain back to 0 and increase the RSSI threshold one click, to –97dB. See?
# RfMon stores nothing in EEPROM so, if you are stuck, just reset, reconnect or toggle the power and you are good to go again.

nRfMon.png (976 Bytes) dzach, 2013-02-20 10:39

nRfMon_v0_6.png (179 KB) dzach, 2013-02-20 10:55