Speeding up boot process when using Wifi

Hi,

When using a wifi connection, the boot process is slowed down by the ethernet interface. On my Pi2 B it can take more than a minute to reach the timeout and to continue the boot sequence.
It is because the eth0 interface is declared as “auto eth0” in the /etc/network/interfaces file. It waits for a cable to be connected and the timeout is quite big.
Changing the line to “allow-hotplug eth0” will abort the configuration of the ethernet interface when no cable is plugged.
I did this and now booting is really fast.
Changes where made also in the /var/www directory on files command/player_wrk.php, net-config2.php and net-config.php in order to write a corrected file when choosing the network connectivity.

Can this be changed in a future release?

Hi!
I was looking for a solution to this “problem”. So your trick is very welcome !
Could you please give more detail about what you exactly change in the file given : in net-config2.php “auto eth0” appears several times. Do I have to change each time it appears? etc…
Thanks a lot

I changed every occurence of auto eth0 to allow-hotplug eth0. I don’t know if this is necessary but I did it.
You can change the /etc/network/interface file, it won’t be changed until you do it via the web interface.

Hi,
Could you please let me know what you exactly changed in the net-config2.php?
If you could post the new file here I can check it.
Since the net-config2.php is used by sound@home app.
Thanks!

Hi Digx!
Happy to see you are back here ! :wink:
Don’t know if you asked Stephane or me, but please find attached the file I have modified.
It work and boot 60 sec faster with this option.
regards
net-config2.php.tar.gz (2.64 KB)

I’m using this solution and it is working great : raspberry-boot-without-eth0-t2177.html

@ducobu
Even if your solution works, I see two problem

  • if you go to the network setting page, it will erase the modification you have done in /etc/network/interfaces
  • if one day your wifi is down (whatever is the reason) you won’t be able to use your system by pluging a ethernet cable so that reconfigure it etc…;
    So it’s why, even if it is more complicated to modifiy as Stephane explained.

Indeed, you’re right. I will test your file !

Thanks balbuze!
I will check it before to publish new App version :wink:

Have a nice day!

Hello,

To find the files containing the “auto eth0” word:

fgrep -r "auto eth0" /var/www/*

To edit them and change every occurrence of “auto eth0” to “allow-hotplug eth0” with vi:
vi file.php
[ESC]:%s/auto eth0/allow-hotplug eth0/g
[ESC]:wq
where [ESC] is the escape key

I did not check the file provided by Balbuze but I guess it’s OK.

I checked it,
and it seems ok except for one issue needs to be fixed also from original php file:

line 106:

original -->
if (isset($_POST[‘wifisec’][‘ssid’]) && !empty($_POST[‘wifisec’][‘ssid’]) && $_POST[‘wifisec’][‘password’] && !empty($_POST[‘wifisec’][‘password’]))

to be: -->

if (isset($_POST[‘wifisec’][‘ssid’]) && !empty($_POST[‘wifisec’][‘ssid’]) && isset($_POST[‘wifisec’][‘password’]) && !empty($_POST[‘wifisec’][‘password’]))

I will finalize my check and I will ask Michelangelo to update the file net-config2.php in new release.

Thansk to all of you!

Thank you very much for this info, I’m also using the pi2 on wifi and had expected it to boot up quicker than it is doing.
I have a couple more questions (being totally new to Linux and PI)…
How did you know that it was the timeout on ether net? I didn’t get any output through hdmi when I booted volumio.
Would it also speed things up if using a fixed ip address for wifi, instead of waiting for DHCP to assign one?

Regards

Hello,

It’s the way the file configuring the network is written that led me to this modification. I have been using Linux for many years and Debian based distributions (mainly Voyage) for my work and while searching to get an answer for a network problem I found that changing the line “auto eth0” to “allow-update eth0” would speed up the boot process. I tried it on Volumio with success.
The system initializes all interfaces present in the file /etc/network/interfaces. For Volumio, first the Wifi and then the ethernet. allow-hotplug enables the system to detect if a cable is present or not and it won’t initialize the ethernet interface if no cable is present.

Putting a fixed IP address will speed up a little bit, few seconds I guess, but you don’t boot your system so frequently. Unless you have a very slow responding DHCP server, stay on DHCP.

Excuse me, but unfortunately I’m not an expert about Linux, and when I follow exactly your instructions ( I use PuTTY), I get this written:
fgrep: autoeth0: No such file or directory . Where is mi mistake :frowning: ?

The first modification (inside /etc/network/interfaces) gone well…
Thanks

Ooops, sorry, my bad, the correct syntax is: fgrep -r "auto eth0" /var/www/*

It will search for occurrences of auto eth0 in the directory /var/www/ and all the subdirectories into all files.

Is this still relatable in 2020? im wondering if i can speed up my boot process.

I dont see “www” directory in /var/ so im wondering if this still work?

No, forget that. It was for Volumio <1.5

Is there a way to speed up the boot process on volumio 2.799 or its already at its peak?

Im getting 1min 30sec boot time on a RPi 3B

What SD-card are you using?

I noticed it can play a big role with boot time

Kingston SDCS-32GB micro SD card