|
| 1 | + |
| 2 | +rtl_fm now has option '-C' for a command file, from which a list of frequencies are read. |
| 3 | +So it's similar to using a frequency range, as with "-f 118M:137M:25k" |
| 4 | +The difference is, that you can parametrize one frequency per line together with |
| 5 | +- the tuner gain |
| 6 | +- condition for triggering |
| 7 | +- measurement duration |
| 8 | +and a command to execute. |
| 9 | +Lines starting with '#' are skipped / interpreted as comments. |
| 10 | +Parameters a seperated by comma. |
| 11 | + |
| 12 | +Here's an example: |
| 13 | +--- |
| 14 | +# freq in Hz or special keyword, gain in dB, trig_crit (in/out/lt/gt), trig_level, trig_tolerance, #meas, #blocks, trigger_command |
| 15 | +# windows: rtl_fm -f 105.2m -E rdc -w 350k -s 200k -m 2.2m -B 200000 -C cmdfile.csv -n -v |
| 16 | +# rtl_fm -f 105.2m -E rdc -w 350k -s 200k -m 2.2m -W 4 -B 10000 -C cmdfile.csv -n -v |
| 17 | +# linux: ./rtl_fm -f 105.2m -E rdc -w 350k -s 200k -m 2.2m -B 200000 -C cmdfile.csv -n -v |
| 18 | +# |
| 19 | +# windows command examples: |
| 20 | +# cmd.exe, /C echo hello world |
| 21 | +# cmd.exe, /C start notepad |
| 22 | +# calc.exe |
| 23 | +# |
| 24 | +# linux examples: |
| 25 | +# ssmtp |
| 26 | +# sendxmpp |
| 27 | +## for piping some message to ssmtp or sendxmpp you'll need to write small scripts |
| 28 | + |
| 29 | +# 'adcmax' keyword in first column activates measurement of max adc value at capture rate to determine optimum gain and avoid oversteering |
| 30 | +# 'adcrms' keyword activates rms calculation at capture rate. for usual it's similar to adcmax. there are differences in case of oversteering |
| 31 | +# activate verbose output (option '-v') to get the output. The maximum possible sample value is 128. |
| 32 | +# You should have approx. 6 dB headroom to allow measuring stronger signals, that means measured baseline values should be below 64. |
| 33 | +# An the other side you'll want to measure weaker signals, so the measured baseline value should be above a minimum of approx 8 or 16. |
| 34 | +adcmax, |
| 35 | +adcrms, |
| 36 | +100.7m, 30, in, 0, 1, 10, 100, |
| 37 | +33.0m, 20,out,60, 3, 10, 400, /home/odroid/test/simple.sh, frq !freq! gain !gain! measured !mlevel! tenth dB !crit! { !reflevel! +/- !reftol! tenth dB } |
| 38 | +# now check for optimal gain in some steps, which should be done per frequency!: |
| 39 | +100.7m, 0, gt, 400, 1, 1, 100, |
| 40 | +100.7m, 3, gt, 400, 1, 1, 100, |
| 41 | +100.7m, 6, gt, 400, 1, 1, 100, |
| 42 | +100.7m, 12, gt, 400, 1, 1, 100, |
| 43 | +100.7m, 18, gt, 400, 1, 1, 100, |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +* first frequency is 100.7 MHz, tuned with ~ 30 dB tuner gain; |
| 48 | +condition is 'in' { 0 +/- 1 } dB, |
| 49 | +with 10 measurements, averaging the rms level in dB. |
| 50 | +Each single measurement is processed after decimation of block/buffer-size many samples (see option -W). |
| 51 | + The resulting number of decimated samples might get too small to allow a reliable measurement. |
| 52 | + This number also depends on the capture rate: ensure minimum capture rate with option '-m'. This is also important for reducing aliases. |
| 53 | + Check the output 'block length after decimation is ... samples'! |
| 54 | +If condition for measured level is true, then a command can be triggered, which is executed in background. |
| 55 | +Then, a next trigger for this frequency is blocked for 100 measurements. |
| 56 | +There is nothing triggered for 100.7 MHz. |
| 57 | + |
| 58 | +* 2nd frequency is 33.0 MHz, tuned with ~ 20 dB tuner gain; |
| 59 | +condition is 'out' { 60 +/- 3 } dB, |
| 60 | +with 10 measurements. |
| 61 | +That means, the trigger is activated when averaged level is below 57 dB or above 63 dB. |
| 62 | +Next trigger for this frequency is blocked for 400 measurements. |
| 63 | +Triggered command is the shell script '/home/odroid/test/simple.sh', |
| 64 | +with the arguments 'frq !freq! gain !gain! measured !mlevel! tenth dB !crit! { !reflevel! +/- !reftol! tenth dB }'. |
| 65 | +You can use following keywords in the arguments, which need to be free standing!: |
| 66 | +- !freq! |
| 67 | +current frequency in Hz |
| 68 | + |
| 69 | +- !gain! |
| 70 | +current tuner gain in tenth dB to allow easier evaluation from scripts. |
| 71 | + |
| 72 | +- !mlevel! |
| 73 | +average measured level in tenth dB |
| 74 | + |
| 75 | +- !crit! |
| 76 | +one of "in", "out", "<" or ">" for the tested condition |
| 77 | + |
| 78 | +- !reflevel! |
| 79 | +condition's reference level in tenth dB |
| 80 | + |
| 81 | +- !reftol! |
| 82 | +condition's reference tolerance in tenth dB |
| 83 | + |
| 84 | + |
| 85 | +Application might be monitoring of some stations |
| 86 | +and triggering a notification, e.g. via ssmtp or sendxmpp, |
| 87 | +when a stations power level is below it's expected value. |
| 88 | + |
| 89 | +Another application might be triggering a recording with a second RTL dongle. |
| 90 | + |
| 91 | + |
| 92 | +Send comments, suggestions or reports to |
| 93 | + |
| 94 | + |
0 commit comments