Last active
January 10, 2021 00:39
-
-
Save BETLOG/7d161ad900dd957de5996e1a49e264a6 to your computer and use it in GitHub Desktop.
systemctl service - RPiCamWebInterface Annotation %a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=RPiWebCamInterface user annotation service | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash /home/pi/piCamWebInterface-annotateService.sh | |
# scp /home/user/documents/scripts/raspberry/etc/systemd/system/piinfo.* pizerocam1:/tmp | |
# scp /home/user/documents/scripts/raspberry/home/pi/piinfo.sh pizerocam1:/home/pi | |
# | |
# ssh pizerocam1 | |
# sudo su | |
# chmod 644 /tmp/piinfo.* | |
# mv /tmp/piinfo.* /lib/systemd/system/ | |
# ls -s /lib/systemd/system/piinfo.* /etc/systemd/system/ | |
# systemctl daemon-reload | |
# systemctl start piinfo.timer | |
# systemctl enable piinfo.timer | |
# nano /var/www/html/uconfig | |
#...add %a | |
#...ie: annotation %Y-%M-%D--%h-%m-%s %a | |
# exit # sudo su | |
# exit ssh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=RPiWebCamInterface user annotation timer | |
[Timer] | |
OnUnitActiveSec=1s | |
OnBootSec=1s | |
[Install] | |
WantedBy=timers.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ -z $(which bc) ]] && sudo apt install bc | |
# for use with RPiWebCamInterface %a | |
# /home/user/documents/scripts/raspberry/etc/systemd/system/piinfo.service | |
# /home/user/documents/scripts/raspberry/etc/systemd/system/piinfo.timer | |
t=$(( $(cat /sys/class/thermal/thermal_zone0/temp)/1000 )) | |
# f=$(( $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)/1000 )) | |
f=$( echo "scale=1;$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)/1000000"|bc|sed -E 's/^\./0\./') | |
[[ "$EUID" -eq 0 ]] && echo -ne "$HOSTNAME ${t}C ${f}GHz\\n " >/dev/shm/mjpeg/user_annotate.txt | |
echo "$HOSTNAME ${t}C ${f}GHz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment