Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 parsing correction for priority and lockout and new command switches #37

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9d6ed6d
Small changes to adapt to Python 3 on GNURadio 3.8
ta6o Jan 21, 2020
a8eabf4
Fixing import command and GRC examples
ta6o Jan 21, 2020
be49ee6
Merge pull request #1 from ta6o/master
lordmorgul Dec 6, 2020
29660e6
Committer: Andrew Farris <[email protected]>
Dec 6, 2020
5b74052
Committer: Andrew Farris <[email protected]>
Dec 6, 2020
18b64ac
Committer: Andrew Farris <[email protected]>
Dec 6, 2020
9aa26c6
Modified gui to track active channels coming out of scanner and highl…
Dec 21, 2020
d5152a2
Modified cursesgui.py with fixes for stability of screen draw, call e…
lordmorgul Dec 23, 2020
f6fd245
revised use of color with more options to be easily adjusted by other…
lordmorgul Dec 23, 2020
bb64a61
Set channel window channel indexes to zero pad to align them.
lordmorgul Dec 31, 2020
5128b48
Fixed attributions ahead of time in README for pending pull from john…
lordmorgul Dec 31, 2020
f0e49d9
Initial capture of logger branch manual merge from kibihrchak
lordmorgul Dec 31, 2020
a12abb1
Added documentation from previous work logger branch and added a acti…
lordmorgul Jan 2, 2021
f838a9e
Log file framework improvements, exceptions to raise log error, and a…
lordmorgul Jan 2, 2021
a1f84a3
File logging under test but appears stable. Format string edited to …
lordmorgul Jan 3, 2021
42d90d8
corrections to README and added screenshots for gui and logger updates
lordmorgul Jan 4, 2021
a8b8319
Update README.md
lordmorgul Jan 4, 2021
2ca9210
cleanup README attempt again
lordmorgul Jan 4, 2021
7732aaa
Initial capture of demodulator long runtime kill and gain set and fil…
lordmorgul Jan 5, 2021
34b1232
Corrected missing timestamp initialization in demod constructor
lordmorgul Jan 5, 2021
b31b005
Fixed possibility of reference timestamp before init
lordmorgul Jan 5, 2021
b08207d
Added command line switches for channel spacing with default 5000, an…
lordmorgul Jan 8, 2021
0295f45
Fixed "Q" terminate cleans up demodulators (set all to baseband)
lordmorgul Jan 8, 2021
9f95629
README fixes for latest features and command line flags, parser corre…
lordmorgul Jan 8, 2021
38d3c16
feature addition cleanups, removal extraneous comments and commented …
lordmorgul Jan 23, 2021
fd9d4cd
Merge branch 'master' of https://github.com/lordmorgul/ham2mon
lordmorgul Jan 23, 2021
883a329
adding png graphic showing example of processor usage on 8 core laptop
lordmorgul Mar 12, 2022
1f8d444
Andrew Farris
lordmorgul Mar 27, 2022
e7e8b39
Andrew Farris
lordmorgul Mar 27, 2022
88df396
Modified gui code for simplicity rearranging outputs if desired
lordmorgul Apr 2, 2022
c1eeb37
updated change log history including miweber67 contribution captured
lordmorgul Apr 2, 2022
f60c600
Added center_freq to constructor params for Scanner to provide abilit…
lordmorgul Apr 2, 2022
0325c84
Clean personally relevant freqs out of priority examples, GMRS channe…
lordmorgul Apr 9, 2022
8a85570
Andrew Farris
lordmorgul Mar 27, 2022
b48a07b
Andrew Farris
lordmorgul Mar 27, 2022
d5bc9fc
Modified gui code for simplicity rearranging outputs if desired
lordmorgul Apr 2, 2022
f52a936
updated change log history including miweber67 contribution captured
lordmorgul Apr 2, 2022
10e5042
Added center_freq to constructor params for Scanner to provide abilit…
lordmorgul Apr 2, 2022
6d5a8ea
Clean personally relevant freqs out of priority examples, GMRS channe…
lordmorgul Apr 9, 2022
dd5738d
Merge branch 'gui-devel'
lordmorgul Apr 9, 2022
9866eec
fixed freq_low
Nov 6, 2023
96068bd
testing note
Nov 7, 2023
30dc2e1
Merge pull request #13 from john-/airspy_test
lordmorgul Nov 9, 2023
e92838c
Merge pull request #10 from john-/fix_freq_low
lordmorgul Nov 9, 2023
50f4d7f
remove unused code
Nov 13, 2023
393c37a
Merge pull request #14 from john-/remove-unused-code
lordmorgul Nov 24, 2023
a059c00
Priority demod assignment (#18)
lordmorgul Feb 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 89 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,61 @@ This is a GNU Radio (GR) based SDR scanner with a Curses interface, primarily me

http://youtu.be/BXptQFSV8E4

![GUI screenshot](https://github.com/madengr/ham2mon/blob/master/ham2mon.png)
Original screenshot
![GUI screenshot](https://github.com/lordmorgul/ham2mon/blob/master/ham2mon.png)

Additional screenshots show updated screen color and channel highlighting with
![GUI screenshot](https://github.com/lordmorgul/ham2mon/blob/master/ham2mon_priority_channels_inactive_noise.png)
![GUI screenshot](https://github.com/lordmorgul/ham2mon/blob/master/ham2mon_priority_channels_active.png)
![GUI screenshot](https://github.com/lordmorgul/ham2mon/blob/master/ham2mon_priority_channels_overmax.png)


## Tested with:
Recent development and tests on Python3:
- RTL-SDR v3 RTL2832 + R820T at 2 Msps (http://rtl-sdr.com)
- NooElec RTL2832 + R820T at 2 Msps (http://www.nooelec.com)
- GNU Radio 3.8.2.0 (https://github.com/gnuradio/gnuradio)
- GrOsmoSDR 0.1.4-29 (http://sdr.osmocom.org/trac/wiki/GrOsmoSDR)
- Airspy Mini (https://airspy.com/airspy-mini/)
- Python 3.8.6

Previous version tests:
- Ettus B200 at 16 Msps (http://www.ettus.com)
- NooElec RTL2832 + R820T at 2 Msps (http://www.nooelec.com)
- GNU Radio 3.7.10 (https://github.com/gnuradio/gnuradio)
- GrOsmoSDR 0.1.4 (http://sdr.osmocom.org/trac/wiki/GrOsmoSDR)
- Ettus UHD 3.10.0 (https://github.com/EttusResearch/uhd)

## Contributors:
lordmorgul:
- Min and max spectrum switches
- Python3 builtin functions correction for priority and lockout parsing
- Example priority and lockout files
- Spectrum bar coloration (min/threshold/max)
- Active channel tracking and coloration
- GUI adjustments in channel and receiver windows, borders and labels
- priority, lockout, and text log file name displays
- pulled logger framework from kibihrchak and revised to python3
- log file framework with enable flags (to prepare for multiple loggers implemented, text and database)
- log file timeout so active channels are indicated only every TIMEOUT seconds
- pulled long run demodulator fix to python3 version from john
- pulled gain corrections to python3 version from john
- defined max file size to save from command line option
- channel width configurable from command line option
- incorporate miweber67 freq range limits

miweber67
- frequency range to limit selected channels to within specific limit

john-:
- long running file end (demodulator run time limit)
- gain config corrections, available gains detected from gnuradio and other inputs ignored / not shown

kibihrchak:
- Logger branch text file log entries

ta6o:
- Initial python3 fixes for syntax

m0mik:
- Added HackRF IF/BB gain parameters
Expand All @@ -36,8 +81,11 @@ madengr:
- AM demodulation
- Priority channels


## Console Operation:

Options are displayed using ./parser.py -h

The following is an example of the option switches for UHD with NBFM demodulation, although omission of any will use default values (shown below) that are optimal for the B200:

./ham2mon.py -a "uhd" -n 8 -d 0 -f 146E6 -r 4E6 -g 30 -s -60 -v 0 -t 10 -w
Expand All @@ -58,13 +106,21 @@ Example of reading from an IQ file:

./ham2mon.py -a "file=gqrx.raw,rate=8E6,repeat=false,throttle=true,freq=466E6" -r 8E6 -w

##Channel Detection Log File

For console operation, it is possible to specify the log file name, in which channel detection, and removal will be logged. The option is `--log_file=<file-name>`.

Whenever a channel appears/dissapears, new line will be written in the log file. For the line format, check `__print_channel_log__()` in `scanner.Scanner`.

Active channels are flagged as active periodically based on the active channel logging timeout.

## GUI Controls:

`t/r = Detection threshold +/- 5 dB. (T/R for +/- 1dB)`

`p/o = Spectrum upper scale +/- 10 dB`
`p/o = Spectrum upper scale +/- 5 dB`

`w/q = Spectrum lower scale +/- 10 dB`
`w/q = Spectrum lower scale +/- 5 dB`

`g/f = RF gain +/- 10 dB (G/F for +/- 1dB)`

Expand Down Expand Up @@ -92,6 +148,8 @@ Example of reading from an IQ file:

`CTRL-C = quit`

`SHIFT-R = quit`

## Help Menu

`Usage: ham2mon.py [options]`
Expand All @@ -112,6 +170,9 @@ Example of reading from an IQ file:
` -f CENTER_FREQ, --freq=CENTER_FREQ`
` Hardware RF center frequency in Hz`

` -e RANGE, --range=RANGE`
` Limit reception to specified range, xx-yy in Hz`

` -r ASK_SAMP_RATE, --rate=ASK_SAMP_RATE`
` Hardware ask sample rate in sps (1E6 minimum)`

Expand All @@ -121,9 +182,15 @@ Example of reading from an IQ file:
` -i IF_GAIN_DB, --if_gain=IF_GAIN_DB`
` Hardware IF gain in dB`

` -j IF_GAIN_DB, --lna_gain=LNA_GAIN_DB`
` Hardware LNA gain in dB`

` -o BB_GAIN_DB, --bb_gain=BB_GAIN_DB`
` Hardware BB gain in dB`

` -x MIX_GAIN_DB, --mix_gain=MIX_GAIN_DB`
` Hardware MIX gain in dB`

` -s SQUELCH_DB, --squelch=SQUELCH_DB`
` Squelch in dB`

Expand All @@ -141,6 +208,12 @@ Example of reading from an IQ file:
` -p PRIORITY_FILE_NAME, --priority=PRIORITY_FILE_NAME`
` File of EOL delimited priority channels in Hz`

` -L CHANNEL_LOG_FILE_NAME, --log-file=CHANNEL_LOG_FILE_NAME`
` File for output of channel activity (demod lock/unlock) and active channels detection`

` -A LOG_ACTIVE_TIMEOUT, --log_active_timeout=LOG_ACTIVE_TIMEOUT`
` Timeout delay between marking a channel active in the log file in seconds`

` -c FREQ_CORRECTION, --correction=FREQ_CORRECTION`
` Frequency correction in ppm`

Expand All @@ -149,6 +222,19 @@ Example of reading from an IQ file:
` -b AUDIO_BPS, --bps=AUDIO_BPS`
` Audio bit depth (bps)`

` -M MAX_DB, --max_db=MAX_DB`
` Spectrum window maximum in dB`

` -N MIN_DB, --min_db=MIN_DB`
` Spectrum window minimum in dB`
` -k MAX_DEMOD_LENGTH, --max-demod-length=MAX_DEMOD_LENGTH`
` Maxumum length for a demodulation (sec)`
` -B CHANNEL_SPACING, --channel-spacing=CHANNEL_SPACING`
` Channel spacing (spectrum bin size)`
` -F MIN_FILE_SIZE, --min-file-size=MIN_FILE_SIZE`
` Minimum size file to save in bytes, default 0 (save all)`



## Description:
The high speed signal processing is done in GR and the logic & control in Python. There are no custom GR blocks. The GUI is written in Curses and is meant to be lightweight. See the video for a basic overview. I attempted to make the program very object oriented and “Pythonic”. Each module runs on it's own for testing purposes.
Expand Down
2 changes: 1 addition & 1 deletion apps/am_flow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print "Warning: failed to XInitThreads()"
print("Warning: failed to XInitThreads()")

from PyQt4 import Qt
from gnuradio import analog
Expand Down
Loading