Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Increase wait for eth0?
#1
Is there a way that I can increase the wait time for an IP address to be assigned to eth0 from its current 9sec?
Reply
#2
You could hack /var/www/command/worker.php. Currently it checks 5 times and there is a 3 sec delay between checks so total of 15 sec max wait.

The line to modify in the code block below is:  $eth0ip = waitForIpAddr('eth0', 5);

Change 5 to something > 5 then save the file and reboot.

Code:
//
workerLog('worker: -- Network');
//

// Check ETH0
$eth0 = sysCmd('ip addr list | grep eth0');
if (!empty($eth0)) {
    workerLog('worker: eth0 exists');
    // Wait for address (default), setting is on system config
    if ($_SESSION['eth0chk'] == '1') {
        $eth0ip = waitForIpAddr('eth0', 5);
    }
    else {
        $eth0ip = sysCmd("ip addr list eth0 | grep \"inet \" |cut -d' ' -f6|cut -d/ -f1");
    }
}
else {
    $eth0ip = '';
    workerLog('worker: eth0 does not exist');
}
!empty($eth0ip[0]) ? log_network_info('eth0') : workerLog('worker: eth0 address not assigned');
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Done!
Thanks Tim for a such a speedy reply.
Reply
#4
I'm curious do you know what might be causing DHCP to be so slow at handing out IP address? Usually is almost instant.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(07-29-2020, 10:17 PM)Tim Curtis Wrote: I'm curious do you know what might be causing DHCP to be so slow at handing out IP address? Usually is almost instant.

I'm using this as a wifi range extender, connected to Pi by ethernet: https://www.gl-inet.com/products/gl-mt300n-v2/
It takes a while to boot up and if I power that and the Pi at the same time the Pi (with a USB DAC) won't connect.
With my other system using a HAT I2S DAC the longer delay doesn't seem to be necessary.
Reply


Forum Jump: