German version see readme_de.md
Hayati Aygün (E-Mail: h_ayguen@web.de, ported to Markdown by Andreas Mikula (E-Mail: andimik@yahoo.de)
558E C9EF 3EAB 05E8 76AF 61DC D44C 9772 6FA1 CC0B
FMLIST_Scan, hereinafter referred to as the "Scanner," was initiated by Günter Lorenz. The scanner is intended to collect station information for the FMLIST (https://www.fmlist.org/, station database of the UKW/TV-Arbeitskreis e.V.). The project was first presented on September 8, 2018, at the FM Conference in Weinheim (see https://ukw-tagung.org/).
The manuscript is available at https://codingspirit.de/Linux-ist-sexy-Freiheit-Skript.pdf, and the slides at https://codingspirit.de/Linux-ist-sexy-Freiheit-Folien.pdf
The manuscript and slides will be updated as needed, so the most recent version should always be accessed via the links above. The current source code is also available: https://github.com/hayguen/fmlist_scan
The instructions require the following:
- Raspberry Pi 3B+ including a suitable power supply (Note: a Pi 3B also works, but you'll need to perform the setup yourself for a Pi 4)
- 16 GB micro SD card
- USB flash drive
- Temporary (if necessary): USB keyboard
- Temporary (if necessary): Display and, if necessary, an adapter for the Raspberry Pi's HDMI port
- Temporary (if necessary): PC or notebook, micro SD reader, or adapter to a micro SD card
- Wi-Fi or Ethernet cable to a router with internet access
- RTL-SDR with an RTL2832 chip and an R820T or R820T2 tuner – ideally with a short USB extension cable
Here's a complete Amazon shopping list, including optional parts but excluding any temporarily required equipment:
Alternatively, go to https://www.amazon.de/ and select "Find List" in the "My Lists" menu, then search for "fmlist."
First, you need to download an operating system image to your PC or laptop. Depending on the amount of time you want to invest, you'll need to choose an image. 64-bit and 32-bit versions of Raspberry OS are now available:
https://www.raspberrypi.com/software/operating-systems/
Debian 12 (Bookworm) and Debian 11 (Bullseye) have been supported and tested with the scanner. Older versions based on Debian 9 (Strech) or Debian 10 (Buster) can theoretically still be used, but their support ended several years ago.
https://de.wikipedia.org/wiki/Debian
Next, you need to follow the steps in sections 3.2.3 "Setting up the Raspberry OS image - manually installing FMLIST_Scan" and 4.1 "Installing the scanner."
If you don't want to invest quite so much time, you can download a ready-made image for a Raspberry Pi 3B or 3B+, including pre-installed software and a scanner. It takes up approximately 6.5 GB of space when unpacked and is based on the (older) Raspbian image with desktop from November 13, 2018:
https://drive.google.com/drive/folders/11NYMjgJuYaQGRc15-NkYrLblvWgHeep3?usp=sharing
ℹ️ Note: Sections 3.2.2 and 4.1 are omitted with this image.
While the selected image is being downloaded and written, you can begin assembling the hardware (Raspberry Pi heatsink, fan, ATX LEDs, and buttons). See Section 4.3 Connecting ATX Buttons, LEDs, and Beepers.
On Windows, you will need a program to unpack the .img.gz compressed image, e.g., using 7-zip: http://www.7-zip.de/ . After downloading the compressed image and installing 7-zip, unpack the image.
Insert the micro SD card.
To write the image to the micro SD card, see the instructions at https://www.raspberrypi.org/documentation/installation/installing-images/README.md
On Windows, Etcher is also required: https://www.balena.io/etcher/ . Etcher can write compressed images (.zip, .gz, and others) to the SD card without first unpacking.
If the existing monitor doesn't support the required high resolution – or if in doubt:
- Remove the SD card and reinsert it.
- DO NOT format it!
- Open the drive (boot partition).
- Open the
config.txtfile with a text editor. - In the line with
hdmi_safe=1, remove the cross/hash symbol#at the beginning of the line. - Save the file, close the editor, and safely remove the SD card.
To be able to work with SSH immediately:
Create an empty file named ssh (without an extension) in the drive. Remove the extension later if necessary.
D:
If necessary, change the letter. This means: switch to drive D: on the SD card.
type NUL >ssh
create an empty “ssh” file
dir
Now the file is checked
exit
End the prompt
To ensure the Raspberry Pi connects to the Wi-Fi network right from the start (read the gray box for group setup in Chapter 3.2 first!):
Create a wpa_supplicant.conf file in your drive. Enter the following content in a text editor:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE
network={
ssid="IHR_NETZWERK_NAME"
psk="IHR_NETZWERK_PASSWORT"
}
For operation on multiple networks, multiple network sections can be specified. Networks can be customized later—after installation—by editing the /etc/wpa_supplicant/wpa_supplicant.conf file.
The default settings for both installation variants (in sections 3.2.2 and 3.2.3) are:
| Type | Code |
|---|---|
| Computer name | raspberrypi |
| Username | pi |
| Password | raspberry |
When entering the password using the manual installation via 3.2.3, please ensure that the US 🇺🇸 keyboard layout is still present. Therefore, y and z are swapped!
The prepared image for a Raspberry 3B+ and 3B (not 4B) can be downloaded from the following link: https://drive.google.com/drive/folders/11NYMjgJuYaQGRc15-NkYrLblvWgHeep3?usp=sharing
scanner123.
It must be written to the SD card as described in the previous section 3.1 Preparing the Micro SD Card.
Despite the pre-installed software, further steps are still necessary:
- Change the password, change the computer/hostname; e.g., in the GUI via the main menu (raspberry in the top left corner), then Preferences and "Raspberry Pi Configuration".
- In the "Raspberry Pi Configuration" dialog, you may want to consider disabling the GUI and booting "To CLI." Or disabling automatic login.
- WLAN settings can be configured in several ways:
3.1 In the GUI, top right
3.2 Open Terminal / Xterm: there, type
sudo raspi-configand select 2 Network Options and N2 Wi-fi 3.3 Edit the file withsudo nano /etc/wpa_supplicant/wpa_supplicant.conf. The information you need to enter here can be found, for example, in section 3.1 Preparing the Micro SD Card. - Expand the partition size to fit the entire SD card:
Open Terminal / Xterm: there, type
sudo raspi-configand select7 Advanced Options, A1 Expand Filesystem. A reboot is required afterward. - Adjust the fmlist_scan configuration; See the end of Section 4.2 Configuration and Automatic Activation of the Scanner
Update the system and then restart to activate the new configuration:
sudo apt-get update && apt-get upgrade && reboot now
sudo apt-get upgrade reports the error message
The following packages have unmet dependencies
with vlc-bin and E: Broken packages at the end. Manually installing vlc-bin helps:
sudo apt install vlc-bin
After the micro SD card with the Raspberry OS operating system has been prepared, you can start the system for the first time:
- Insert the micro SD card into the Raspberry Pi
- If necessary, connect the monitor via HDMI, USB keyboard, USB flash drive, and possibly also Ethernet
- Finally, connect the power supply (please only use recommended power supplies!)
For group setups on the same network/Wi-Fi (e.g., in a workshop), all devices would have the same conflicting computer name! Therefore, all steps up to and including changing the computer name must be performed individually. So, agree on the order, then exit raspi-config and shut down the Raspberry Pi with
sudo reboot now
so that the next participant can get started. Alternatively, you can configure directly via the keyboard/screen until the computer name is set up, including the reboot.
You can now see the Raspberry OS system booting with the hostname raspberrypi until you reach the login screen.
- The username is
pi - The password is
raspberry. When entering this password, make sure that you are still using the US keyboard layout. Therefore, y and z are swapped!
If you have enabled SSH and connected your network or configured your Wi-Fi correctly, you can connect via SSH/PuTTY. The keys for logging in and entering your password are not swapped due to remote access. From a Linux operating system, simply enter
ssh pi@raspberrypi
to connect.
You will then see the $ prompt. You can enter commands here. The $ indicates that you are logged in as a "normal" user.
With the command
sudo
individual administration commands can be launched, e.g., for installing software. If you want to enter multiple administration commands at once, start a new command prompt with
sudo bash
which announces itself with #. Here, you can enter the administration commands without the additional sudo. With
exit
you exit the command prompt or log off the system.
In the following, the $ indicates that a command should be entered. The # character and the following text are comments; neither of these should be entered and are provided only for clarity.
The configuration starts with
sudo raspi-config
Note: In the US keyboard layout, - is located on the ß key.
A text-based menu opens:
- Set keyboard layout – only works when logged in directly (without SSH):
4 Localisation Options → I3 Change Keyboard Layout → Generic 105 key (Intl) PC
→ Other → German → German (eliminate dead keys)
→ Enter (default für AltGr) → Enter (default für Compose key = No)
• Passwort des Benutzers pi ändern:
1 Change User Password
• Rechnername individualisieren:
2 Network Options → N1 Hostname →
z.B. rpi001, rpi002 oder scanner001 oder beliebig selbst auswählen
Der Name sollte im eigenen Heim-Router auftauchen, so dass man sich die IP-Adresse(n)
– insbesondere für WLAN – aufschreiben kann. Ggf. kann man die IP-Adresse im Router fixieren, sodass diese sich nicht von alleine ändert.
• ggf. WLAN einrichten – wenn noch nicht über wpa_supplicant.conf eingerichtet:
2 Network Options → N2 Wi-fi → DE → SSID → passphrase
• Optional die Netzwerk Interface Bezeichnungen umstellen:
2 Network Options → N3 Network interface names → No
• Zeitzone einstellen:
4 Localisation Options → I2 Change Timezone → None of the above → UTC
• Sprachen einstellen:
4 Localisation Options → I1 Change Locale → alle de_DE_* sowie en_US_* sowie ggf. weitere auswählen und bestätigen. Anschließend den default setzen, z.B. „C.UTF-8“.
• WLAN Region einstellen:
4 Localisation Options → I4 Change Wi-fi Country → DE Germany
• SSH für Fernzugriff aktivieren – wenn noch nicht über die „ssh“ Datei konfiguriert:
5 Interfacing Options → P2 SSH → Yes (SSH server)
• Grafikspeicher ggf. (wenn nicht benötigt) reduzieren, dass mehr für den Scanner verbleibt:
7 Advanced Options → A3 Memory split → 16
• Audioausgabe immer über 3,5 mm Klinke, dass unabhängig von HDMI Nutzung:
7 Advanced Options → A4 Audio → 1 Force 3.5mm
• System aktualisieren:
8 Update
• Konfigurationsprogramm beenden
Finish → mit Tabulator Taste (links von Q) und Enter bestätigen
Update the system and then restart to activate the new configuration:
sudo apt-get update && apt-get upgrade && reboot now
Due to the change in the computer name, the next login via SSH/PuTTY must be confirmed accordingly.
Then log in at the login screen with the newly assigned password, unplug/disconnect the network cable if necessary, and check the IP address(es):
ifconfig
Check the IP address on the router and fix it so that the Raspberry Pi always receives the same address.
You can now log out of the Raspberry Pi locally and log in via SSH or PuTTY (Windows, http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html). This only works if the SSID and passphrase are configured correctly; repeat the configuration if necessary.
Under Windows, you should also install WinSCP for file transfer: https://winscp.net/ . For wired access with your laptop while on the go, see http://www.dhcpserver.de/cms/ . For setting up multiple WLANs, see http://bit.ly/2xO4H7T (stackexchange.com).
This section can be skipped if you are using the prepared image for a Raspberry 3B or 3B+ as described in section 3.2.2.
The following commands must be entered at the command prompt (local or SSH) of the Raspberry Pi system.
The scanner requires sudo privileges without prompting for a password. This is already configured for Raspberry OS. Other operating systems may require this if sudo bash asks for a password:
sudo nano /etc/sudoers.d/010_user-nopasswd
The file name 010_user-nopasswd can be customized to the username.
In the nano editor, enter the following line under "Customize the username user":
user ALL=(ALL) NOPASSWD:ALL
Use the correct username instead of user! Save the file and close the editor.
Downloading the scanner requires the version control system git. Install with:
sudo apt install -y git
Now log in as the appropriate user – usually pi – under which the scanner should also run.
Download the scanner source code:
git clone https://github.com/hayguen/fmlist_scan.git
cd fmlist_scan
The most important installation parameters can be adjusted in the setup.sh file:
cat setup.sh
#export FMLIST_SCAN_USER="hayguen" # default user "pi"
#export FMLIST_SCAN_RASPI="0" # default "1" if Raspberry Pi hardware
The user name can be adjusted in the line with FMLIST_SCAN_USER. The line with FMLIST_SCAN_RASPI indicates that the hardware is Raspberry Pi.
# at the beginning of the line must be removed.
nano setup.sh
Then start the installation (as superuser) with:
sudo ./setup.sh
If necessary, monitor the temperature in a second SSH session:
while true; do cat /sys/class/thermal/thermal_zone0/temp ; sleep 3 ; done
This step takes a while because additional software for the Raspberry OS system is downloaded and installed. Furthermore, some programs are downloaded from GitHub in source code, compiled (built), and installed. So you have plenty of time for a cup of tea or coffee ☕ 😉
After installation, you should check the configuration file(s):
| Command | Explanation |
|---|---|
sudo nano /etc/fstab |
Check device for USB flash drive! |
crontab -e |
Automatically start the scanner on @reboot Note: The "#" can be commented out |
The configuration can be edited with the following command.
ℹ️ It's best to take your time with this step and read through the comments carefully!
nano ~/.config/fmlist_scan/config
The file ~/.config/fmlist_scan/config contains the most important scanner settings:
| Setting | Notes |
|---|---|
| FMLIST_SCAN_DEAD_REBOOT | Set to 1 so that the system automatically restarts when errors are detected. |
| FMLIST_SCAN_AUTOSTART | specifies that the scanner starts automatically with the system. |
| FMLIST_SCAN_FM | specifies whether VHF/FM should be scanned. |
| FMLIST_SCAN_DAB | specifies whether DAB/DAB+ should be scanned. |
| FMLIST_SCAN_GPS_* | specifies whether/when the scanner operates in stationary or mobile mode. The stationary GPS coordinates are also specified here. |
| FMLIST_SCAN_SAVE_PWMTONE | specifies whether a tone sequence should be played with the connected piezo beeper when the scan results are saved. |
| FMLIST_SCAN_SAVE_LEDPLAY | specifies whether the connected LEDs should switch when the scan results are saved. |
| FMLIST_SCAN_FOUND_PWMTONE | Specifies whether the connected piezo beeper should play a sequence of tones with each carrier/station found. |
| FMLIST_SCAN_FOUND_LEDPLAY | Specifies whether the connected LEDs should switch with each carrier/station found. |
| FMLIST_SCAN_PWM_FEEDBACK | Specifies whether the connected piezo beeper should play a sequence of tones with each complete FM/DAB scan. Test/listen with scanToneFeedback.sh:FM success (at least 1 station): short short short FM failure: short short long DAB success (at least 1 station): short long short DAB failure: short long long |
The files ~/.config/fmlist_scan/fmscan.inc and ~/.config/fmlist_scan/dabscan.inc contain additional settings that particularly affect scanning speed and thoroughness.
Final system update and reboot with:
sudo apt remove default-jre-headless openjdk-8-jre-headless:armhf
sudo apt remove ca-certificates-java
sudo apt-get update && apt-get upgrade && reboot now
If necessary, calibrate the RTL-SDR stick after rebooting:
kal.sh
(Note: The background scan process must be completed!)
The Raspberry Pi has two pin headers that are physically labeled (top column "Physical"). The wiringPi software (http://wiringpi.com/, top column "wPi") uses different numbering.
The right column above, with physical pins 2, 4, 6, .., 40, is on the outside of the Raspberry Pi. Pin 40 is near the USB ports. The left column, with the odd-numbered pins, is on the inside of the Raspberry Pi board.
An overview of all pins can be found with
gpio readall
+-----+-----+---------+------+---+---Pi 3+--+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 2 | 8 | SDA.1 | IN | 1 | 3 || 4 | | | 5v | | |
| 3 | 9 | SCL.1 | IN | 1 | 5 || 6 | | | 0v | | |
| 4 | 7 | GPIO. 7 | IN | 1 | 7 || 8 | 0 | IN | TxD | 15 | 14 |
| | | 0v | | | 9 || 10 | 1 | IN | RxD | 16 | 15 |
| 17 | 0 | GPIO. 0 | IN | 0 | 11 || 12 | 0 | OUT | GPIO. 1 | 1 | 18 |
| 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | |
| 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 |
| | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 |
| 10 | 12 | MOSI | IN | 0 | 19 || 20 | | | 0v | | |
| 9 | 13 | MISO | IN | 0 | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 |
| 11 | 14 | SCLK | IN | 0 | 23 || 24 | 1 | IN | CE0 | 10 | 8 |
| | | 0v | | | 25 || 26 | 1 | IN | CE1 | 11 | 7 |
| 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 |
| 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | |
| 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | OUT | GPIO.26 | 26 | 12 |
| 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | |
| 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 0 | OUT | GPIO.27 | 27 | 16 |
| 26 | 25 | GPIO.25 | IN | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 |
| | | 0v | | | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+---Pi 3+--+---+------+---------+-----+-----+
ℹ️ The connection may vary depending on the model. Therefore, refer to the manufacturer's information!
The beeper is connected to physical pins 12 (+) and 14 (ground/GND). Test with the following commands:
| Command | Meaning |
|---|---|
gpio mode 1 pwm |
physical pin 12 corresponds to pin 1 on wiringPi |
gpio pwmTone 1 2000 |
sound on |
gpio pwmTone 1 0 |
sound off |
The ATX shutdown button is connected to physical pins 39 and 40. Test:
| Commands | Notes |
|---|---|
sudo systemctl stop gpio-input |
Disable the service first |
gpio mode 29 up |
Physical pin 40 corresponds to pin 29 on wiringPi |
gpio read 29 |
Must return 1 if the button is not pressed, must return 0 if the button is pressed |
The green LED is connected to physical pin 36 (wiringPi: 27), ground to pin 34. The red LED is connected to physical pin 32 (wiringPi: 26), ground to pin 30. Test:
| Commands | Notes |
|---|---|
gpio mode 27 output |
wiringPi: 27 for green, 26 for red |
gpio write 27 on |
The respective (here: green) LED is lit |
gpio write 27 off |
The respective LED goes out. |
After testing the buttons, reactivate the service:
sudo systemctl start gpio-input
If you have connected the Raspberry Pi to a screen and keyboard, you can log in directly. If you haven't made any changes to the computer name and password, the login details from Section 3.2.3 apply:
- The username is
pi - The password is
raspberry. When entering the password, make sure that you are using a US keyboard layout. In this case, y and z, as well as various special characters, are swapped!
After logging in, you can also display the IP address(es) using the ipconfig command.
Alternatively, you can connect the Raspberry Pi – without a screen/keyboard – and let the home router automatically assign an IP address. The assigned IP address can probably be viewed in the router configuration/status page on your PC. Depending on the router, the Raspberry Pi should be recognized by the hostname raspberrypi.
If you don't have access to the router, you can determine the IP address on your PC using the command
ping raspberrypi
in the DOS box – if the router supports DNS. If you already adjusted the hostname during installation, the ping command must be adjusted accordingly. The DOS box is listed as a "command prompt" in the Windows Start menu.
If the router doesn't support DNS, you have to check the router menu to see which new IP address is added when the Raspberry Pi starts up. If you find that DNS is working, you can also use the hostname for SSH/SCP.
To control the Raspberry Pi and scanner from the PC, you need software for SSH and SCP. A Linux PC usually comes with this software already installed. For Windows, appropriate software may need to be installed:
PuTTY http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
WinSCP https://winscp.net/
e.g., 7-zip: http://www.7-zip.de/
For easy import, LibreOffice / Calc is recommended, which displays a simple import dialog for delimiters and UTF-8 character encoding: https://de.libreoffice.org/
Notepad++: https://notepad-plus-plus.org/
For We recommend installing PuTTY and WinSCP via or within the PortableApps software package https://portableapps.com/. Various other software, such as TeamViewer, is also available within PortableApps. Regardless of portable use on a USB flash drive, updates are also checked regularly.
ℹ️ When installing PortableApps, paths such as C:\Program Files or C:\Program Files (x86) are not recommended, as normal users do not have write permissions in these paths.
To be able to use files directly from Explorer by double-clicking or using the "Open with" option, 7zip, Notepad++, and LibreOffice should be installed directly – without PortableApps.
For SSH, the free apps ConnectBot and JuiceSSH are recommended; for file editing/renaming, the app Total Commander; and for screen replacement (displayed on the smartphone), the app VNC Viewer is recommended.
The scanner's configuration is done in the files located in the /home/pi/.config/fmlist_scan/ folder, including config. These files can be edited within an SSH session using a simple editor such as nano or mcedit. If you edit the files from a PC, e.g., via WinSCP, please ensure that the line endings are correct (Unix: LF)! Notepad++ is recommended as a Windows editor.
As an alternative to direct editing, it is not always possible to log in via the IP address of the home network, for example, in unfamiliar environments. With the Raspberry Pi turned off, you can remove the USB flash drive and make configuration adjustments there: for example, you can also set up another/additional Wi-Fi network.
The configuration files can be edited from a PC. Using an OTG USB adapter, it is also possible to edit the configuration files with an Android smartphone:
The files from the fmlist_scanner/config/ folder must be edited. The configuration files contain the last used state. The exception is wpa_supplicant.conf, so that unauthorized users cannot access the Wi-Fi passwords by removing them and reading them. The passwords are also stored on the Raspberry Pi, so they can be accessed by stealing them completely! In any case, new additional Wi-Fi networks can be added. This requires the exact SSID and key. In many cases, these are located on the back of the router.
Editing on a smartphone is not particularly convenient compared to a PC – but it can also be done on the go. After editing the file(s), the prefix old_ must be removed from the filename of each edited file:
After properly ejecting the USB drive, plugging in the Raspberry Pi, and turning it on, the new configuration will be automatically applied. This may take some time. For Wi-Fi, the LAN cable should not be connected from the start.
The scanner primarily reports its status via the piezo beeper. The detection of FM and DAB stations is reported via the tone sequences for each scan run. See Section 4.2 for the FMLIST_SCAN_PWM_FEEDBACK configuration entry:
| Event | Tone Sequence |
|---|---|
| FM success (at least 1 station) | short short short |
| FM failure | short short long |
| DAB success (at least 1 station) | short long short |
| DAB failure | short long long |
In addition to these operating results, there are other tone sequences for:
- Scanner startup
- Error status, e.g., no RTL dongle found
- Scan results saved
ℹ️ Testing/listening is also possible with scanToneFeedback.sh (after logging in via SSH/PuTTY).
ℹ️ The individual LED colors have no specific meaning. They are switched for each detected station. No switching occurs if the next station is detected within one second to limit the switching.
There are two ATX buttons, if they were connected.
The button closest to the USB connectors shuts down the Raspberry Pi properly when pressed once. After about 30 seconds, the power can be unplugged.
The other button stops the scanner if necessary and uploads all previous results – if an internet connection is available. In effect, the two commands from the following section 5.6 are executed.
| Command | Meaning |
|---|---|
screen -ls |
Displays running background processes |
screen -r scanLoopBg |
Switch to the background scan process, Ctrl+c to exit, Ctrl+a followed by d to send it back to the background. |
tail -f ~/ram/scanner.log |
Display the logs. Exit with Ctrl+c |
stopBgScanLoop.sh [wait] |
End any running background process. ℹ️ This takes → Check with screen -ls. Alternatively, start with wait - without the [ ]. |
startBgScanLoop.sh |
Start the scan process in the background. |
cdResults |
Go to the saved results. |
mc |
Use Midnight Commander to view the results. |
sudo shutdown now |
Shutdown – alternatively to the ATX button alternatively, unplug the power after the "Save" tone sequence |
monitorBgScanLoop.sh |
simple script for monitoring the scanner |
checkScanConfig.sh |
check the configuration for missing entries |
Result files are stored in operation under /mnt/sda1/fmlist_scanner (with the default configuration of FMLIST_SCAN_RESULT_DIR) on the USB flash drive – each in subfolders named by date. The following command prepares the results for upload:
prepareScanResultsForUpload.sh [all]
Without the optional all specification, the results are prepared up to the current day. With all, all data is actually processed. With all, the scanner should be temporarily deactivated beforehand.
The processed results are then located under /mnt/sda1/fmlist_scanner/uploads. The already processed files are moved to the folder /mnt/sda1/fmlist_scanner/uploaded.
The files can be copied during operation using scp or WinSCP and then deleted.
Alternatively, the "data transfer" takes place via the USB flash drive – after shutting down the system. Don't forget to reconnect the USB flash drive to the Raspberry Pi before starting up.
The processed results are uploaded using the following command:
uploadScanResults.sh
If the upload is successful, the data is not deleted – but moved to another folder. If the upload fails, e.g., due to a lost internet connection, the data remains in the processed folder.
An automatic upload of the processed results to FMList, e.g., via a cron job, does not occur. The cron job must be set up manually; For example, add the following line with crontab -e:
15 0 * * * bash -l /home/pi/bin/prepareScanResultsForUpload.sh ; bash -l /home/pi/bin/uploadScanResults.sh
Please note that everything goes on ONE line. The next version will already contain the line as a comment, so you only need to activate the entry. The first number indicates the minute; the second the hour. In this example, 00:15 – according to UTC. The time should be adjusted. If necessary, duplicate the entire line and specify different times!
Online analyses against the FMList database can be viewed at https://www.fmlist.org/ , after logging in under the "URDS" menu item. However, the URDS menu item only appears if you have the necessary access rights. Whether and how to obtain access rights must be clarified with Günter Lorenz glorenz@fmlist.org via email.
After preparing the data (see Section 5.6.1), copying it to the PC (WinSCP), and unpacking it (7zip), the *.csv file can be opened with a text editor or LibreOffice. An import dialog appears in the latter case. For correct umlauts, the character set must be set to "Unicode (UTF-8)." The remaining settings are usually correct:
The file will be quite large and has a lot of columns. The column labels are missing, as they vary significantly for each group (group ID always in column 1).
The file is actually intended for automatic evaluation by FMList. Manual review was/is not the primary goal.
DAB Ensemble entries begin with group ID 20:
The first dozen columns are the time and GPS coordinates. The large numeric value on the left is the "UNIXTIME" value.
| Code | Meaning |
|---|---|
UNIXTIME |
Unix timestamp in seconds since January 1, 1970, 00:00 UTC |
Followed by the GPS information:
| Code | Meaning |
|---|---|
GPSLAT |
GPS Latitude |
GPSLON |
GPS Longitude |
GPSMODE |
GPS Mode (state: 2 = Lock without altitude; 3 = Lock including altitude) |
GPSALT |
GPS Altitude (for GPSMODE 3) |
GPSTIME |
GPS Time in UTC |
For the last fields, there are rough orientation markers "fic", "snr", and "tii". The following columns are in the following order:
• "fic", min_fic, max_fic, num_fic, avg_fic: These fic values come from the DAB decoding and are merely statistically summarized. num_fic is the number of fic values received.
• "snr", min_snr, max_snr, num_snr, avg_snr: Snr columns "min_snr, max_snr, avg_snr" (without "snr, num_snr") are in whole dB. These snr values come from DAB decoding. Reliability is difficult to assess.
min is the smallest of the received values, max is the largest, and avg is the arithmetic mean.
• "tii", tii_id, num, max(avg_snr), max(min_snr), max(next_snr): tii columns "max(avg_snr), max(min_snr), max(next_snr)" (without "tii,tii_id,num") are in tenths of dB. SNR (avg and min) refers solely to the spectral power in the null symbol with the TII carriers. The assumed TII carrier power is considered in relation to the weaker noise "carriers." Using the dB value, "phantom" TIIs should be eliminated. The output is currently unfiltered to gather some statistics before suppressing TIIs with too low values. Next_SNR indicates the SNR distance to the next best main or sub-ID and thus provides a measure of confusion: the smaller next_snr, the less reliable. If multiple TIIs are detected, they simply follow a blank column.
The audio programs of an ensemble are listed in the rows with group ID 21.
The data programs begin with group ID 22.
FM stations with RDS begin with group ID 30:
Here is an example line including the column identifiers:
30, 1560712920:UNIXTIME,freq,91400000, RDS:1, SNRmin:198, SNRmax:272,2019-06-16T19:22:00.046988951 Z:SYSTIME,48.885590906:GPSLAT,8.702782767:GPSLON,3:GPSMODE,293.611:GPSALT,2019-06-16T19:21:59.000Z:GPSTIME, PI:0xD30C, NPI:40, PS:" welle ", NPS:3, TA:0, TP:1, MUSIC:1, PTY:"Pop music", GRP:"0A", STEREO:0, DYNPTY:1, OTHER_PI:, ,"allps:", "die neue"," welle ",,
All decoded PS entries are placed after the column containing "allps:".
| Code | Meaning |
|---|---|
| UNIXTIME | Unix timestamp in seconds since January 1, 1970 00:00 UTC |
| SYSTIME | Operating system time in UTC |
| GPSLAT | GPS latitude |
| GPSLON | GPS longitude |
| GPSMODE | GPS mode (state: 2 = lock without altitude; 3 = lock including altitude) |
| GPSALT | GPS altitude (for GPSMODE 3) |
| GPSTIME | GPS time in UTC |
| RDS | RDS present? (0 / 1) |
| SNRmin | minSNR in tenths of dB from checkSpectrumForCarrier (preScan) |
| SNRmax | maxSNR in tenths of dB |
| PI | PI code |
| NPI | how often this PI code was received/decoded |
| PS | Program station |
| NPS | how often this PS was received/decoded |
| TA | Traffic announcement (traffic announcement active) |
| TP | Traffic program (traffic program station) |
| MUSIC | Music program (as opposed to speech program) |
| PTY | Program Type |
| GRP | RDS Groups |
| STEREO | Stereo |
Further FM stations without successful RDS decoding begin with group ID 31.
After stopping the scanner (stopBgScanLoop.sh wait, see section 5.5), signals can be recorded manually. VHF/FM recordings are triggered with
recWFMchunk.sh <frequency in MHz> <duration in seconds> [<options to rtl_sdr>]
. For security reasons, the recording is first made in RAM (/dev/shm/) and is then copied to the USB flash drive and deleted from RAM. Therefore, recordings of limited length cannot be created. The -g option for manual gain or amplification and the -H option for the wave file format are particularly interesting. The -H option must be specified immediately after the recording duration to ensure the file name is generated appropriately. With the wave file format, the file can be opened directly with SDR software such as HDSDR without an additional import step. Example:
recWFMchunk.sh 100.7 20 -H -g 20.7
rtl_test displays the possible gain values. It must be aborted with Ctrl + c or Strg + c.
The following gain values are possible with the R820T(2) tuner:
| Values | Values | Values |
|---|---|---|
| 0.0 | 0.9 | 1.4 |
| 2.7 | 3.7 | 7.7 |
| 8.7 | 12.5 | 14.4 |
| 15.7 | 16.6 | 19.7 |
| 20.7 | 22.9 | 25.4 |
| 28.0 | 29.7 | 32.8 |
| 33.8 | 36.4 | 37.2 |
| 38.6 | 40.2 | 42.1 |
| 43.4 | 43.9 | 44.5 |
| 48.0 | 49.6 |
ℹ️ For other values in dB, the closest value is used.
Similar to recording FM channels, DAB channels can be conveniently recorded:
recDAB.sh <channel> <duration in seconds> [<options to rtl_sdr>]
In addition to amplifying the tuner, the bias voltage for a suitable external preamplifier can be activated – if available – with a V3 RTL dongle from rtl-sdr.com using the option -O T=1. For example:
recDAB.sh 5C 4 -H -g 0.9 -O T=1
The recording option is particularly useful for testing and verification purposes, e.g., checking the AGC behavior for clipping. Furthermore, the scanner's sensitivity can be compared with other software. An initial analysis can be performed for short files (low RAM) using the audio editor "Audacity," which is preinstalled in the image.
The recording file name automatically includes all relevant metadata such as frequency/channel, sample rate, and GPS coordinates. The exact storage location is displayed after copying to the USB flash drive.
Furthermore, test data can easily be provided to the developer, Hayati Aygün:
cd /mnt/sda1/fmlist_scanner/IQrecords/
uploadScanFilesToDeveloper.sh <target_foldername> <filenames>
The folder name should be an identifier. For example,
uploadScanFilesToDeveloper.sh HansMeier DAB-5C_2019-03-...
Please note that the tab key TAB, to the left of Q on a German keyboard, is used to complete filenames. Alternatively, the shell (bash) can also use * to complete all matching filenames. If you provide files this way, please let me know by email what they are. I should also be able to get back to you...
- Check the power supply. Test with a different (USB) cable.
- Remove and reinsert the SD card.
After switching on, it beeps a few times (long, long, long), the red LED flashes, and everything repeats.
Unplug and reconnect the RTL-SDR. If the problem persists, unplug and reconnect the power.
Sometimes the system freezes during reboot. Disconnect and reconnect power.
-
Check the antenna connection and connector, as well as the antenna's location!
-
Is the gain set correctly?
-
Is the car window metal-coated?
- The RTL dongle is apparently not particularly stable.
- Enable automatic reboot with the setting
FMLIST_SCAN_DEAD_REBOOT=“1“in the file/home/pi/.config/fmlist_scan/config. If necessary, also reduce the settingFMLIST_SCAN_DEAD_TIME, e.g., to240.
There can be various reasons for this. The specific cause is best determined by looking at a recording. The utilities recWFMchunk.sh and recDAB.sh are included/installed for this purpose. Please create and provide recordings of 10-30 seconds.
- The configuration allows you to specify when the beeper sounds. This can reduce or increase the frequency.
- The opening of the beeper can be partially or completely sealed with adhesive tape. You may have to experiment with the volume here.
- If you don't want to hear anything at all for a while, we recommend simply unplugging one of the two pins. When reattaching, pay attention to the polarity: (+) symbol on the piezo.
This is a known issue. Do not use the LAN cable for Wi-Fi operation.
For other or persistent problems, please first register for the mailing list https://groups.io/g/fmlist-scanner and then send an email to fmlist-scanner@groups.io.
More information about new versions/updates or questions/answers from you will be available via this list in the future. Additional photos, links, and wiki pages are also available on the mailing list website.




