Installation And Use for RTLSDRlop-v2a.py
=========================================
Python version: Python 3.5 or higher

######################################################################################################################
Windows installation (open command prompt screen):
==================================================
See https://pypi.org/project/pyrtlsdr/ for the pyrtlsdr installation procedure for Windows and librtlsdr.
The DLL's have to be saved in the same directory as RTLSDRlop-v1a.py

Installation for some extra libraries is done with "pip3" as follows:

Open a terminal screen (Menu --> Windows System --> Command Prompt) and type the following commands:
pip3 install numpy
pip3 install pillow
pip3 install scipy
#######################################################################################################################

Linux installation (open terminal screen):
==========================================
Installation of Numpy, pil.imagetk type the following commands in the Software Manager in the Search window:
"python3-numpy" and install it
"python3-scipy" and install it
"python3-pillow" and install it (not necessary if already installed)
"python3-pil.imagetk" and install it (PIL is already installed)

Installation of librtlsdr:
sudo apt-get install librtlsdr-dev

Installation of pyrtlsdr:
pip3 install pyrtlsdr

#######################################################################################################################

######################################################################################################################
======================
INSTRUCTIONS RTLSDRlop
======================
First install Python and the modules, see the "Install" notes for Linux and Windows here above.

Make a new folder "RTLSDRlop" and save all the (unzipped) files in this ZIP file into this directory.

Make two extra folders "RTLSDRlop/savemap" and "RTLSDRlop/workmap"

On your Menu under Programming  you will find the "Python 3 (IDLE)" and you can open and modify the RTLSDRlop program with it to change the settings as mentioned here above. But all normal settings are done in the configuration file. Modify the settings in the example configuration file "rtlsdr-01.cfg". When RTLSDRlop starts, it loads this configuration file. 

Open the Folder RTLSDRlop in a Terminal and type "python3 RTLSDRlop-vxx.py" (xx is the version number 2a).
And also "python3 LOPEXTftp-v1a.py" if you have chosen the external upload solution 2.
You will see the screen filled with the QRSS signals. Information is printed in the Terminal screen.
Do not start RTLSDRlop when opened with IDLE by selecting "run module", that gives problems after running a few days!

When the tuning frequency is higher than 25 MHz, the VF tuner input is selected. When this frequency is lower than 25 MHz the HF direct sampling input is selected.
#######################################################################################################################

==================================
CONFIGURATION FILE "rtlsdr-01.cfg"
==================================
The 2nd line in the configuration file is the Station name and information about the station

===== CONFIGURE FTP uploads =====
In this section you can select what you want to upload to the FTP site
Choose the external upload solution 2 in the 4th line, then the program does continue during FTP uploads. An FTP upload program "LOPEXTftp-v1a.py" checks every 30 seconds if this file exists, then does FTP upload while Lopora continues and deletes the file after the upload. Use this External Upload! Start to run this program also when you start to run RTLSDRlop. 

===== CONFIGURE STORAGE =====
In this section you can select what you want to save

===== CONFIGURE PARAMETERS =====
Configuration of the parameters.
The Real frequency has to be lower than the START frequency and the START frequency lower than the STOP frequency
The "Frequency setting command for RTL.SDR dongle in Hz" is the frequency used to set the RTL.SDR dongle, but it is not very accurate.
  For PCperformance=0, set this frequency approximately 5 kHz below the start of the QRSS band.
  For PCperformance=1, set this frequency approximately 7 kHz below the start of the QRSS band.
  For PCperformance=2, set this frequency approximately 50 kHz below the start of the QRSS band.
The Real frequency is the real frequency of the RTL.SDR dongle. It changes when you do the calibration by pressing the Calibrate+ and Calibrate- buttons.
  It is the zero beat frequency of the RTL.SDR dongle and can be totally different from the tuning frequency, for example when you use a HF converter.

===== CONFIGURE FILE NAMES =====
Configure the file names of the pictures without .jpg or without .png. The extensions will be added automatically.

===== CONFIGURE FTP SETTINGS =====
The FTP settings, needed to upload files

===== CONFIGURE SPECIAL SETTINGS =====
With the FTP delay you can set a delay in seconds after the end of the scan when the FTP upload will start. It is intended to prevent that more grabbers are uploading at the same moment.
The last setting is for the hour lines. Many points are combined to one point for the hour grab. You can select here if the combination of points should be a maximum of the points, an average of the points of a minimum. I always use the maximum.
#######################################################################################################################

==================================
Settings in the program RTLSDRlop
==================================
And there are also some settings in the beginning og the Python program that can be changed with use of the IDE Idle3:

If you have more than one RTL.SDR dongle connected, change RTLSDRdev = 0 to RTLSDRdev = 1 for the second device.

# ===== SETTINGS FOR RTL.SDR DONGLE AND PC PERFORMANCE =====
RTLSDRcfg = "rtlsdr-01"     # Filename of RTLSDR configuration file
RTLSDRdev = 0               # RTLSDR device n (n = 0....)

PCperformance = 1           # [DEFAULT=1] 0=PC's with low performance; 1=normal; 2=high, no Decimation of data stream
AGCstatus = 0               # [DEFAULT=0] 0=Automatic Gain Control off; 1=on
BIAStee = 0                 # [DEFAULT=0] Bias Tee voltage 0=off; 1=on (ON CAN DESTROY HARDWARE, SUPPLY VOLTAGE AT ANTENNA CONNECTOR!)
BIASenabled = False         # [DEFAULT=False] Set it to True to enable Bias!
                            
You have to set BIASenabled = True if you want to use the BIAS voltage!
The Sample rate and FFT samples are all predefined, depending on the PCperformance settings.

===== SCREEN SETTINGS AND COLORS CAN BE MODIFIED IN THE PROGRAM WITH IDLE =====
The width and height of the screen and borders used for text can be modified and also the colors.
When you use a small monitor, you can give CANVASheight and CANVASwidth a value and you can use the scrollbars to see the whole picture. Otherwise the canvas will be the same size as the picture.

========================================================================================================================
The Buttons:

Compression:
Strong signals are more or less compressed and weak signals just the opposite, more or less enhanced.

Contrast / Brightness:
To adjust the Contrast and Brightness.

Noise Blanker:
For suppressing interference peaks from electric fences.

AGC:
To switch the Automatic Gain Control on or off.
Normally it is switched off. But the sensitivity is higher when switched on. I needed that for the loop antenna.

BIAS:
To switch the Bias voltage on or off. But you have to change the program: set BIASenabled = True to enable this setting!

Select Screen:
The next of the four screens is selected: 1=normal grab, 2=hour grab, 3=daily grab, 4=ten minute grab used for stacking.

PrintOnOff:
Normally, information is printed to the Terminal screen.
But sometimes you want to check this Terminal screen without that new information is printed.
With this button, you can disable or enable the printing to the Terminal screen.

Calibrate:
When the calibration signal of my GPS receiver is shown on the display, I can adjust the TUNE frequency till the signal is displayed at the correct frequency. Calibration is only possible if the displayed frequency range is within the FFT range.

Save setting and reload:
The configuration will be saved. During start-up, the configuration "rtlsdr-01.cfg" will be loaded.

FTP status:
The FTP upload can be disabled, enabled or set to External Upload required. When an External Upload is required, the filenames and FTP parameters
are stored in "FTPuploads.txt". An FTP upload program "LOPEXTftp-v1a.py" checks every 30 seconds if this file exists, then does FTP upload while Lopora continues and deletes the file after the upload. Use this External Upload!

GO OFFLINE:
The text "OFFLINE" is added to the picture, the picture is uploaded to the FTP site and the FTP upload is disabled.
