diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.HMI b/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.HMI index f71ab07..6c09887 100755 Binary files a/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.HMI and b/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.HMI differ diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.tft b/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.tft index 98191e0..10396a9 100755 Binary files a/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.tft and b/70/LastHeard-Dashboard-Multislot-Enhanced/Multi-LH-DMR-NX8048K070_011.tft differ diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/linux/README.md b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/README.md new file mode 100644 index 0000000..56520ff --- /dev/null +++ b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/README.md @@ -0,0 +1,72 @@ +# Useful files to keep on your Raspberry Pi + +Use these files as examples and modify them to fit your needs. + +Place the executable files in `/usr/local/sbin` and save `index.txt` as +`/root/index.html`. + +## index.txt + +This file contains the website that is shown when you stop the dashboard. It gets +copied into the webroot of your webserver -- make sure your webserver reads +`index.html` files **before** `index.php` files. + +## dashboard + +Executable file. Make sure to `chmod +x` this file. + +Start or stop the dashboard with this command. This toggles the systemd service + +- php7.3-fpm.service + +Usage: + +``` +/usr/local/sbin/dashboard {on|off} +``` + +## hotspot + +Executable file. Make sure to `chmod +x` this file. + +Start or stop your hotspot. This toggles the systemd services + +- mmdvmhost.timer +- mmdvmhost.service + +Additionally it starts or stops the dashboard command mentioned above. + +Usage: + +``` +/usr/local/sbin/hotspot {on|off} +``` + +### Start and stop the hotspot via Cron + +Place these lines in your `/etc/crontab` to automatically start and/or stop +your hotspot. + +``` +30 6 * * 1-5 root /usr/local/sbin/hotspot off +0 18 * * 1-5 root /usr/local/sbin/hotspot on +``` + +That might stop the hotspot at 6:30 and start it again at 18:00, Monday to Friday. + +## shrinklog + +Executable file. Make sure to `chmod +x` this file. + +This command shrinks the MMDVMHost log file to a limited number of important +lines. + +The code of this was primarily taken from [Pi-Star][shrinklog] and modified. + +[shrinklog]: https://github.com/AndyTaylorTweet/Pi-Star_Binaries_sbin/blob/master/pistar-hourly.cron + +Usage: + +``` +/usr/local/sbin/shrinklog +``` \ No newline at end of file diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/linux/dashboard b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/dashboard new file mode 100644 index 0000000..2913bbc --- /dev/null +++ b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/dashboard @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ "$EUID" -ne 0 ] + then echo "root privileges needed. Aborting." + exit +fi + +case "$1" in + start|on) + echo -n "Starting the web dashboard..." + systemctl start php7.3-fpm.service + rm -f /var/www/html/index.html + echo " OK" + ;; + + stop|off) + echo -n "Stopping the web dashboard..." + cp -a /root/index.html /var/www/html/index.html + systemctl stop php7.3-fpm.service + echo " OK" + ;; + + *) + echo $"Usage: $0 {start|stop}" + exit 1 +esac diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/linux/hotspot b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/hotspot new file mode 100644 index 0000000..a648d48 --- /dev/null +++ b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/hotspot @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ "$EUID" -ne 0 ] + then echo "root privileges needed. Aborting." + exit 1 +fi + +case "$1" in + on) + systemctl start mmdvmhost.timer + systemctl start mmdvmhost.service + /usr/local/sbin/dashboard on + ;; + + off) + systemctl stop mmdvmhost.timer + systemctl stop mmdvmhost.service + /usr/local/sbin/dashboard off + ;; + help) + echo "$(basename $0)" + echo " Enable or disable systemd services for MMDVMHost" + ;; + *) + echo "usage: $(basename $0) [ on | off ]" + exit 1 +esac diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/linux/index.txt b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/index.txt new file mode 100644 index 0000000..08fc6ce --- /dev/null +++ b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/index.txt @@ -0,0 +1,35 @@ + + + + + + + + OE7DRT - MMDVM-Dashboard by DG9VH + + + +
+

The dashboard is not available right now, please try + again later!

+ reload this page +

+ + diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/linux/shrinklog b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/shrinklog new file mode 100644 index 0000000..a249c34 --- /dev/null +++ b/70/LastHeard-Dashboard-Multislot-Enhanced/linux/shrinklog @@ -0,0 +1,26 @@ +#!/bin/bash +# This code was taken from Pi-Star (and maybe modified a bit) +# https://github.com/AndyTaylorTweet/Pi-Star_Binaries_sbin/blob/master/pistar-hourly.cron + +echo -n "Shrinking MMDVM log..." +# Shrink the MMDVMHost Log +MMDVMLogFiles=$(ls /var/log/mmdvm/MMDVM-*.log 2> /dev/null | wc -l) +if [[ "$MMDVMLogFiles" != "0" ]]; then + todayMMDVMLog=$(ls -1rt /var/log/mmdvm/MMDVM-*.log | tail -n1) + modemLine=$(grep "MMDVM protocol version" ${todayMMDVMLog} | tail -n 1) + if [ "$(head -n 1 ${todayMMDVMLog})" = "${modemLine}" ]; then + sed -i '1d' ${todayMMDVMLog} + fi + echo -e "${modemLine}\n$(egrep -h "from|end|watchdog|lost|protocol" ${todayMMDVMLog} | sed '/(CSBK|overflow|mapping points|Downlink)/d' | tail -n 500)" > ${todayMMDVMLog} + #echo -e "${modemLine}\n$(egrep -h "from|end|watchdog|lost|protocol" ${todayMMDVMLog} | sed '/(CSBK|overflow|mapping points|Downlink)/d' | tail -n 1000)" > ${todayMMDVMLog} +fi + +echo -n " /var/log..." +# Clean up systemd logs +journalctl --rotate > /dev/null 2>&1 +#journalctl --vacuum-time=24h +#journalctl --vacuum-size=5M +journalctl --vacuum-time=6h > /dev/null 2>&1 +journalctl --vacuum-size=2M > /dev/null 2>&1 + +echo " OK" diff --git a/70/LastHeard-Dashboard-Multislot-Enhanced/nxt07_01.png b/70/LastHeard-Dashboard-Multislot-Enhanced/nxt07_01.png index 1209936..1f8ec1b 100644 Binary files a/70/LastHeard-Dashboard-Multislot-Enhanced/nxt07_01.png and b/70/LastHeard-Dashboard-Multislot-Enhanced/nxt07_01.png differ diff --git a/README.md b/README.md index 22a42b7..6b95c67 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is a collection of Nextion Screen Layouts that I have made. The bigger screens usually run with a higher baudrate of 115200. With 9600 the screen may flicker a little bit. -## Files in this repo (2020-03-20) +## Files in this repo (2020-04-27) ``` MMDVM-Nextion-Screen-Layouts @@ -18,10 +18,10 @@ MMDVM-Nextion-Screen-Layouts │   └── screens.png ├── 70 │   └── LastHeard-Dashboard-Multislot-Enhanced -│   ├── Multi-LH-DMR-NX8048K070_011.HMI +│   ├── Multi-LH-DMR-NX8048K070_011.hmi │   ├── Multi-LH-DMR-NX8048K070_011.tft │   ├── README.md -│   └── nxt07_screens.png +│   └── nxt07_01.png ├── LICENSE └── README.md ```