diff --git a/indoor.ini b/indoor.ini index f7db327..09be25f 100644 --- a/indoor.ini +++ b/indoor.ini @@ -66,6 +66,7 @@ masterpwd = 1 buttonfactory = button_factory app_log = debug sip_log = debug +update_repo = production tunnel_flag = 0 app_upd = button_app_upd autoupdate = 0 diff --git a/my_lib/config.py b/my_lib/config.py index 20c7ca0..d4a5ac2 100644 --- a/my_lib/config.py +++ b/my_lib/config.py @@ -56,6 +56,7 @@ 'app_log': 'error', 'tunnel_flag': False, 'autoupdate': 1, + 'update_repo': 'production', 'sip_log': 'error' } dict_about = {'app_name': 'Indoor 2.0', 'app_ver': '2.0.0.0', diff --git a/my_lib/config.pyc b/my_lib/config.pyc index a169cc4..ae19da2 100644 Binary files a/my_lib/config.pyc and b/my_lib/config.pyc differ diff --git a/my_lib/itools.py b/my_lib/itools.py index 8f1834b..e7d7499 100644 --- a/my_lib/itools.py +++ b/my_lib/itools.py @@ -108,6 +108,9 @@ def get_info(cmd): # ############################################################################## def getINet(): + "check the Internet connection" + return True ### stop checking + info = '0' try: info = get_info('./checkinet.sh') diff --git a/my_lib/itools.pyc b/my_lib/itools.pyc index e42d9ed..e9e7470 100644 Binary files a/my_lib/itools.pyc and b/my_lib/itools.pyc differ diff --git a/pjindoor.py b/pjindoor.py index c2adade..07df0ac 100644 --- a/pjindoor.py +++ b/pjindoor.py @@ -833,6 +833,7 @@ def __init__(self, **kwargs): self.infinite_event = Clock.schedule_interval(self.infinite_loop, 6.9) Clock.schedule_interval(self.info_state_loop, 12.) + Clock.schedule_interval(self.auto_update_loop, 3600) Clock.schedule_once(self.checkNetStatus, 5.) Clock.schedule_once(lambda dt: send_command('./diag.sh init'), 15) @@ -1234,6 +1235,16 @@ def infinite_loop(self, dt): procs[idx] = self.displays[idx].initPlayer() + # ############################################################### + def auto_update_loop(self,dt): + "auto update ar 3:00AM" + + h = datetime.datetime.now().hour + if h == 3: + Logger.info('%s:' % whoami()) + App.get_running_app().appUpdateWorker() + + # ############################################################### def checkNetStatus(self, dt=20): "test ETH status" @@ -1245,11 +1256,13 @@ def checkNetStatus(self, dt=20): sendNodeInfo('[***]IPADDR: %s' % s[3]) except: s = [] - if netlink.netstatus > 0: netlink.netstatus = getINet() + if netlink.netstatus > 0: netlink.netstatus = 1 if getINet() else -1 docall_button_global.btntext = '' if self.lib else 'No Licence' docall_button_global.btntext = docall_button_global.btntext if len(s) >= 8 else 'Network ERROR' docall_button_global.btntext = docall_button_global.btntext if netlink.netstatus > 0 else 'ETH ERROR' + if netlink.netstatus == -1: docall_button_global.btntext = 'Internet ERROR' + if '127.0.0.1' == config.get('system', 'ipaddress') and len(s) > 8: Logger.error('%s: network ipaddress %r' % (whoami(), s)) @@ -1267,8 +1280,6 @@ def checkNetStatus(self, dt=20): Logger.error('%s: config %r' % (whoami(), config)) # docall_button_global.btntext = 'ERROR' -# Clock.schedule_once(self.checkNetStatus, 24.) - # ############################################################### def reinitbackgroundtasks(self): @@ -2390,9 +2401,9 @@ def appUpdateWorker(self): # send_command('./appdiff.sh') i2 = get_info('../app/appdiff.sh') i1 = get_info('./appdiff.sh') - else: - MyAlertBox(titl='WARNING', txt='Success.\n\nApplication is going to restart!\n\nPress OK', - cb=self.popupClosed, ad=False).open() +# else: +# MyAlertBox(titl='WARNING', txt='Success.\n\nApplication is going to restart!\n\nPress OK', +# cb=self.popupClosed, ad=False).open() # ############################################################### diff --git a/runme.py b/runme.py index 00ddc51..299e7a6 100644 --- a/runme.py +++ b/runme.py @@ -133,7 +133,7 @@ def update(self): self.getSDcard() self.getUptime() self.getNetwork() - self.getINet() +# self.getINet() self.getAudio() self.getTunnel() self.getNodeServer()