Skip to content

Commit

Permalink
wget - diag - corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
isra67 committed Jun 13, 2017
1 parent cf5ac71 commit 22959a0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 38 deletions.
1 change: 0 additions & 1 deletion my_lib/nodeclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def sendNodeInfo(msg=''):
global server_port, address, connErr

if connErr: return

# print('%s: %s' % (whoami(), msg))

try:
Expand Down
Binary file modified my_lib/nodeclient.pyc
Binary file not shown.
54 changes: 22 additions & 32 deletions pjindoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def setLock(self, value):
def dbus_command(self, params=[]):
"d-bus command"
global mainLayout
Logger.trace('%s: %s' % (whoami(), str(params)))
Logger.debug('%s: %s' % (whoami(), str(params)))

if not send_dbus(DBUS_PLAYERNAME + str(self.screenIndex), params):
sendNodeInfo('[***]VIDEO: %d ERROR' % self.screenIndex)
Expand Down Expand Up @@ -785,7 +785,8 @@ def __init__(self, **kwargs):
sendNodeInfo('[***]START')

self.infinite_event = Clock.schedule_interval(self.infinite_loop, 6.9)
Clock.schedule_interval(self.info_state_loop, 10.)
Clock.schedule_interval(self.info_state_loop, 13.)
Clock.schedule_interval(self.checkNetStatus, 19.)

Clock.schedule_once(lambda dt: send_command('./diag.sh init'), 20)

Expand Down Expand Up @@ -1138,17 +1139,15 @@ def init_myphone(self):

lib.destroy()
self.lib = lib = None
# docall_button_global.text = "No Licence"
docall_button_global.btntext = "No Licence"
# docall_button_global.color = COLOR_ERROR_CALL
docall_button_global.disabled = True
docall_button_global.imgpath = NO_IMG #ERROR_CALL_IMG
docall_button_global.imgpath = NO_IMG


# ###############################################################
def info_state_loop(self, dt):
"state loop"
global current_call, active_display_index, docall_button_global, config #BUTTON_DO_CALL, COLOR_BUTTON_BASIC
global current_call, active_display_index, docall_button_global, config

if not current_call is None: self.info_state = 0

Expand All @@ -1157,31 +1156,27 @@ def info_state_loop(self, dt):
self.info_state = 1
elif self.info_state == 1:
self.info_state = 2
elif self.info_state == 2:
self.info_state = 3
if not self.lib is None and self.scrmngr.current == CAMERA_SCR:
self.setButtons(False)
elif self.info_state == 2:
self.info_state = 3
sendNodeInfo('[***]INDOORVER: %s' % config.get('about','app_ver'))
elif self.info_state == 3:
self.info_state = 4
sendNodeInfo('[***]RPISN: %s' % config.get('about','serial'))
elif self.info_state == 4:
self.info_state = 0
sendNodeInfo('[***]INDOORVER: %s' % config.get('about','app_ver'))
sendNodeInfo('[***]RPISN: %s' % config.get('about','serial'))

if self.lib is None:
# docall_button_global.text = "No Licence"
docall_button_global.btntext = "No Licence"
# docall_button_global.color = COLOR_ERROR_CALL
docall_button_global.disabled = True
docall_button_global.imgpath = NO_IMG #ERROR_CALL_IMG
docall_button_global.imgpath = NO_IMG

if check_usb_audio() > 0: self.reinitbackgroundtasks()


# ###############################################################
def infinite_loop(self, dt):
"main neverendig loop"
global current_call, active_display_index, procs, docall_button_global, config
global current_call, active_display_index, procs

if len(procs) == 0: return

Expand All @@ -1194,6 +1189,12 @@ def infinite_loop(self, dt):
if current_call is None or idx == active_display_index:
procs[idx] = self.displays[idx].initPlayer()


# ###############################################################
def checkNetStatus(self, dt=20):
"test ETH status"
global docall_button_global, config

try:
s = get_info(SYSTEMINFO_SCRIPT).split()
except:
Expand All @@ -1215,14 +1216,6 @@ def infinite_loop(self, dt):
docall_button_global.btntext = 'ERROR'


# ###############################################################
# def reinitworker(self, dt=0):
# "SIP reinitialization worker"
# Logger.debug('%s:' % whoami())
# time.sleep(2)
# self.init_myphone()


# ###############################################################
def reinitbackgroundtasks(self):
"SIP reinitialization"
Expand Down Expand Up @@ -1406,7 +1399,6 @@ def callback_btn_docall(self, btn=None):
if make_call('sip:' + target + ':5060') is None:
txt = 'Audio ERROR' if self.mediaErrorFlag else '--> ' + str(active_display_index + 1) + ' ERROR'
docall_button_global.color = COLOR_ERROR_CALL
# docall_button_global.text = txt
docall_button_global.btntext = txt
docall_button_global.imgpath = ERROR_CALL_IMG
else:
Expand Down Expand Up @@ -1476,7 +1468,6 @@ def callback_set_options(self, btn=-1):
spinmusic = content.setline3.subbox2.musicspinner
spinclock = content.setline3.subbox3.clockspinner
spinclock.text = WATCHES
# spinclock.bind(text=self.show_selected_value)

# adjust tone list
rt = ringingTones()
Expand Down Expand Up @@ -1509,7 +1500,6 @@ def show_selected_value(self, spinner, text):

content = self.popupSettings.content
spinmusic = content.setline3.subbox2.musicspinner
# spinclock = content.setline3.subbox3.clockspinner

if spinner == spinmusic:
stopWAV()
Expand Down Expand Up @@ -1671,13 +1661,13 @@ def on_touch_up(self, touch):
if len(procs) == 0: return

if not touch is None and touch.is_triple_tap:
self.checkTripleTap(touch)
if not current_call and self.scrmngr.current == CAMERA_SCR and self.popupSettings is None:
self.restart_player_window(active_display_index)
return

# if not touch is None and touch.is_double_tap:
# if not current_call and self.scrmngr.current == CAMERA_SCR and self.popupSettings is None:
# self.restart_player_window(active_display_index)
# return
if not touch is None and touch.is_double_tap:
self.checkTripleTap(touch)
return

if current_call is None: self.startScreenTiming()

Expand Down
6 changes: 3 additions & 3 deletions tunnelgetport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ words=`echo $service | awk '{print NF}'`

if [ "$words" = "7" ]
then
if [ -n $service ]
if [ -n "$service" ]
then
PORT=`echo $service | awk '{print $2}'`
$FINAL_SCRIPT start $PORT
else
echo ERR
fi
else
echo ERR $words
# else
# echo ERR $words $service
fi
3 changes: 1 addition & 2 deletions tunnelservice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ then
fi


#wget -T 30 -O $TMP_FILE -o /tmp/wgets "$URL?t=$DATEY%20$DATEH&i=$SERIAL&d=$CMMD"
wget -T 10 -O $TMP_FILE "$URL?t=$DATEY%20$DATEH&i=$SERIAL&d=$CMMD"
wget -T 30 -O $TMP_FILE -o /tmp/wgets "$URL?t=$DATEY%20$DATEH&i=$SERIAL&d=$CMMD"

service=`cat $TMP_FILE`
if [ -n "$service" ]
Expand Down

0 comments on commit 22959a0

Please sign in to comment.