I have recently run into a very frustrating problem on my raspberry pi 2. Everything has been fine since initial setup (~5 weeks). I have a hidden WiFi SSID, but once I figured out how to set that up with the Pi, everything worked great.
Suddenly, this morning, I was getting 50-70% packet loss with ping
(LAN or WAN) and connecting via SSH over LAN (wifi) was extremely slow and laggy.
ping
ing any local machine that was connected to my network via wifi or ethernet was giving large packet loss. Connecting via SSH with PuTTY was slow to connect (~10s) and after I connected, typing would be extremely slow and laggy, and would often freeze up entirely. I hooked the Pi back up via HDMI to troubleshoot, and typing was fine in the terminal (so it wasn't just my Pi being slow).
Long story short, I ended up setting up a static IP on the Pi and on my router, which has apparently resolved both the packet loss issue and the slow SSH issues (which are related, obviously). My question is:
- why might this problem occur?
- what diagnostics can I try next time this happens to figure out the cause?
- why does setting a static IP fix the problem?
Here is my setup and configuration:
- Model: Raspberry Pi 2 Model B+
- Linux version: Raspbian Wheezy, Linux rpi 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU/Linux
- WiFi adapter: Canakit WiFi dongle, RT5370 chipset
/etc/networking/interfaces
:
auto lo
iface lo inet loopback
iface eth0 inet static
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off
iface default inet static
address 192.168.1.8
netmask 255.255.255.0
gateway 192.168.1.1
/etc/wpa_supplicant/wpa_supplicant.conf
:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="mywifissid"
scan_ssid=1
psk="mypassword"
mode=0
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
auth_alg=OPEN
id_str="rpi"
priority=1
}
network={
ssid="guestnetwork"
psk="guestpassword"
key_mgmt=WPA-PSK
disabled=1
}
service dhcpd restart
. Worth consulting: http://raspberrypi.stackexchange.com/q/37920/5538 – goldilocks Dec 06 '15 at 19:58ip addr
say? I had a problem wherein my wlan0 had 2 ip addresses assigned to it and it caused some issues like this. – tejas Aug 15 '16 at 15:24