Slow network on PI2

  • Hi all, i'm just migrating from openelec to libreelec and have one small problem.
    The network on my PI 2 doesn't seem to start quick enough resulting in autostart.sh not mounting my shared storage (same autostart.sh in same location on openelec works fine) also it seems to result in my mysql server settings not being applied/partially being applied from advancedsettings.xml

    Any help accepted


  • Hi all, i'm just migrating from openelec to libreelec and have one small problem.
    The network on my PI 2 doesn't seem to start quick enough resulting in autostart.sh not mounting my shared storage (same autostart.sh in same location on openelec works fine) also it seems to result in my mysql server settings not being applied/partially being applied from advancedsettings.xml

    Any help accepted

    I am not an expert, but maybe you tell Kodi to wait until your network is active?
    hth
    Beaker

    • Official Post

    The better question perhaps is, why do you need autostart.sh for mounting shared storage in the first place?
    Mounting sources via Kodi's GUI is fairly basic and works pretty good.

    The 'Wait for network' option is always a good choice when using MySQL databases.

    Edited once, last by Klojum (July 28, 2016 at 6:44 AM).


  • The better question perhaps is, why do you need autostart.sh for mounting shared storage in the first place?
    Mounting sources via Kodi's GUI is fairly basic and works pretty good.

    The 'Wait for network' option is always a good choice when using MySQL databases.


    I have multile PI's all connecting to a central MySQL instance to share the library
    I have autostart.sh to create several folders if they don't exist and auto mount several shares to them, as all sources need tobe exactly the same to work properly

    The paths the shares are on are several folders deep and i don't want to just connect every PI to the root of my shared storage as that gives access to everything (standard security practice)

    I regularly experiment with betas and can't be bothered typing in lots of path names, usernames, password etc every time i wipe a PI reinstall to remove a beta.

    Basically i have several files i copy to a PI after wiping to reconfigure everything as i want it without having to go back and forth through the menus trying to remember where everything is.

    Autostart.sh has always worked before but for some reasonon libreelec on this specific PI it can't. also when kodi starts i get a couple of tvheadend disconnected messages, then a connected message as the network finally connects, then i sync's the channels and guide so it is a network issue on this PI 2 and libreelec as the problem didn't exist on openelec.
    [hr]


    I have multile PI's all connecting to a central MySQL instance to share the library
    I have autostart.sh to create several folders if they don't exist and auto mount several shares to them, as all sources need tobe exactly the same to work properly

    The paths the shares are on are several folders deep and i don't want to just connect every PI to the root of my shared storage as that gives access to everything (standard security practice)

    I regularly experiment with betas and can't be bothered typing in lots of path names, usernames, password etc every time i wipe a PI reinstall to remove a beta.

    Basically i have several files i copy to a PI after wiping to reconfigure everything as i want it without having to go back and forth through the menus trying to remember where everything is.

    Autostart.sh has always worked before but for some reasonon libreelec on this specific PI it can't. also when kodi starts i get a couple of tvheadend disconnected messages, then a connected message as the network finally connects, then i sync's the channels and guide so it is a network issue on this PI 2 and libreelec as the problem didn't exist on openelec.

    Oh and the delay in the network connecting also results in kodi not connecting to MySQL which to be honest is a bigger problem!

    Edited once, last by dave2318 (July 28, 2016 at 7:05 AM).

  • Hi dave2318,

    After reading through what you have said, I would highly suggest changing the method of how you have your pi's configured. There shouldn't be any need to mount shares via the autostart.sh. I have multiple kodi devices (Windows / Linux / rpi's) that all use the same 2 files for the configured (advancedsettings.xml & sources.xml). All I have to do with a fresh install is copy those files to the user_data folder and once rebooted, everything is back in sync.

    Also the "wait for network" option I would advise to enable anyway as it doesn't hurt to have this option enabled.


  • Hi dave2318,

    After reading through what you have said, I would highly suggest changing the method of how you have your pi's configured. There shouldn't be any need to mount shares via the autostart.sh. I have multiple kodi devices (Windows / Linux / rpi's) that all use the same 2 files for the configured (advancedsettings.xml & sources.xml). All I have to do with a fresh install is copy those files to the user_data folder and once rebooted, everything is back in sync.

    Also the "wait for network" option I would advise to enable anyway as it doesn't hurt to have this option enabled.

    So does the sources.xml store the usernames and passwords for network shares? and if so does it store them as plain text or encrypted (i currently have them referenced from a seperate file and stored encrypted)?
    Yes, i have left the wait for network enabled.

    The big problem though is that mysql doesn't connect on boot as it can't see the server so this PI doesn't have all the resume points etc sync'd that all the oters do.

  • You can even use path subs for sources.xml, meaning the advancedsettings.xml file will define the path to sources.xml, and you only have to bother with one file.

    If that's still not enough, just make a second profile on Kodi. The master/default profile won't use MySQL, and you will boot up to the profile log-in screen. By the time Kodi shows this window, and you select your real/secondary profile, your network connection will be up.

  • So does the sources.xml store the usernames and passwords for network shares? and if so does it store them as plain text or encrypted (i currently have them referenced from a seperate file and stored encrypted)?
    Yes, i have left the wait for network enabled.

    The big problem though is that mysql doesn't connect on boot as it can't see the server so this PI doesn't have all the resume points etc sync'd that all the oters do.

    I believe if they are password protected shares, there will be an additional file called passwords.xml. I would assume that it's encrypted but I would suggest to check.
    Never had the issue myself with mysql not connecting with the wait for network enabled. In theory the boot method should be:
    LibreELEC Boots > Waits for Network > Kodi Loading > MySQL connect.

    If you are having some issues, post some logs and someone here can take a look,


  • You can even use path subs for sources.xml, meaning the advancedsettings.xml file will define the path to sources.xml, and you only have to bother with one file.

    If that's still not enough, just make a second profile on Kodi. The master/default profile won't use MySQL, and you will boot up to the profile log-in screen. By the time Kodi shows this window, and you select your real/secondary profile, your network connection will be up.

    That seems like an awful lot of faffing about to solve a problem that didn't exist on openelec.

    I have been searching the openelec forums this morning and it appears that if i simply add sleep 25 to the begining of my autostart.sh it will delay the boot to kodi for 25 seconds, which may well solve my problem!
    [hr]

    I believe if they are password protected shares, there will be an additional file called passwords.xml. I would assume that it's encrypted but I would suggest to check.
    Never had the issue myself with mysql not connecting with the wait for network enabled. In theory the boot method should be:
    LibreELEC Boots > Waits for Network > Kodi Loading > MySQL connect.

    If you are having some issues, post some logs and someone here can take a look,

    Hi J0nnymoe,

    The problem is the network only seems to properly connect about 5 seconds after kodi has launched so i get 1-2 tvheadend client disconnected messages before it connects and starts syncing, so Kodi has well and truely started before the network connects.

    Edited once, last by dave2318 (July 28, 2016 at 8:46 AM).

  • That seems like an awful lot of faffing about to solve a problem that didn't exist on openelec.

    I have been searching the openelec forums this morning and it appears that if i simply add sleep 25 to the begining of my autostart.sh it will delay the boot to kodi for 25 seconds, which may well solve my problem!
    [hr]

    Hi J0nnymoe,

    The problem is the network only seems to properly connect about 5 seconds after kodi has launched so i get 1-2 tvheadend client disconnected messages before it connects and starts syncing, so Kodi has well and truely started before the network connects.

    Are you running tvheadend and mysql all on the same pi?