User Tools

Site Tools


fmlist_scanner:setup_scanner_software

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

fmlist_scanner:setup_scanner_software [2025/10/30] – created hayatifmlist_scanner:setup_scanner_software [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
 +{{indexmenu>.#1| nojs navbar nocookie msort }}
 +{{indexmenu_n>300}}
 +
 +====== 3. Installation & setup of scanner software ======
 +
 +===== Installation of the software =====
 +
 +after login with the dedicated //scanner// user
 +
 +<code>
 +sudo apt install -y git
 +cd $HOME
 +git clone https://github.com/hayguen/fmlist_scan.git
 +cd fmlist_scan
 +cp setup.sh my_setup.sh
 +</code>
 +
 +copying ''setup.sh'' to ''my_setup.sh'' isn't strictly necessary, but it will easen later update
 +
 +<code>
 +nano my_setup.sh
 +</code>
 +
 +check the documented/commented options and configure your values,
 +save the file and quit nano editor.
 +
 +now, you are ready to start the setup with
 +
 +<code>
 +sudo ./my_setup.sh
 +</code>
 +
 +
 +with an additional //SSH// connection on a Pi, you might check/watch the CPU temperature - while the setup is running
 +
 +<code>
 +while true; do cat /sys/class/thermal/thermal_zone*/temp | tr "\n" " " ; echo "" ; sleep 3 ; done
 +</code>
 +
 +
 +the setup takes a while; go get a coffee .. or tea or .. !
 +
 +
 +when finished, you need to reboot, that udev rules for user access of the RTLSDR dongle
 +
 +<code>
 +sudo reboot now
 +</code>
 +
 +
 +===== Prepare the result directory =====
 +
 +==== PC ====
 +
 +On a PC, you can also use a regular directory, which has to be configured with the scanner settings
 +
 +<code>
 +nano ~/.config/fmlist_scan/config
 +</code>
 +
 +check and configure the lines
 +
 +<code>
 +export FMLIST_SCAN_MOUNT="0"                    # "0" or "1"; default is "1". saving results requires successful mount of /mnt/sda1
 +export FMLIST_SCAN_RESULT_DEV=""                # which device to mount
 +export FMLIST_SCAN_RESULT_DSK=""                # which device (for fdisk) to check disk identifier
 +export FMLIST_SCAN_RESULT_DIR="/home/scanner/results"   # where to save results - in subfolder fmlist_scanner
 +</code>
 +
 +==== Pi ====
 +
 +On a Pi, you should have an additional external micro SD card for the results. the internal SD card with the operating system shouldn't be trashed.
 +
 +edit the settings with
 +
 +<code>
 +nano ~/.config/fmlist_scan/config
 +</code>
 +
 +check and configure the lines - especially the device name ''/dev/sda''
 +
 +<code>
 +export FMLIST_SCAN_MOUNT="1"                    # "0" or "1"; default is "1". saving results requires successful mount of /mnt/sda1
 +export FMLIST_SCAN_RESULT_DEV="/dev/sda1"       # which device to mount
 +export FMLIST_SCAN_RESULT_DSK="/dev/sda"        # which device (for fdisk) to check disk identifier
 +export FMLIST_SCAN_RESULT_DIR="/mnt/sda1"       # where to save results - in subfolder fmlist_scanner
 +</code>
 +
 +
 +==== Setup Flash-Friendly-File-System aka F2FS ====
 +
 +Despite the non-existing 'quality' of most USB memory sticks, you can extend their lifetime by using a special filesystem for Flash drives: F2FS.
 +
 +Micro-SD cards generally have a superior quality - compared against USB memory sticks.
 +But there are differences also. Prefer SD cards labelled with //Max/High Endurance// , which should have superior quality.
 +
 +Anyway, you will also extend SD cards' lifetime utilizing F2FS
 +
 +<code>
 +scanner_format_f2fs.sh
 +</code>
 +
 +see also [[devop:f2fs|Flash Friendly File System (F2FS)]]
 +
 +===== Review & configure all settings =====
 +
 +<code>
 +nano ~/.config/fmlist_scan/config
 +</code>
 +
 +
 +you might want to check following entries for the upload
 +
 +  * ''FMLIST_USER'' : your account at https://www.fmlist.org/
 +  * ''FMLIST_RASPI_ID'' : to distinguish several scanners
 +  * ''FMLIST_OM_ID'' : also from https://www.fmlist.org/
 +  * ''FMLIST_UP_COMMENT'' : some comment, e.g. your antenna ..
 +  * ''FMLIST_SCAN_GPS_*'' : your static GPS coordinates, if scanner is placed at a fixed place
 +
 +
 +the RTLSDR sometime freezes/hangs. to prevent an infinite unproductive loop, check following entries
 +
 +  * ''FMLIST_SCAN_DEAD_*'' : especially the REBOOT
 +  * ''FMLIST_SCAN_RESET_DEVICE'': check, if USB device reset works - especially with an USB-Hub
 +  * ''FMLIST_FM_RTLSDR_DEV''
 +  * ''FMLIST_DAB_RTLSDR_DEV''
 +
 +you need to enter the serial of the used RTL-SDR, that an USB reset can take place. without, a reboot would be necesessary!
 +
 +you can determine the serial number of an RTLSDR dongle with
 +
 +<code>
 +rtl_test
 +</code>
 +
 +press //Ctrl-C// to abort sample loss check
 +
 +
 +and surely very important for automatic start of the scanner
 +
 +  * ''FMLIST_SCAN_AUTOSTART''
 +
 +
 +===== Calibrate your RTLSDR dongle =====
 +
 +Actual dongles with an error < 1 ppm won't make a big difference .. but for other dongles, the calibration will be important - especially for DAB.
 +
 +<code>
 +kal.sh
 +</code>
 +
 +this takes some minutes. the results are saved in the configuration file.
 +
 +
 +===== Setup automatic upload of scan results =====
 +
 +Check/uncomment automatic upload with
 +
 +<code>
 +crontab -l
 +crontab -e
 +</code>
 +
 +
 +===== Setup Remote, Monitoring or Service connection =====
 +
 +Using the scanner at home in your local network, you should always be able to connect with SSH.
 +
 +In following cases, it is more difficult:
 +
 +  * you want to connect from outside (you would need to configure your modem's firewall rules)
 +  * with a so-called //DS-Lite//, connecting from outside will get impossible
 +  * when the Pi uses mobile internet, e.g. LTE from your cell phone, you usually //DS-Lite//
 +
 +In any of aboce cases, //SideDoor// service might be helpful. Sidedoor is a so-called //revers-ssh// protocol:
 +
 +  * the Pi automatically connects to a 'server'-computer (in my home), and waits
 +  * the device, e.g. smartphone, that wants to establish a connection the that Pi, connects over the waiting connection over my 'server'
 +
 +
 +setup of sidedoor
 +
 +<code>
 +cd ~/fmlist_scan/src
 +sudo -E ./setup_sidedoor 8001
 +</code>
 +
 +you need to replace the 8001 by a unique port number! simply send me an email request to [[h_ayguen@web.de|h_ayguen@web.de]]
 +
 +
 +after activation, you can test with
 +
 +<code>
 +ssh -p 9001 scanner@hayguen.hopto.org
 +</code>
 +
 +again, you need to replace the ''9001'' by  1000 + the port number, your Pi got assigned.
 +
 +you can control the sidedoor service with following commands:
 +
 +<code>
 +sudo systemctl status sidedoor
 +sudo systemctl stop sidedoor
 +sudo systemctl disable sidedoor
 +sudo systemctl enable sidedoor
 +sudo systemctl start sidedoor
 +</code>
 +
 +
 +Oliver and me  gain access to the Pi by installing ssh public keys into a new user account ''fmlist_service'' with sudo rights! This is intentended as a service - in case you need some (configuration) help.
 +
 +if you don't trust us, simply don't install the sidedoor!
 +
 +
 +
 +===== Setup control webserver =====
 +
 +Many configuration and monitoring operations can also get carried out through a simple webserver. It is automatically installed, but not activated.
 +
 +For activation perform
 +
 +<code>
 +cd ~/fmlist_scan
 +sudo ./my_setup.sh wsrv
 +</code>
 +
 +
 +You can control the service with following commands - if necessary
 +
 +<code>
 +sudo systemctl status scan-webserver.service
 +sudo systemctl start  scan-webserver.service
 +sudo systemctl stop   scan-webserver.service
 +</code>
 +
 +
 +The webserver is only accessible from your home network (LAN).
 +
 +You can connect with your browser on port 8000 - knowing the IP address or hostname of your Pi/scanner:
 +
 +  * http://192.168.178.191:8000/
 +  * http://raspberrypi:8000/
 +  * http://scannerNN:8000/
 +
 +connection with hostname requires a network router which does provide DNS. you can simply check with ''ping''
 +
 +<code>
 +ping raspberrypi
 +ping scannerNN
 +</code>
 +
 +
 +Another alternative is, to allow allow reporting FMLIST the local IP address of your Pi with
 +
 +  * edit/enable the configuration entry ''FMLIST_SCAN_AUTO_IP_INFO''
 +  * uncomment (remove the ''#'' at start) the line with ''/home/scanner/bin/scanner_auto_config.sh'' of your crontab (''crontab -e'')
 +
 +<code>
 +nano ~/.config/fmlist_scan/config
 +crontab -e
 +</code>
 +
 +and connect with the IP address reported in the **myURDS...** menu at https://www.fmlist.org/urds/
 +
 +Despite the fact, that your local IP address and the link to the webserver is listed on FMLIST, access is restricted to your home network (LAN).
 +
 +The initial/default password is ''scanner123'', which is to be changed.
 +
 +
 +===== Setup Boot Target Console/GUI =====
 +
 +With new OS, remote X isn't activated by just setting ''DISPLAY'', if the local GUI is active.
 +The GUI needs to be deactivated, that ''DISPLAY'' can work.
 +
 +Use following command to check boot-mode:
 +<code>
 +sudo systemctl get-default
 +</code>
 +
 +to boot into console login:
 +<code>
 +sudo systemctl set-default multi-user.target
 +</code>
 +
 +to boot into GUI:
 +<code>
 +sudo systemctl set-default graphical.target
 +</code>