zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

[Solved] Ehternet fails after some days

Tue Jul 16, 2013 8:00 am

Hi all,
I am fooling around with my Pi (model B) for some time now. It has been running debian with RTL-SDR tcp/ip server for some months, has been running XBMC for a week or two and now I am using the same Pi as smart meter reader.

What never happened before now does happen, every now and then (sometimes after 2 days, sometimes after 4 days) the Pi justs stops doing it's work. The smart meter data is being produced with the rrdtool, which graphs are being displayed by use of the apache webserver. The Pi is connectable by SSH, has no local monitor or keyboard. Suddenly the webpage with the graphs can not be reached, and the Pi can not be connected by SSH or reached by Ping anymore. Led's on the Pi are the same as when it's running normally, sometimes the network led blinks, power is on, but the unit is unreachable. After disconnecting the power supply and re-connecting the Pi comes back to live again, after which I can see on the graphs at what time it got offline.

What would be the proper (log) file to view to get a clue why the Pi is suddenly stopping it's work ? Is there a possibillity to add a (hardware) button so gently reboot the Pi making the risk of damaging the filesystem as small as possible ?

I am running the latest Pisces image, with update, upgrade and manually installed Apache and Python. If any other info is required please let me know. I understand that the fault is quite vague but I hope someone can point me into the right direction.

Any help would be greatly appreciated,

Thanks,
Ben
Last edited by zanco on Sat Jul 20, 2013 11:49 am, edited 1 time in total.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: My Pi stops working after some days and I have no clue w

Tue Jul 16, 2013 8:37 am

Maybe it isn't a problem with the RPi at all?

Might it be that the dhcp-assigned IP address handed out by your router (assuming that is how you are connecting) is being expired by the router, and thus cutting communication with the RPi?

You would need to look at the administration webpage for your home router to see if this might be happening - I can't give you any further detail because the implementation is different on every model of router.

Regarding your idea of a controlled-reboot button - Yes, it's possible and detailed hardware/software designs have been published in these forums.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

dspolleke
Posts: 114
Joined: Thu Feb 07, 2013 7:09 pm
Location: Netherlands

Re: My Pi stops working after some days and I have no clue w

Tue Jul 16, 2013 9:43 am

I think /var/log/messages is the best place to start.
About that IP problem.... It might be a good idea to assign a static IP to your pi.
Please read: http://www.biblegateway.com/passage/?search=Matthew+7%3A7&version=NIV

Use loads of sunscreen, use the search, be elaborate in questions, paste commands and error messages, and remember google is your friend!

zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

Re: My Pi stops working after some days and I have no clue w

Tue Jul 16, 2013 11:16 am

Hi,

Thanks for your replies,

The Pi does have a static IP address, and the first time it happened it had been running just a little more than a day, the second time it had been running for a little more than 5 days. Tonight I'll dive into the /var/log/messages to see if I can find something around the time the Pi has stopped working.

Kind regards,

Ben

zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

Re: My Pi stops working after some days and I have no clue w

Tue Jul 16, 2013 6:14 pm

Hi,
After viewing the "messages" in var/log I found the repeating message at the time of losing my connection:

NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out

A search on the forum brought a possible solution at https://github.com/raspberrypi/linux/issues/151 so I did run the rpi-update which succesfully updated the firmware. I am going to keep my fingers crossed and see if this indeed solves my problem.

I will add "solved" to the subject if the Pi keeps connected for a whole week.

Kind regards,

Ben

Item is solved after the rpi-update, subject changed

zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

Re: [Solved] Ehternet fails after some days

Sat Aug 17, 2013 11:56 am

And now, again, after an uptime of one month the Ethernet fails again with the same message:

NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out

Powerdown, powerup again does get it back online again but my smartmeter readings got a large hole in it now....

Any thougts anyone ?

Kind regards,

Ben

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: [Solved] Ehternet fails after some days

Sat Aug 17, 2013 2:57 pm

I put a cronjob reboot in every 24 hours in the wee small hours. Otherwise my little monitoring server dies every couple of days under similar circumstances. Somewhat ironically it used to run for weeks without issue with an un-updated raspdian, since I update/upgraded it, the problem has appeared. The reboot keeps it going so I'm not worrying excessively about it.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

Re: [Solved] Ehternet fails after some days

Sun Aug 18, 2013 3:44 pm

I followed your steps, at least a sort of, and I run a script every 15 minute now, which checks if my router is still pingable and if not, restart network and if that does not resolve it, restart the Pi.

The script was in another subject on this forum about the same problem.

Kind regards,

Ben

W. H. Heydt
Posts: 12431
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: [Solved] Ehternet fails after some days

Sun Aug 18, 2013 10:11 pm

zanco wrote:I followed your steps, at least a sort of, and I run a script every 15 minute now, which checks if my router is still pingable and if not, restart network and if that does not resolve it, restart the Pi.

The script was in another subject on this forum about the same problem.

Kind regards,

Ben
Is that a reference to the thread I started? If so...I'm still testing the minimal script. It's hard to catch it down to see that the restart was done correctly. If I still have the proper IP address in a couple of weeks, I will consider it a "maybe".

The problem I run into is that I can do tests that show it works properly when run manually, but I was getting failures when run under cron. I have changes all if* commands to have full path names. (/sbin/if*)

zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

Re: [Solved] Ehternet fails after some days

Mon Aug 19, 2013 5:17 am

Not quite sure from which thread I "stole" the script. I have several PC's around which I all use for Internet search (even the mediaplayer on the TV) so I have some problems finding the page back in browsers history.

I have webmin running on the Pi and I check the uptime once in a while to see if it did restart.

Regards,

Ben

Return to “Troubleshooting”