LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Raspberry Pi 2 Randomly Crashes/Reboots (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/raspberry-pi-2-randomly-crashes-reboots-4175573021/)

Ihatewindows522 02-23-2016 10:01 AM

Raspberry Pi 2 Randomly Crashes/Reboots
 
Alright, so I have this little Pi clicking along happily (or so I thought) on a shelf in a closet. Two cables come out of it: power and ethernet. It's running a small plethora of services ranging from Google Cloud Print server to NAS.
I needed to upload some fairly large files, and on my piddly DSL it will take several days to a week nonstop at least. I've got better things to do than roast the battery in my laptop leaving it running all that time, or for that matter leaving my 650W desktop running. A 5V Pi fit the bill.
So it's running Ubuntu MATE (needed to run Chrome headless for the print server), SSH and VNC.
But for some reason, it crashes frequently. Just reboots with no explanation. Of course it never reboots when I'm using it. But I can't let this thing go overnight without the dern thing crashing! Pretty sure it's not RAM, using around 350MB/1GB on average.
The logs weren't helpful at all.
Code:

printsvr@ubuntu-printsvr:~$ last
printsvr pts/0        10.0.0.7        Tue Feb 23 10:31  still logged in
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running
printsvr pts/0        :1.0            Mon Feb 22 15:34 - crash (-16853+-20:-33)
printsvr pts/1        10.0.0.3        Mon Feb 22 15:33 - 15:33  (00:00)
printsvr pts/0        :1.0            Mon Feb 22 15:32 - 15:33  (00:01)
printsvr pts/1        :1.0            Mon Feb 22 15:31 - 15:31  (00:00)
printsvr pts/0        :1.0            Mon Feb 22 15:30 - 15:31  (00:00)
printsvr pts/1        :1              Mon Feb 22 15:26 - 15:29  (00:03)
printsvr pts/0        10.0.0.3        Mon Feb 22 15:26 - 15:28  (00:02)
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running
printsvr pts/1        10.0.0.4        Sat Feb 20 14:44 - 14:45  (00:00)
printsvr pts/0        :1              Sat Feb 20 14:40 - crash (-16851+-19:-40)
printsvr pts/0        10.0.0.4        Sat Feb 20 14:39 - 14:40  (00:00)
printsvr pts/0        10.0.0.4        Sat Feb 20 14:39 - 14:39  (00:00)
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running
printsvr pts/1        10.0.0.4        Fri Feb 19 16:15 - 16:21  (00:05)
printsvr pts/2        :1              Fri Feb 19 16:04 - 16:04  (00:00)
printsvr pts/1        10.0.0.4        Fri Feb 19 16:03 - 16:04  (00:00)
printsvr pts/0        :0              Fri Feb 19 15:19 - crash (-16850+-20:-19)
printsvr :0          :0              Fri Feb 19 15:19 - crash (-16850+-20:-19)
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running
printsvr pts/0        10.0.0.7        Fri Feb 19 14:40 - 14:41  (00:00)
printsvr pts/1        :1              Fri Feb 19 09:33 - crash (-16850+-14:-33)
printsvr pts/0        10.0.0.7        Fri Feb 19 09:33 - 10:00  (00:27)
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running
printsvr pts/0        10.0.0.10        Thu Feb 18 21:02 - 21:05  (00:02)
printsvr pts/0        10.0.0.10        Thu Feb 18 12:42 - 13:34  (00:52)
printsvr pts/1        :1              Wed Feb 17 16:51 - 10:06  (17:15)
printsvr pts/1        :1              Wed Feb 17 16:49 - 16:49  (00:00)
printsvr pts/0        10.0.0.10        Wed Feb 17 16:35 - 17:08  (00:33)
printsvr pts/0        10.0.0.10        Wed Feb 17 15:15 - 15:27  (00:12)
printsvr pts/0        10.0.0.10        Wed Feb 17 14:43 - 15:12  (00:29)
printsvr pts/0        10.0.0.10        Wed Feb 17 14:39 - 14:42  (00:03)
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running
reboot  system boot  4.1.15-v7+      Wed Dec 31 19:00  still running

wtmp begins Wed Dec 31 19:00:23 1969

I've been using Firefox to upload things as it's a bit easier on the RAM, so I started logging it.

Code:

Xlib:  extension "RANDR" missing on display ":1.0".
1456173891353        addons.update-checker        WARN        Update manifest for ubufox@ubuntu.com did not contain an updates property
1456173891958        addons.update-checker        WARN        Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property
1456173894976        addons.xpi        ERROR        Failed to clean updated system add-ons directories.: Unix error 2 during operation DirectoryIterator.prototype.next on file /home/printsvr/.mozilla/firefox/f4w2p0nq.default/features (No such file or directory) ((unknown module)) No traceback available

This is driving me absolutely batty. Any help is welcome.

suicidaleggroll 02-23-2016 10:22 AM

Did you overclock it?
Is it running hot?

You do know that leaving a laptop plugged in and running does not harm the battery at all, right? Or that just because your desktop has a 650 W power supply that doesn't mean it actually uses anywhere near that just sitting idling. My desktops typically use around 20 W when idling, still more than an RPi, but not bad.

Ihatewindows522 02-23-2016 11:12 AM

It's not overclocked, and the case is slightly warmer than the ambient air.

Leaving a laptop plugged in for days/weeks at a time will harm the battery. I'd rather not, I've roasted several doing that. Also my desktop draws about 200W minimum because of older dual Xeons.
Even if I did leave it running to do do the uploads, I'd still be down a print server because you need to be logged in and have Chrome (or in my case Chromium) running to keep the print server active.

suicidaleggroll 02-23-2016 11:46 AM

You have it in a case? Have you checked the temperature of the processor itself? It has an on-board temp sensor, you should see what it's sitting at. I don't know about Ubuntu, but on Raspbian you can check the temp with:
Code:

/opt/vc/bin/vcgencmd measure_temp
Heat, over-charging, over-discharging, and time (the aging process starts as soon as the battery is manufactured) kills Li-ion batteries. As long as your laptop isn't burning up while it's sitting idling (I'll admit that some do, but I tend to avoid those), you don't have to worry about heat, and once the battery is at 100% the charge circuitry cuts it off so from then on it's just floating, just like if you shut off the computer and unplugged it. There is little difference between leaving your laptop on and plugged in, versus charging it up to 100% and then shutting it off and unplugging it. Charging it only up to 80% and then shutting it off and unplugging it would help, but that means you can't use your computer, and isn't a realistic suggestion except for long-term storage.

I do not agree with that article's suggestion to constantly plug/unplug your power cable as you're using the machine to keep the charge level between 40-80%. Keeping the charge under 80% is good, especially for long term storage, but the heat created by the constant charging/discharging whenever the laptop is in use (charging generates a LOT of heat) would do far more damage to the battery than bringing it up to 100% one time and then letting it float. Not to mention the VAST increase in the number of "charge cycles" created by doing that. Somebody could easily go through 2 charge cycles a day doing that, after a year they've already hit 700+ charge cycles and dropped the battery capacity significantly, when if they would have just left it plugged in and only unplugged it when necessary, they might have gone through 10-20 charge cycles (negligible capacity loss), plus an additional ~20% loss due to floating at 100% for a year. The battery would be in MUCH better condition after that year versus following that article's ridiculous advice, at least for laptops that get used on a regular basis.

pan64 02-23-2016 12:18 PM

that may be caused by a weak power supply too.

273 02-23-2016 12:33 PM

Quote:

Originally Posted by pan64 (Post 5504913)
that may be caused by a weak power supply too.

This would be what I would look to first. Is the power supply capable of 2W? Might and ought not to need it but it may be worth upgrading the PSU. Also, a cheap PSU may not be capable of the rating on the plug.

I don't think that leaving a laptop plugged in is pa particularly good idea as, whilst theoretically just runs from the mains, the battery will lose voltage and will charge.

jamison20000e 02-23-2016 12:54 PM

+1 power and\or cable-rating

Batteries also have a shelf life... e.g: http://superuser.com/questions/81654...-bad-if-unused

jamison20000e 02-23-2016 12:56 PM

Add: I had to mod my case from Adafruit so the power cord would go in all the way, otherwise one wrong move and reboot.

273 02-23-2016 01:07 PM

Quote:

Originally Posted by jamison20000e (Post 5504935)
Add: I had to mod my case from Adafruit so the power cord would go in all the way, otherwise one wrong move and reboot.

I'd forgotten about that -- good call as I think I changed mains leads or shaved a bit off one with a file.

Ihatewindows522 02-23-2016 01:16 PM

Quote:

Originally Posted by pan64 (Post 5504913)
that may be caused by a weak power supply too.

Both the power supply and cable were bought at the same time as the Pi from Monoprice. The power supply is 5 volts 2.1 amps. I can test if it's bad by using the adapter to my tablet instead. Same output.

Quote:

Originally Posted by suicidaleggroll (Post 5504892)
You have it in a case? Have you checked the temperature of the processor itself? It has an on-board temp sensor, you should see what it's sitting at. I don't know about Ubuntu, but on Raspbian you can check the temp with:
Code:

/opt/vc/bin/vcgencmd measure_temp

Yes, it's in a case. I'll set up a script that logs that while uploading and see what happens.

pan64 02-23-2016 01:43 PM

Quote:

Originally Posted by Ihatewindows522 (Post 5504953)
The power supply is 5 volts 2.1 amps. I can test if it's bad by using the adapter to my tablet instead. Same output.

No, you cannot. 2A may noe be enough for all your devices connected to pi.

jamison20000e 02-23-2016 01:46 PM

I put a heat sink with silver epoxy on mine or a fan could work if that's the problem.

Ihatewindows522 02-23-2016 02:43 PM

Quote:

Originally Posted by pan64 (Post 5504966)
No, you cannot. 2A may noe be enough for all your devices connected to pi.

Like I said in post number 1, the only thing plugged into the Pi is the power cable and an ethernet cable. That's it. No USB, no HDMI, nothing.

Anyway, got the script ready and going to let that run for a bit. Current temp is 38.5 C.

EDIT: Bouncing between 37.9 and 38.5. Well below the 80 degree threshold.

273 02-23-2016 02:51 PM

Do you have another power supply?
This is troubleshooting and that is pretty close to number one for the Pi, as I understand it.
After that, how's the SD card, do you have another you could clone the system to?
Could be you have a faulty Pi, that's certainly not a temperature to be concerned about, but how about some trial and error?
Oh, you don't happen to be using some $2 keyboard+mouse from Walmart, do you? OK, I'm kidding a little but be sure that everything needs to be tested.

pan64 02-24-2016 12:55 AM

http://elinux.org/RPi_Hardware#Power_Supply_Problems


All times are GMT -5. The time now is 02:29 PM.