Skip to content

Commit

Permalink
stop runme.py app after 20 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
isra67 committed Jun 12, 2017
1 parent e637c87 commit cf5ac71
Show file tree
Hide file tree
Showing 19 changed files with 199 additions and 105 deletions.
4 changes: 3 additions & 1 deletion backlight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
#
# #################################################################################

echo $1 > /sys/class/backlight/rpi_backlight/bl_power
if [ -n "$1" ]; then
echo $1 > /sys/class/backlight/rpi_backlight/bl_power
fi
8 changes: 7 additions & 1 deletion brightness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@
#
# #################################################################################

echo $1 > /sys/class/backlight/rpi_backlight/brightness
VAL=50
if [ -n "$1" ];
then
VAL=$1
fi

echo $VAL > /sys/class/backlight/rpi_backlight/brightness
18 changes: 18 additions & 0 deletions checkinet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /bin/bash

# #################################################################################
#
# Indoor system script
# test the Internet access
#
# #################################################################################

TFILE=/tmp/inet.txt
wget --spider -T 5 http://dochadzka.inoteska.sk 2> $TFILE
R=`cat $TFILE | grep "request sent" | grep 200`

if [ -n "$R" ]; then
echo "1"
else
echo "0"
fi
8 changes: 2 additions & 6 deletions diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ SERIAL=`/bin/cat /proc/cpuinfo | grep -i '^serial' | grep -Eo '[a-fA-F0-9]{16}$'
DAT=$(/bin/date "+%Y-%m-%d %H:%M:%S")
CMMD=diag

#if [ $# -eq 1 ]
if [ -n $1 ]
if [ -n "$1" ]
then
# zapis informacie do DB
CMMD=$1
fi


#echo $DAT $SERIAL
#/bin/sleep 5

## INOTESKA - Diagnostika
/usr/bin/wget -q -O /tmp/dg "http://livebackups.inoteska.sk/indoor/service.php?t=$DAT&i=$SERIAL&d=$CMMD" &
/usr/bin/wget -T 10 -q -O /tmp/dg "http://livebackups.inoteska.sk/indoor/service.php?t=$DAT&i=$SERIAL&d=$CMMD" &


14 changes: 7 additions & 7 deletions indoor.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[command]
screen_saver = 98
watches = None
brightness = 90
screen_saver = 94
watches = digital
brightness = 60
dnd_mode = False

[sip]
Expand All @@ -15,8 +15,8 @@ sip_authentication_name =

[devices]
ringtone = tone2.wav
volume = 50
micvolume = 40
volume = 80
micvolume = 80

[gui]
screen_mode = 4
Expand All @@ -37,12 +37,12 @@ sip_call3 = 8765
sip_call4 =
picture_2 = 16:9
picture_4 = fill
picture_3 = 16:9
picture_3 = fill
picture_1 = 4:3

[system]
network = 192.168.1.0
dns = 192.168.1.123
dns =
ipaddress = 192.168.1.222
gateway = 192.168.1.123
inet = dhcp
Expand Down
4 changes: 2 additions & 2 deletions killapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# #################################################################################
#
# Indoor system script
# kill app
# kill all apps named $1
#
# #################################################################################

if [ -n "$1" ]; then
ps aux | grep $1 | awk 'NR==1 {print $2}' | xargs kill -9
ps aux | grep $1 | awk '{print $2}' | xargs kill -9
fi
2 changes: 1 addition & 1 deletion killme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
# #################################################################################

pkill -9 omxplayer
ps aux | grep pjindoor | awk 'NR==1 {print $2}' | xargs kill -9
ps aux | grep pjindoor | awk '{print $2}' | xargs kill -9
Binary file modified my_lib/itools.pyc
Binary file not shown.
5 changes: 4 additions & 1 deletion pjindoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ def infinite_loop(self, dt):
except:
s = []

docall_button_global.btntext = '' if len(s) > 8 else 'Network ERROR'
docall_button_global.btntext = '' if len(s) >= 8 else 'Network ERROR'
if '127.0.0.1' == config.get('system', 'ipaddress') and len(s) > 8:
Logger.error('%s: network ipaddress %r' % (whoami(), s))

Expand Down Expand Up @@ -2217,6 +2217,8 @@ def popupClosed(self, popup=None):
"restart App after alert box"
Logger.debug('%s:' % whoami())

# send_command('/usr/bin/python /root/indoorpy/runme.py &')

kill_subprocesses()
App.get_running_app().stop()

Expand Down Expand Up @@ -2330,4 +2332,5 @@ def myAlertListBox(self, titl, ldata, cb=None, ad=True):
# ###############################################################

if __name__ == '__main__':
Clock.schedule_once(lambda dt: send_command('./killapp.sh runme.py'), 20)
IndoorApp().run()
Loading

0 comments on commit cf5ac71

Please sign in to comment.