1

I have the following problem.

I want to have access on my Raspberry Pi 3 via WiFi. I have once set it up using the GUI, but now running it in the headless mode. The problem now is that this works for about 3 days then I can't connect to the Pi anymore.

I found out what I then need to do is to plug in the ethernet cable and then it works again. I have also seen that there are two default routes installed. One goes over wlan0 and the other over eth0.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    202    0        0 eth0
default         192.168.0.1     0.0.0.0         UG    303    0        0 wlan0
192.168.0.0     *               255.255.255.0   U     202    0        0 eth0
192.168.0.0     *               255.255.255.0   U     303    0        0 wlan0

So I assume that once I plug out the ethernet cable, the outgoing connections try to go over eth0 instead of wlan0. When I then delete the entries for eth0, WiFi works again but only for around 3 days, then all starts over again.

The following are my configuration files for the /etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

and the /etc/wpa_supplicant/wpa_supplicant.conf:

country=CH
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="SSID"
    psk=HashedPassword
}

Any ideas on that? Thanks

PS: I know that there is another question related to this, but that approach did not help me.

1 Answers1

1

Your assumption is correct, when you plug in an Ethernet cable, a connection is established via eth0 instead of wlan0. Actually, when you have wlan on and an Ethernet cable connected, you can SSH through both connections simultaneously.

I had a similar problem with Wi-Fi. It turns out a manual reboot of the system every day helps the problem. Just set up a cronjob to reboot the Pi once a day. It resolved my problems.

Darth Vader
  • 4,206
  • 24
  • 45
  • 69
Bozidar
  • 46
  • 3
  • Could it be power related? I had some funky happenstances when I had connected multiple low-power USB devices without a powered hub. – James Finch May 06 '17 at 11:59
  • So I have now setup a crontab for a daily reboot, so I'll see tomorrow how it goes. @JamesFinch: I do not believe it is power related. At least I hope not, since I have the official power supply from Raspberry Pi. – Dr3w Br1ck13 May 06 '17 at 13:22
  • So setting up the cronjob helped, but I don't think this is the right solution about this. – Dr3w Br1ck13 May 07 '17 at 12:13