The new Version (v2025.0119) has the ability to write to the system log (Thanks Howard).
NOTE: Depending on the storage size of the used SD-Card, the log file could fill up all usable space. This could impact on system performance and might lead to a stale system.
To enable FT*/WSPR logging to the system go to the Admin interface (http://<your web-888 IP-address>:8073/admin) and select the Extensions Tab.
- Select either WSPR or FT8 (left grey area),
- Then set the “Log decodes to syslog” [Yes|No] field to Yes.
As soon as this has been set to yes the system will log to the system log (/var/log/messages).
To check, we can either use the Web-console (Admin interface) or ssh to the web-888 via our favoured ssh-client (I use MobaXterm).
To check if the data is written to the log file.
Jan 21 08:23:31 web-888 user.info : 00:56:31.312 0123456789AB 8 FT8 DECODE: 10137.984 IW1CKR JN45 -13 15692km Tue Jan 21 08:23:15 2025
Jan 21 08:23:32 web-888 user.info : 00:56:31.780 0123456789AB 6 FT8 DECODE: 18100.725 JE2GEG PM85 -8 7904km Tue Jan 21 08:23:15 2025
Jan 21 08:23:34 web-888 user.info : 00:56:33.975 0123456789AB 7 FT8 DECODE: 14075.550 BD4VOJ PM01 -11 7681km Tue Jan 21 08:23:15 2025
Jan 21 08:23:46 web-888 user.info : 00:56:46.075 0123456789AB 5 FT8 DECODE: 21075.144 JK4WKO PM54 -6 7831km Tue Jan 21 08:23:30 2025
Jan 21 08:23:46 web-888 user.info : 00:56:46.079 0123456789AB 5 FT8 DECODE: 21075.638 JI1ILB PM96 -10 8014km Tue Jan 21 08:23:30 2025
Jan 21 08:23:59 web-888 user.info : 00:56:59.277 0123456789AB 1 WSPR DECODE: 0822 4 0.2 14.097102 0 VK4TMT QG62 1629 23 (200 mW)
Jan 21 08:23:59 web-888 user.info : 00:56:59.396 0123456789AB 1 WSPR DECODE: 0822 3 0.2 14.097134 0 VK4NE QG62 1629 23 (200 mW)
Jan 21 08:23:59 web-888 user.info : 00:56:59.599 0123456789AB 1 WSPR DECODE: 0822 -14 0.2 14.097073 0 MW0KST IO81 16507 37 (5.0 W)
Jan 21 08:24:00 web-888 user.info : 00:56:59.753 0123456789AB 1 WSPR DECODE: 0822 -15 0.2 14.097018 0 G8MCD IO91 16373 23 (200 mW)
Since we are now writing to the log file constantly it is best to make sure that the log file is being kept at a manageable size. To do so we set up syslogd to roll the log file every so often. For demonstration I’ve setup the syslog configuration file to roll after it reaches 100 kB in size. This size depends on your environment and size of the SD-Card. This is a requirement for your system and as such the roll over size needs to be determined accordingly.
There are approximately 150 Bytes per line so that should help compute your daily log growth. If the system writes 10 messages per second at an average of 150 Bytes we get about 13 MB a day.
On my system I have set the log size to 10 MB (10240). This however, can be tailored to individual requirements with up to 99 log files (-b 99) YMMV!
To set this up follow these steps:
- ssh to the web-888
- and change into the config directory
- cd /etc/conf.d
create a backup of the original syslog configuration file
- cp syslog syslog.orig
create a new config file based on log size requirements (-s x) and how many logs we like to keep before overwriting the first (/var/log/messages.0) file (-b z). In the below example I use 100 kB size and rotate up to 7 logs.
- echo "SYSLOGD_OPTS=\"-s 100 -b 7\"" > syslog
check if we got it right
cat syslog
SYSLOGD_OPTS="-s 100 -b 7"
restart syslog
- rc-service syslog restart
and check if we are logging to the log file
- grep "user.info" /var/log/messages
Jan 21 08:23:31 web-888 user.info : 00:56:31.312 0123456789AB 8 FT8 DECODE: 10137.984 IW1CKR JN45 -13 15692km Tue Jan 21 08:23:15 2025
Jan 21 08:23:32 web-888 user.info : 00:56:31.780 0123456789AB 6 FT8 DECODE: 18100.725 JE2GEG PM85 -8 7904km Tue Jan 21 08:23:15 2025
Jan 21 08:23:34 web-888 user.info : 00:56:33.975 0123456789AB 7 FT8 DECODE: 14075.550 BD4VOJ PM01 -11 7681km Tue Jan 21 08:23:15 2025
Jan 21 08:23:46 web-888 user.info : 00:56:46.075 0123456789AB 5 FT8 DECODE: 21075.144 JK4WKO PM54 -6 7831km Tue Jan 21 08:23:30 2025
Jan 21 08:23:46 web-888 user.info : 00:56:46.079 0123456789AB 5 FT8 DECODE: 21075.638 JI1ILB PM96 -10 8014km Tue Jan 21 08:23:30 2025
Jan 21 08:23:59 web-888 user.info : 00:56:59.277 0123456789AB 1 WSPR DECODE: 0822 4 0.2 14.097102 0 VK4TMT QG62 1629 23 (200 mW)
Jan 21 08:23:59 web-888 user.info : 00:56:59.396 0123456789AB 1 WSPR DECODE: 0822 3 0.2 14.097134 0 VK4NE QG62 1629 23 (200 mW)
Jan 21 08:23:59 web-888 user.info : 00:56:59.599 0123456789AB 1 WSPR DECODE: 0822 -14 0.2 14.097073 0 MW0KST IO81 16507 37 (5.0 W)
Jan 21 08:24:00 web-888 user.info : 00:56:59.753 0123456789AB 1 WSPR DECODE: 0822 -15 0.2 14.097018 0 G8MCD IO91 16373 23 (200 mW)
The following commands can be used to extract data from the log for further processing:
web-888:~# grep "user.info" /var/log/messages > /dev/shm/user.info
web-888:~# grep "FT8 DECODE" /var/log/messages | sed -e 's/.*FT8 DECODE: \(.*\)2025.*/\1/' > /dev/shm/ft8
web-888:~# grep "FT4 DECODE" /var/log/messages | sed -e 's/.*FT4 DECODE: \(.*\)2025.*/\1/' > /dev/shm/ft4
web-888:~# grep "WSPR DECODE" /var/log/messages | grep -v " WSPR DECODE: UTC" | sed -e 's/.*WSPR DECODE: \(.*\))*/\1/' > /dev/shm/WSPR
These commands will write all WSPR/FT8/4 messages into shared memory, from which we can now copy the data to other systems for further processing.
NOTE: The system log files WILL be removed when a system reboot is being initiated, that includes a power failure! You will need to make sure to backup your data!
UPDATE: 20250226
To make the changes stick, i.e. survive a reboot etc. we need to commit the changes to the boot config file. See the Alpine Wiki for more info.
The lbu command allows us to make changes to the boot configuration.
- Check the status:
- web-888:~# lbu st
- U etc/conf.d/syslog
- web-888:~# ls -l /media/mmcblk0p1/web-888.apkovl.tar.gz
- -rwxr-xr-x 1 root root 13527 Feb 26 15:04 /media/mmcblk0p1/web-888.apkovl.tar.gz
- Commit the change
- lbu ci
- Check to see if the backup worked
- web-888:~# ls -l /media/mmcblk0p1/web-888.apkovl.tar.gz
- -rwxr-xr-x 1 root root 13529 Feb 26 15:08 /media/mmcblk0p1/web-888.apkovl.tar.gz
- Reboot the system:
- web-888:~# sync;reboot
- After the reboot check that your syslog configuration is as expected.
- web-888:~# cat /etc/conf.d/syslog
- SYSLOGD_OPTS="-s 100 -b 7"
No comments:
Post a Comment