Othernet-Project / orx-install

ORx install scripts
http://outernet-project.github.io/orx-install/
GNU General Public License v3.0
94 stars 61 forks source link

Solve the mistery of unconfigured wlan0 interface on boot #13

Closed foxbunny closed 9 years ago

foxbunny commented 9 years ago

This seems to work:

allow-hotplug wlan0
iface wlan0 inet static
 address 10.0.0.1
 netmask 255.255.255.0
 gateway 10.0.0.1

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Not quite sure whether wpa-roam /etc/....conf is required, but it doesn't seem to hurt, so I left it there. The most important factor seems to be that wlan0 is allow-hotplug instead of auto.

foxbunny commented 9 years ago

Complete /etc/network/interfaces looks like this:

auto lo

iface lo inet loopback

allow-hotplug eht0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet static
 address 10.0.0.1
 netmask 255.255.255.0
 gateway 10.0.0.1

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
foxbunny commented 9 years ago

Ok, the above only seems to work every other boot. Nothing in logs that would lead to any new ideas. My try fiddling with /etc/defaults/ifplugd and try to disable hotplugging for eth0 based on hints given here: http://raspberrypi.stackexchange.com/questions/8851/setting-up-wifi-and-ethernet

The only problem is the above setup works every other boot or so, so it'll be tricky to ensure it actually always works...

foxbunny commented 9 years ago

I have had some success with disabling hotplugging for eht0. I'm currently patching the script to reflect this change.

Since I don't really feel like writing a interfaces file parser just to patch existing configuration, script will offer the user some pointers and offer to bring up an editor (nano by default or whatever is set as $EDITOR env var if any). The script will also offer to patch the /etc/defaults/ifplugd and empty the list of hotpluggable interfaces (I think we can safely assume the only possible interface here is eht0 anyway).

Once hotplugging is disabled and eth0 is set to auto (or removed from interfaces file), wlan0 should work as expected. I'll test this a bit more and close this issue.

foxbunny commented 9 years ago

Looks like it's fixed. Closing. Will reopen if it resurfaces.

wpt-steve commented 9 years ago

Hi Branko,

My two cents on the install script.

While many adopters will appreciate all the work you have done to put this configuration in a script, others will want to make modifications to their existing configuration manually. I prefer the manual because I can easily unwind or modify the change if it doesn’t work for my configuration. I prefer the script when to modify the Outernet specific configuration files, but prefer to manually edit the common files. That said, I also think it would be nice to have a comprehensive script that completely installs everything if it is starting with a fresh install of Raspbian.

--Steve

From: Branko Vukelic [mailto:notifications@github.com] Sent: Friday, July 25, 2014 2:19 PM To: Outernet-Project/orx-install Subject: Re: [orx-install] Solve the mistery of unconfigured wlan0 interface on boot (#13)

I have had some success with disabling hotplugging for eht0. I'm currently patching the script to reflect this change.

Since I don't really feel like writing a interfaces file parser just to patch existing configuration, script will offer the user some pointers and offer to bring up an editor (nano by default or whatever is set as $EDITOR env var if any). The script will also offer to patch the /etc/defaults/ifplugd and empty the list of hotpluggable interfaces (I think we can safely assume the only possible interface here is eht0 anyway).

Once hotplugging is disabled and eth0 is set to auto (or removed from interfaces file), wlan0 should work as expected. I'll test this a bit more and close this issue.

— Reply to this email directly or view it on GitHub https://github.com/Outernet-Project/orx-install/issues/13#issuecomment-50185432 . https://github.com/notifications/beacon/8193330__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMTkzMTUyMSwiZGF0YSI6eyJpZCI6Mzc5NzY4MTF9fQ==--e6cd07dadefe51838bf6bf492b34cd06b3d7d9df.gif

foxbunny commented 9 years ago

I agree some people may want to do it completely manually, so they will certainly have instructions to do that.

The AP script definitely falls under convenience category. If people already run an AP, they will probably not want to use the script at all.

Btw, it does offer to fire up an editor for /etc/network/interfaces. It doesn't automatically patch /etc/network/interfaces since it's hard to make any assumptions regarding that particular file. Other files are always backed up with '.old' extension (I might change that to .orx_old so that it's clear it was backed up by the script) and then patched. When the script backs up a file, it logs what file it backed up and what the new file name is, so user can review the log and find out where to find the original. It also only backs up if there are no existing backups, so if you run the script multiple times, it won't overwrite the original.