I'm working with a raspberry pi 3 running a fresh install Raspbian Stretch Lite. Basically my problem is that the pi inconsistently connects to our network. I've been running
sudo ifdown wlan0; sudo ifup wlan0
over and over again and have found that 3 different things happen.
1
I see the following line near the end of the output (ip addresses changed):
DHCPACK of 192.168.99.120 from 192.168.99.254
That's the ip that I'm used to seeing for the pi and the router. The pi can access the internet, and I can ssh into it.
2
I see the following line near the end of the output:
DHCPACK of 192.168.1.106 from 192.168.1.1
The ip address for the pi and the router are different than usual. The pi seems to be connected to the network, but I cannot ping the router or anything else, and I cannot ssh into it.
3
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpa/supplicant exited with return code 1
ifup: failed to bring up wlan0
Obviously, no internet, no ssh.
It seems that the wpa_supplicant fails to start about half of the time, and if it does connect it's 50/50 on which ip addresses I'll see for the pi and the router. If the pi is connected to the wifi network properly it will stay connected for days or weeks without any trouble, so I don't think it's problem with the pi's wifi chip.
I haven't been able to find a record of anything like this, but I do know that our network is known to give some devices trouble. Does anyone have any idea what the problem or at least have some advice on how to live with it.
/etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
/etc/wpa_supplicant/wpa_supplicant.conf
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="myNetwork"
psk="reallyGoodPassword"
}
/etc/network/interfaces
your system would work better (the current configuration effectively does NOTHING). – Milliways Oct 27 '17 at 22:44/etc/network/interfaces
, but it seems that I can just work withwpa_supplicant.conf
. It is worth noting thatifdown/ifup
will not work without/etc/network/interfaces
and thatip link set dev up/down
should be used instead. – Hatch Oct 31 '17 at 15:48