optimize and simplify projector handling
3dprinter has now lights: switch them off when closing give some voice status if the internet is down. Like enterprise computer ... always switch the lights on when openingmaster
parent
e5aeca63cf
commit
539125f2e5
|
@ -0,0 +1,18 @@
|
||||||
|
Mounting height 2770 [mm] See operating instructions
|
||||||
|
Detection area Xmin -850 [mm] See operating instructions
|
||||||
|
Wall at Xmin Wall Present
|
||||||
|
Detection area Xmax 1000 [mm] See operating instructions
|
||||||
|
Wall at Xmax No Wall
|
||||||
|
Detection area Ymin -600 [mm] See operating instructions
|
||||||
|
Wall at Ymin No Wall
|
||||||
|
Detection area Ymax 600 [mm] See operating instructions
|
||||||
|
Wall at Ymax No Wall
|
||||||
|
Forward direction +X
|
||||||
|
Virtual line Curved Line
|
||||||
|
Line offset -200 [mm] See operating instructions
|
||||||
|
Door opens Away§
|
||||||
|
Door width 820 [mm] See operating instructions
|
||||||
|
Door height 2000 [mm] See operating instructions
|
||||||
|
Door decentering 0 [mm] See operating instructions
|
||||||
|
Min person height 1200 [mm] See operating instructions
|
||||||
|
Device location Inside
|
|
@ -47,6 +47,7 @@ function beameron() {
|
||||||
wget -qO/dev/null http://$projip/tgi/return.tgi?command=2a3101fe0660 #projector on
|
wget -qO/dev/null http://$projip/tgi/return.tgi?command=2a3101fe0660 #projector on
|
||||||
if [ "$currstatus" = "off" ]
|
if [ "$currstatus" = "off" ]
|
||||||
then
|
then
|
||||||
|
lowerscreen &
|
||||||
echo "Waiting for beamer to boot..."
|
echo "Waiting for beamer to boot..."
|
||||||
sleep 18
|
sleep 18
|
||||||
echo "... is now booted"
|
echo "... is now booted"
|
||||||
|
@ -59,7 +60,7 @@ function dvi() {
|
||||||
if [ "$currstatus" = "02" ] || [ "$currstatus" = "off" ]
|
if [ "$currstatus" = "02" ] || [ "$currstatus" = "off" ]
|
||||||
then
|
then
|
||||||
echo "not switching, already displaying DVI (or off)"
|
echo "not switching, already displaying DVI (or off)"
|
||||||
return 1
|
return 0
|
||||||
else
|
else
|
||||||
echo "Switching to dvi"
|
echo "Switching to dvi"
|
||||||
wget -qO/dev/null http://$projip/tgi/return.tgi?command=2a3109f6070566 #switch to DVI
|
wget -qO/dev/null http://$projip/tgi/return.tgi?command=2a3109f6070566 #switch to DVI
|
||||||
|
|
|
@ -26,14 +26,12 @@ then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
signalsource="$(wget -qO - 'http://'"$projip"'/tgi/return.tgi?query=info' |awk -F'[<>]' '/<info>/{print substr($3,33,2)}')"
|
signalsource="$(wget -qO - 'http://'"$projip"'/tgi/return.tgi?query=info' |awk -F'[<>]' '/<info>/{print substr($3,33,2)}')"
|
||||||
#if [ "$signalsource" = "00" ] || [ "$signalsource" = "15" ] || [ "$signalsource" = "" ]
|
# if [ "$signalsource" = "00" ] ||
|
||||||
if [ "$signalsource" = "00" ] ||
|
# [ "$signalsource" = "02" ] ||
|
||||||
[ "$signalsource" = "02" ] ||
|
# [ "$signalsource" = "" ] ||
|
||||||
[ "$signalsource" = "" ] ||
|
# [ "$signalsource" = "15" ] # always switch off if on chromecast # port 15 is hdmi1 (chromecast)
|
||||||
[ "$signalsource" = "15" ] # always switch off if on chromecast
|
if true # no more detecting if door closed by error. Nobody ever did that. Causes just issues
|
||||||
# ( [ "$signalsource" = "15" ] &&
|
then
|
||||||
# [ "$(cat /var/run/caststatus)" = "Backdrop" ] )
|
|
||||||
then # port 15 is hdmi1 (chromecast)
|
|
||||||
raisescreen
|
raisescreen
|
||||||
lightcommander projector dvioff # swith to slideshow and off
|
lightcommander projector dvioff # swith to slideshow and off
|
||||||
lightcommander projector vol-
|
lightcommander projector vol-
|
||||||
|
|
|
@ -8,6 +8,9 @@ then
|
||||||
# echo "usage: $0 {maindoor} {open}"
|
# echo "usage: $0 {maindoor} {open}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
# v---- group A=1, B=2, G=7
|
||||||
|
# v---- number
|
||||||
|
# /root/pidor/rcswitch-pi/send 2 7 3 1 <-- 0=off 1=on
|
||||||
function dolight() {
|
function dolight() {
|
||||||
if [ "$2" = "on" ]
|
if [ "$2" = "on" ]
|
||||||
then
|
then
|
||||||
|
@ -19,6 +22,7 @@ function dolight() {
|
||||||
all) dolight "main" $2
|
all) dolight "main" $2
|
||||||
dolight "status" $2
|
dolight "status" $2
|
||||||
dolight "labsocket" $2
|
dolight "labsocket" $2
|
||||||
|
dolight "3dprinter" $2
|
||||||
dolight "alarm" $2
|
dolight "alarm" $2
|
||||||
;;
|
;;
|
||||||
main) sudo /root/pidor/rcswitch-pi/send 2 1A 1 "$setvalue"
|
main) sudo /root/pidor/rcswitch-pi/send 2 1A 1 "$setvalue"
|
||||||
|
@ -37,6 +41,8 @@ function dolight() {
|
||||||
sleep 1
|
sleep 1
|
||||||
sudo /root/pidor/rcswitch-pi/send 2 15A 1 "$setvalue" ) &
|
sudo /root/pidor/rcswitch-pi/send 2 15A 1 "$setvalue" ) &
|
||||||
;;
|
;;
|
||||||
|
3dprinter) sudo /root/pidor/rcswitch-pi/send 2 7 3 "$setvalue"
|
||||||
|
;;
|
||||||
screen) sudo /root/pidor/scripts/beamercontrol.sh screen "$2"
|
screen) sudo /root/pidor/scripts/beamercontrol.sh screen "$2"
|
||||||
;;
|
;;
|
||||||
projector) sudo /root/pidor/scripts/beamercontrol.sh beamer "$2"
|
projector) sudo /root/pidor/scripts/beamercontrol.sh beamer "$2"
|
||||||
|
@ -47,7 +53,7 @@ function dolight() {
|
||||||
;;
|
;;
|
||||||
stealth) sudo /root/pidor/scripts/stealth.sh
|
stealth) sudo /root/pidor/scripts/stealth.sh
|
||||||
;;
|
;;
|
||||||
# maindoor) sudo /root/pidor/scripts/opendoor.sh
|
# maindoor) sudo /root/pidor/scripts/opendoor.sh 2>&1 | logger
|
||||||
# ;;
|
# ;;
|
||||||
esac
|
esac
|
||||||
# type (2=10bit)
|
# type (2=10bit)
|
||||||
|
|
|
@ -9,7 +9,7 @@ fi
|
||||||
if [ "$1" = "pushed" ]
|
if [ "$1" = "pushed" ]
|
||||||
then
|
then
|
||||||
oldvol="$(amixer get PCM |awk -F'[][]' '/: Playback.*%/{print $2}')"
|
oldvol="$(amixer get PCM |awk -F'[][]' '/: Playback.*%/{print $2}')"
|
||||||
amixer set PCM 5%
|
# amixer set PCM 5%
|
||||||
aplay '/root/win/Windows XP Error.wav'
|
aplay '/root/win/Windows XP Error.wav'
|
||||||
sleep 1
|
sleep 1
|
||||||
aplay '/root/win/Windows XP Critical Stop.wav'
|
aplay '/root/win/Windows XP Critical Stop.wav'
|
||||||
|
@ -18,6 +18,6 @@ then
|
||||||
sleep 1
|
sleep 1
|
||||||
#espeak -s 120 -p 80 "I will tell you when I am finished." 2>/dev/null
|
#espeak -s 120 -p 80 "I will tell you when I am finished." 2>/dev/null
|
||||||
aplay '/root/win/Windows XP Logoff Sound.wav'
|
aplay '/root/win/Windows XP Logoff Sound.wav'
|
||||||
amixer set PCM "$oldvol"
|
# amixer set PCM "$oldvol"
|
||||||
fi
|
fi
|
||||||
) &
|
) &
|
||||||
|
|
|
@ -24,10 +24,10 @@ then # switch status lights on, in any case
|
||||||
$(dirname "$0")/../lightcommander status on
|
$(dirname "$0")/../lightcommander status on
|
||||||
# /usr/local/bin/433send 2 2A 1 1 #on
|
# /usr/local/bin/433send 2 2A 1 1 #on
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "released" ] && # the door has been opened
|
if [ "$1" = "released" ] # && # the door has been opened
|
||||||
# [ "$(cat /run/spacestatus)" = "open" ] && # status is open
|
# [ "$(cat /run/spacestatus)" = "open" ] && # status is open
|
||||||
# [ "$(stat -c %Y /run/spacestatus)" -gt "$(date --date "50 minutes ago" +%s)" ] && # since less than 5 minutes
|
# [ "$(stat -c %Y /run/spacestatus)" -gt "$(date --date "50 minutes ago" +%s)" ] && # since less than 5 minutes
|
||||||
( [ "$(date +%s)" -gt $(/root/pidor/scripts/sunset) ] || [ "$(date +%s)" -lt $(/root/pidor/scripts/sunrise) ] )
|
# ( [ "$(date +%s)" -gt $(/root/pidor/scripts/sunset) ] || [ "$(date +%s)" -lt $(/root/pidor/scripts/sunrise) ] )
|
||||||
then
|
then
|
||||||
#( [ "$(date +%H)" -gt 18 ] || [ "$(date +%H)" -lt 8 ] )
|
#( [ "$(date +%H)" -gt 18 ] || [ "$(date +%H)" -lt 8 ] )
|
||||||
logger -t $(basename $0) "switching some lights on"
|
logger -t $(basename $0) "switching some lights on"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
RELAYURL="$(cat "$(dirname "$0")"/secret.txt)/state.xml?relay1State=2&pulseTime1=5"
|
RELAYURL="$(cat "$(dirname "$0")"/secret.txt)/state.xml?relay1State=2&pulseTime1=5"
|
||||||
wget -O - --timeout=1 --tries=1 $RELAYURL
|
wget -O - --timeout=1 --tries=1 $RELAYURL
|
||||||
|
logger "$0 wget returns $?"
|
||||||
|
|
|
@ -80,4 +80,35 @@ then
|
||||||
presency=0
|
presency=0
|
||||||
fi
|
fi
|
||||||
/usr/bin/curl --max-time 1 --silent --data key="$spaceapikey" --data-urlencode sensors='{"sensors":{"people_now_present":[{"value":'"$presency"'}]}}' https://spaceapi.syn2cat.lu/sensor/set
|
/usr/bin/curl --max-time 1 --silent --data key="$spaceapikey" --data-urlencode sensors='{"sensors":{"people_now_present":[{"value":'"$presency"'}]}}' https://spaceapi.syn2cat.lu/sensor/set
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
if ! ping -c 1 8.8.8.8 >/dev/null
|
||||||
|
then
|
||||||
|
if [ -f /run/netdown.txt ]
|
||||||
|
then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
touch /run/netdown.txt
|
||||||
|
fi
|
||||||
|
if [ "$status" = "open" ]
|
||||||
|
then
|
||||||
|
a=$(( $(date "+%s") - $(stat -c %Z /run/netdown.txt) )) # difference in seconds
|
||||||
|
a=$((a/60)) # minutes
|
||||||
|
if [ "$a" -gt 20 ] # don't talk if the interruption is less than 20 minutes
|
||||||
|
then
|
||||||
|
if [ "$a" -lt 60 ] # talk in hours later
|
||||||
|
then
|
||||||
|
espeak -s 100 "Network problem: The internet is not reachable since $a minutes."
|
||||||
|
else
|
||||||
|
if [ $((a%10)) = 0 ] # only annoy every 10 minutes
|
||||||
|
then
|
||||||
|
espeak -s 100 "Network problem: The internet is not reachable since $((a/60)) hours and $((a%60)) minutes."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
rm -f /run/var/netdown.txt # reset
|
||||||
|
fi
|
||||||
V
|
V
|
||||||
|
|
|
@ -27,7 +27,7 @@ fi
|
||||||
if [ "$1" = "released" ] && # the door has been opened
|
if [ "$1" = "released" ] && # the door has been opened
|
||||||
# [ "$(cat /run/spacestatus)" = "open" ] && # status is open
|
# [ "$(cat /run/spacestatus)" = "open" ] && # status is open
|
||||||
# [ "$(stat -c %Y /run/spacestatus)" -gt "$(date --date "50 minutes ago" +%s)" ] && # since less than 5 minutes
|
# [ "$(stat -c %Y /run/spacestatus)" -gt "$(date --date "50 minutes ago" +%s)" ] && # since less than 5 minutes
|
||||||
( [ "$(date +%s)" -gt $(/root/pidor/scripts/sunset) ] || [ "$(date +%s)" -lt $(/root/pidor/scripts/sunrise) ] )
|
# ( [ "$(date +%s)" -gt $(/root/pidor/scripts/sunset) ] || [ "$(date +%s)" -lt $(/root/pidor/scripts/sunrise) ] )
|
||||||
then
|
then
|
||||||
#( [ "$(date +%H)" -gt 18 ] || [ "$(date +%H)" -lt 8 ] )
|
#( [ "$(date +%H)" -gt 18 ] || [ "$(date +%H)" -lt 8 ] )
|
||||||
logger -t $(basename $0) "switching some lights on"
|
logger -t $(basename $0) "switching some lights on"
|
||||||
|
|
Loading…
Reference in New Issue