Raspberry Pi 2 loses ethernet connection

I have a headless setup with OpenHAB, Aeontech z-wave usb stick(Gen5) and a Tellstick Duo running. Both sticks connected to the raspberry pi usb ports. The Pi is powered by 5V 2A. Recently the (cabled) ethernet connection on the Pi suddenly drops out, the Pi looks like to be running fine, just not the network connection. To get it back online again I have to unplug the power, cannot SSH into it. Anyone have a clue what could cause this? There is no info in logs. Any help on this would be great.

In my experience the RasPis tend to be a bit flakey after running for a long time (days) by dropping off the network. It is less prevalent when using ethernet verses a wifi dongle but it still happens. I scoured the web for solutions and the best I’ve found was to make sure to use a really high quality power supply (both plug and cable). In the end I got fed up and plugged the RasPis into a z-wave outlet and cycle the power when it falls off the network. But I’m not running openHAB on my Pis, only sensors and actuators, so I can do that within openHAB. In your case you would need something else to monitor and rest the plug.

1 Like

I’ve got OpenHAB running on a Pi2 as well (with Raspian). Powered over USB from AVM Fritz Box’ USB Port (no Power Supply at all). There is an Rfxcom RFXTRX and an Arduino Uno (MySensors Gateway) connected directly to the Pi 2.

Power is no issue at all. No reboots, no networking problems. Maybe it is also important to have a clean (non rippled) power and no devices with extreme peak current (even though the radios peak pretty heavily).

Maybe you really have a faulty device. If you cannot connect a screen and keyboard to it while debugging, I recommend you to check this when it happened:

  • see the dmesg log (right before the [0.0000000] entries of your next boot
  • look at the network LINK and ACTIVITY LEDs on the Pi 2 if there is something happening
  • look at your switch if you have a link

It would really help to connect a spare screen to it and see if the module (driver) is still loaded: lsmod or threw errors anywhere in /var/log/*.log

1 Like

I’m running my OpenHAB installation on an RPi2 without any trouble. I’m using a 2amps power supply, and I don’t have any hardware attached to it.

# uptime                             
16:27:49 up 41 days,  5:27,  1 user,  load average: 0.01, 0.08, 0.16

I will, however, attach an USB harddrive to it in order to log my measurement values.

1 Like

Thanks for your replies, will try another Pi to see if that may fix the problem.

Another possibility which I have experienced is (I think) network/router-related. Symptoms are the Pi running Openhab correctly but all (including local) web access has failed. It shows in the OH logs as (rough paraphrase) “jDNS failure. cannot recover”. I believe (for the moment) that this is a result of ISP actions which cause a momentary but fatal hiccup when OH is trying to talk to my.Openhab, mostly because it tends to happen around 4-5 a.m., especially on weekends…ie prime maintenance time when Comcast might be pushing stuff out.

1 Like

Yes, that is the time it usually happens. Will try and disable my.openhab to see if that could be the cause.

I had major issues this week with ethernet.

Granted a few disconnects are not the end of the world, but a flaky connection when downloading and changing stuff caused me no end of grief. With various gpd codes being corrupt, and not able to use use apt-get at all.

I had the RPi2i using a 2.0a usb power adaptor (PiHut) and then one usb to a powered usb hub (also PiHut) which was powering my external hdd (because I was fed up of constant SD corruptions), usb sound adapter and RFXcom

When I switched to WiFi, everything was able to sort itself out. And whilst I was ready to start using my multimeter, the 16+ hours I spent getting it back to a working state convinced me to let it be. As I and sure it will do something obscure again soon, that will require hours of research to fix :smile:

1 Like

Also do not overclock. I’m wondering why so many people have problems. Usually they just run fine like a microcontroller. But you should let it run at its specs and not change clock speeds.

1 Like

No overclock here, have removed the my.openhab binding now and will see how that works out. If that does not work I will switch to a wifi adapter, and use a cron job to check the wifi connection, and reset it if there is no connection. Not sure how to do that with eternet.

You can use a watchdog for this. The Raspberry even has a hardware watchdog which works, even if the OS is completely frozen: http://linux.die.net/man/8/watchdog

But having said that, waiting until something is broken to “auto-pseudo-fix” it is a really hacky approach you shouldn’t aim for.

1 Like

I’m experiencing the same problems but with wifi. after some days it stops responding but attached devices still work, like z-wave but my hue’s won’t work anymore.
My workaround here is to check the router/fritz.box with the network-health binding. if this changes to OFF i wait for some minutes, check the item again and if it’s still offline i execute /etc/init.d/networking restart
this seems to work, and i don’t have to reboot the whole raspi.

Looks like in my case it was the xbmc binding causing the dropout. Will report back in a few days to confirm.

Edit: No, it was not the xbmc binding. Will continue investigating.

Well, in my case it was a flakey pi. Got a new one , and has been running stable for 5 days now.

My Raspberry Pi 2 has dropped out yesterday and now again today, it had been working for a month before dropping yesterday.

I cannot connect to openhab through the web interface locally or ping the RPi. But I have portforwarding set up and I can connect to the RPi from outside my network.

All my Wifi devices connect to the MQTT broker without issue, But i cannot SSH into the PI.

No idea why, did anyone work out what it was?

Ever since day 1 with OpenHAB I‘m experiencing random complete disconnects of my Raspi 3B+ (running Docker / OpenHAB) from ethernet (no link anymore) after a couple of days or weeks.

What‘s odd:

  • When this happens, the Raspi seems to be still running fine (headless) but the Ethernet LEDs are completely off (even when I unplug / reconnect the network cable).
  • When this happens, the only thing that helps is a reboot. Afterwards everything is fine again.
  • I changed the Ethernet cable already.
  • I already did a fresh install of everything.
  • Power supply also looks fine though.

Any clues?

I would try:

  1. Running openHABian to confirm that docker isn’t the issue.
  2. Trying a USB ethernet adapter. This doesn’t tell you where the actual problem is (could still be hardware or software), but might be the simplest fix.

Thanks. Will try switching hardware (at least what’s not been changed).

Btw: My logs show the following readings when the link went down / the Raspi NIC LEDs are switched off:

Jul  6 07:57:01 raspberrypi dhcpcd[588]: eth0: carrier lost
Jul  6 07:57:01 raspberrypi dhcpcd[588]: eth0: deleting route to 192.168.0.0/24
Jul  6 07:57:01 raspberrypi dhcpcd[588]: eth0: deleting default route via 192.168.0.1
Jul  6 07:57:01 raspberrypi avahi-daemon[404]: Withdrawing address record for 192.168.0.150 on eth0.
Jul  6 07:57:01 raspberrypi avahi-daemon[404]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.150.
Jul  6 07:57:01 raspberrypi avahi-daemon[404]: Interface eth0.IPv4 no longer relevant for mDNS.
Jul  6 07:57:02 raspberrypi avahi-daemon[404]: Got SIGHUP, reloading.
Jul  6 07:57:02 raspberrypi avahi-daemon[404]: No service file found in /etc/avahi/services.

Does this look familiar to anyone?

I usually try googling specific phrases in error messages. In this case, I tried “Withdrawing address record for 192.168.0.150 on eth0”.

This result suggests switching to a static IP (I assume from the router).

This epic Ubuntu bug report/discussion includes a few theories, and spans from May 2016 until January 2022.

Whatever the case, it sounds like an OS issue and not a hardware fault.

Thanks a lot for the hint, @rpwong. Will try switching to a static IP address on the Raspi.

And yes, I did spend endless hours on finding a solution on this on the net, though it hasn’t crossed my mind that I might be looking at a potential bug or edge case that could potentially be solved via a static IP address.

1 Like