Delay kodi start until network is available

Time to time I’m experiencing following error in log after booting:

2019-11-23 20:39:37.442 T:3951776640  NOTICE: Register - new cec device registered on cec->AOCEC: CEC Adapter (0000:0000)
2019-11-23 20:39:38.783 T:3915789184   ERROR: ## CoreELEC Addon ## oe::load_url(https://update.coreelec.org//releases.php) ## ERROR: (URLError(gaierror(-3, 'Temporary failure in name resolution'
),))
2019-11-23 20:39:38.785 T:3915789184   ERROR: Traceback (most recent call last):
                                          File "/home/adamg/CoreELEC/build.CoreELEC-Amlogic.arm-9.2.0/CoreELEC-settings-cc602bcab801199018a70070804c468cbc276267/.install_pkg/usr/share/kodi/a
ddons/service.coreelec.settings/oe.py", line 273, in load_url
                                          File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
                                          File "/usr/lib/python2.7/urllib2.py", line 429, in open
                                          File "/usr/lib/python2.7/urllib2.py", line 447, in _open
                                          File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
                                          File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
                                          File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
                                        URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
2019-11-23 20:39:38.842 T:3790308224   ERROR: ## CoreELEC Addon ## oe::load_url(https://update.coreelec.org/updates.php?i=af8eff21e4a04650ae3217dc880f7b6b&d=CoreELEC&pa=Amlogic.arm&v=9.2.0&f=gxl
_p281_1g) ## ERROR: (URLError(gaierror(-3, 'Temporary failure in name resolution'),))
2019-11-23 20:39:38.843 T:3790308224   ERROR: Traceback (most recent call last):
                                          File "/home/adamg/CoreELEC/build.CoreELEC-Amlogic.arm-9.2.0/CoreELEC-settings-cc602bcab801199018a70070804c468cbc276267/.install_pkg/usr/share/kodi/a
ddons/service.coreelec.settings/oe.py", line 273, in load_url
                                          File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
                                          File "/usr/lib/python2.7/urllib2.py", line 429, in open
                                          File "/usr/lib/python2.7/urllib2.py", line 447, in _open
                                          File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
                                          File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
                                          File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
                                        URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
2019-11-23 20:39:38.848 T:3790308224   ERROR: ## CoreELEC Addon ## updates::check_updates_v2 ## ERROR: (TypeError('expected string or buffer',))
2019-11-23 20:39:38.853 T:3790308224   ERROR: Traceback (most recent call last):
                                          File "/home/adamg/CoreELEC/build.CoreELEC-Amlogic.arm-9.2.0/CoreELEC-settings-cc602bcab801199018a70070804c468cbc276267/.install_pkg/usr/share/kodi/a
ddons/service.coreelec.settings/resources/lib/modules/updates.py", line 510, in check_updates_v2
                                          File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
                                          File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
                                        TypeError: expected string or buffer

Can we first check if network is available before starting kodi? Should I do this detection in autostart.sh ?

Coreelec settings > network > Wait for network before starting kodi?

2 Likes

The advice by @trogggy will achieve what your want.