I posted a question previously on how to set up a static IP address on the rpi and eventually figured out, along with some others, that the answer was to change wpa-roam to wpa-conf when pointing to /etc/wpa_supplicant/wpa_supplicant.conf, but why does this work?
i.e. when I have this in my /etc/network/interfaces file:
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
address 192.168.0.3
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255
network 192.168.0.0
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Assuming that /etc/wpa_supplicant/wpa_supplicant.conf has been properly configured, this method doesn't work.
This is the relevant output from iwconfig:
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.437 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
As well as from ifconfig:
wlan0 Link encap:Ethernet HWaddr ec:1a:59:64:3a:36
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:847 errors:0 dropped:1029 overruns:0 frame:0
TX packets:759 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:677394 (661.5 KiB) TX bytes:133345 (130.2 KiB)
But everything magically starts working once you change wpa-roam to wpa-conf and run sudo /etc/init.d/networking restart. When would you use wpa-roam, and when would you use wpa-conf?
sudo /etc/init.d/networking restart– Jochem Schulenklopper Jan 02 '15 at 13:52/etc/init.d/networking restartat all haha. – Lawrence Jan 09 '15 at 02:42wpa-confdoesn't affect reconnection. Mine will reconnect with either method. – Steve Davis Feb 23 '15 at 20:56wpa-roamifplugddisconnectswlan0wheneth0is plugged in. It's configurable behaviour, and might be RaspberryPI specific. – domen Sep 24 '15 at 20:15wpa-roamand have ethernet cable connected, then when I run asudo ifconfig, I would see same IP address foreth0andwlan0? – tumchaaditya Sep 23 '18 at 01:29