Barabba
Posts: 47
Joined: Wed Aug 03, 2016 3:49 pm

Understand unstability of Rasberry3

Tue Apr 02, 2019 10:03 am

Hi mates, I would try to get from your experience a sensation, lookign for a concrete/real answer is hard with few elements, but you know better than me how kernel works and where I should look deeper to solve it.

I have RB3, with Raspbian updated, powered by DC/DC 3A from 12v to 5,32v (+ a 10.000uF capacitor), there are some pheripheral connected to GPIO (6lines I/0, 2 16libes PWM drivers (connected to 5V relay, powered separetely), one RPC, one ADS1115 ADC, one LCD 20x4. Maybe all is around 50-100mA), nothing on USB, and I'm running Node Red latest version with very low CPU power load.

The first time I experienced a "frozen" it was about power undervoltage, it was set at 5,02v, maybe the USB cable wasn't that good (but not bad too, it was from a power adapter of 2,1A, and I used only 25cm lenght), now I rised up to 5.32 volt and no more problems (with 5,25v I had again one log line into syslog file) but I exprienced aother "frozen".
I've to add, it it matters somehow, that the router that recently I replaced isn't so good, and raspberry had quite often a eth0 carrier lost for about one second, then it goes up, the camble is 3 meters only and well done, now I connected to a switch to avoid these ups/downs.

On the syslog file when frozen become from low voltage reasons (I expect, I'm not sure about it, it happened typically every 8-12 days) the Node red was "frozen", the SSH not more usable, but the ICMP packets from ping were managed.. RB replied to ping, I haven't other chances than reboot by pulling off the microusb power, and after I noticed on the syslog file a line full of "null" chars.
Today I experience another frozen, on the all old syslog files there is no "udervoltage", the ping was reply, Node red frozen, no SSH.
It seems there are some process which are killed by kernel (for example TCP protocol, I suppose, or maybe all the services that opened a TCP listening port, like Telnet that I enabled), and some others keep working, like IP, ICMP..
How it is possible ICMP works but not the TCP open ports? is the ICMP service running at higher privilege?

what can be wrong here? Is it possible that "eth0 carrier lost" may frozen raspberry?
I'm looking for a watchdog to reboot RB if for example it can't connect to port 127.0.0.1:1880, so I can check if node red is working and rplying. How to do that? Thank you a lot!

ejolson
Posts: 5373
Joined: Tue Mar 18, 2014 11:47 am

Re: Understand unstability of Rasberry3

Tue Apr 02, 2019 3:45 pm

Barabba wrote:
Tue Apr 02, 2019 10:03 am
Hi mates, I would try to get from your experience a sensation, lookign for a concrete/real answer is hard with few elements, but you know better than me how kernel works and where I should look deeper to solve it.

I have RB3, with Raspbian updated, powered by DC/DC 3A from 12v to 5,32v (+ a 10.000uF capacitor), there are some pheripheral connected to GPIO (6lines I/0, 2 16libes PWM drivers (connected to 5V relay, powered separetely), one RPC, one ADS1115 ADC, one LCD 20x4. Maybe all is around 50-100mA), nothing on USB, and I'm running Node Red latest version with very low CPU power load.

The first time I experienced a "frozen" it was about power undervoltage, it was set at 5,02v, maybe the USB cable wasn't that good (but not bad too, it was from a power adapter of 2,1A, and I used only 25cm lenght), now I rised up to 5.32 volt and no more problems (with 5,25v I had again one log line into syslog file) but I exprienced aother "frozen".
I've to add, it it matters somehow, that the router that recently I replaced isn't so good, and raspberry had quite often a eth0 carrier lost for about one second, then it goes up, the camble is 3 meters only and well done, now I connected to a switch to avoid these ups/downs.

On the syslog file when frozen become from low voltage reasons (I expect, I'm not sure about it, it happened typically every 8-12 days) the Node red was "frozen", the SSH not more usable, but the ICMP packets from ping were managed.. RB replied to ping, I haven't other chances than reboot by pulling off the microusb power, and after I noticed on the syslog file a line full of "null" chars.
Today I experience another frozen, on the all old syslog files there is no "udervoltage", the ping was reply, Node red frozen, no SSH.
It seems there are some process which are killed by kernel (for example TCP protocol, I suppose, or maybe all the services that opened a TCP listening port, like Telnet that I enabled), and some others keep working, like IP, ICMP..
How it is possible ICMP works but not the TCP open ports? is the ICMP service running at higher privilege?

what can be wrong here? Is it possible that "eth0 carrier lost" may frozen raspberry?
I'm looking for a watchdog to reboot RB if for example it can't connect to port 127.0.0.1:1880, so I can check if node red is working and rplying. How to do that? Thank you a lot!
Sounds like it could still be power. I would suggest down clocking the CPU to 900MHz as a test to see if stability results.

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

Re: Understand unstability of Rasberry3

Tue Apr 02, 2019 3:47 pm

On the initial problems, I'd look at your "power supply". It is really a PSU or is it a re-purposed charger? If it has a detachable cable, that is also suspect. The official RPF PSU uses 18 ga. wires. On desn't generally see anything better that 24 ga. when buying USB cables, and 26 ga.--or thinner--is common. Third point...5.32v, if it's actually getting to the Pi, is outside specifications. It should get no more than 5.25v.

So...if you're getting low voltage indications when you feed a Pi 5.25v, something is wrong in your power feed.

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Understand unstability of Rasberry3

Tue Apr 02, 2019 3:48 pm

measure the voltage at the Raspberry end
my bet is terribad power source / leads
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: Understand unstability of Rasberry3

Tue Apr 02, 2019 3:58 pm

I get very suspicious here " powered by DC/DC 3A from 12v to 5,32"

God knows what that is. Never mind the big capacitor.

I suggest using a proper power supply for the Pi. Remove all other devices you have connected to it. Runs some software stress tests and see how stable it is.

If it's OK start adding your peripheral devices, one by one, see if any of that destabilizes things.

If that's OK, try your power supply again.

In short, try to logically exclude possible problem causes. Step by step check them out.
Memory in C++ is a leaky abstraction .

Barabba
Posts: 47
Joined: Wed Aug 03, 2016 3:49 pm

Re: Understand unstability of Rasberry3

Thu Apr 04, 2019 6:45 pm

Thank you mates for the kind replies, well as I explained in the topic here:
viewtopic.php?f=63&t=234114&p=1451564#p1451564

I rebuilt yesterday the power supplier, I dedicate a DC/DC based on another chip (5 A) to RB3, added capacitor, sold a new cable 2x0,75 to the microUSB, and reduced to 5,20V to less stress internal components. Better I don't know what to do, let's see. Now on GPIO I have 5,07volt (after some devices, wires there aren't thick, so I expect inside RB3 after fuse and maybe mosfet to check polarity I could have 5,1-5,15 volt.

Also, to imporve stability I got know how to reduce the usage of SD, using RAM for log files:
$ sudo apt -y install git
$ git clone https://github.com/azlux/log2ram.git
$ cd log2ram
$ chmod +x install.sh
$ sudo ./install.sh

If it was SD, maybe I'll catch it now.
ABout my question, in your opinion how RB can keep working and reply to ping and in the same time have unresponsive services? Does it has sense? May it gives you some ideas where the problem is? Unfortunately I've no HDMI monitors to check it's status visually.
Thank you

Other question: how can I downclock Raspberry? With which commands? Thanks

PS: if you have other suggestions to improve stability pls let me kpnw, thanks.

jahboater
Posts: 5759
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Understand unstability of Rasberry3

Thu Apr 04, 2019 6:52 pm

Barabba wrote:
Thu Apr 04, 2019 6:45 pm
ABout my question, in your opinion how RB can keep working and reply to ping and in the same time have unresponsive services? Does it has sense?
I have found that Raspbian responds to pings even when it is swapping so badly that you cannot log into it.
ICMP echo request packets are bounced at an early stage in the IP stack.

You don't need any special software installed to send the logs to memory.
Here is my /etc/fstab to reduce SD card writes:-

Code: Select all

$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=7b4d7c24-01  /boot           vfat    defaults          0       2
PARTUUID=7b4d7c24-02  /               ext4    defaults,noatime,commit=600,errors=remount-ro  0       1
tmpfs /tmp tmpfs defaults,noatime,nosuid 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,size=16m 0 0
This mounts /tmp and /var/log as tmpfs
The commit=600 reduces the disk cache flush rate to every 10 minutes instead of every 5 seconds, which also improves performance.

Barabba
Posts: 47
Joined: Wed Aug 03, 2016 3:49 pm

Re: Understand unstability of Rasberry3

Thu Apr 04, 2019 9:26 pm

thank you for kind answers,
doesyour script write at sometime the log files to SD? I don't want to loose them after a reboot/shutdown/power loss.. not completely at least..
The solution I described make a dump every hour, useful, but I've noticed there still new entries on syslog file, before the hour, I've to clear it..

Barabba
Posts: 47
Joined: Wed Aug 03, 2016 3:49 pm

Re: Understand unstability of Rasberry3

Mon Apr 15, 2019 8:16 am

It happened again, after about one week.. as usual I guess, TCP stopped working, no more SSH, telnet, Node Red, etc. I don't know how this can come from. Node Red was keep working (I mean, it can read and write to I2C bus, and responsive), but log2RAM stop working as well (I guess it from syslog on the SD.. it didn't wrote there more) as TCP (ping to Raspberry was responsive). What can it be? What the sense to have some services down and some other keep working? In the log I don't have other evidences.
The only guess I can make I'm having roubles with SD, after 7-10 days of work, even if now I'm using log2RAM, but if this is possibile how SD mulfunction can affect the TCP and not Node Red for example?
Thank you

Return to “General discussion”