nabil.guellati
Posts: 4
Joined: Sun Oct 20, 2019 10:10 am

A problem appears in my raspberry pi 3B+ after 3 of 4 running days.

Sun Oct 20, 2019 11:14 am

Hello every one,
I writing this post to ask you a question about a problem I am having with the Raspberry Pi 3 B+.
I am using Raspbian Stretch (2018-06-27) and I am writing a code with Qt 4.8.7. In my application I use Linux commands as follows:
system("sudo shutdown now");
or
system("/opt/vc/bin/vcgencmd measure_temp > /home/pi/temp.txt");
My application works very fine without any problems. However, since I run the raspberry without stop, after 3 or 4 days of running, Linux commands stop working !!!
I don’t know if this is a problem in Raspbian OS or in the hardware ???
If anyone has an idea about this problem, please answer me.
Best regards.

pcmanbob
Posts: 9467
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: A problem appears in my raspberry pi 3B+ after 3 of 4 running days.

Sun Oct 20, 2019 1:11 pm

Hi.

The one important thing you have not told us is how you are entering the commands ,

1. via keyboard directly connected to pi with a screen also connected
2. via ssh
3. via vnc/terminal

if using option 2 or 3 how is your pi connected to the network wifi/LAN
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

nabil.guellati
Posts: 4
Joined: Sun Oct 20, 2019 10:10 am

Re: A problem appears in my raspberry pi 3B+ after 3 of 4 running days.

Sun Oct 20, 2019 6:47 pm

Hi pcmanbob, thanks for the answer.

The raspberry is connected to a screen and I plug a keyboard only when I modify the application, otherwise there is only a screen plugged to the raspberry running without stopping. I use Linux commands in my C++ code using the instruction "system". For example, I write :

Code: Select all

int value_returned = std::system("echo \"on 0\" | cec-client -s -d 1");
in order to power on the screen.

The above line works perfectly for 3 or 4 days, and after that all commands written in the application stop working !!!

For example, the line :

Code: Select all

system("/opt/vc/bin/vcgencmd measure_temp > /home/pi/temp.txt");

works fine returning the temperature in the beginning, and after 3 or 4 running days it returns an empty file "temp.txt".

Best regards.

pcmanbob
Posts: 9467
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: A problem appears in my raspberry pi 3B+ after 3 of 4 running days.

Mon Oct 21, 2019 12:00 pm

I cant help with the C++ programming , but you could try changing your system call that gets the temperature so that it collects all the results of command including any errors

Code: Select all

system("/opt/vc/bin/vcgencmd measure_temp >> /home/pi/temp.txt 2>&1");
assuming that would not cause any problems with you program.

You might also try running the free -m command every minute in cron and piping the results to a file to see if you are running out of memory.

and lastly when your program stops working can you still enter commands at the command line ?
if you can try running the free -m command then to see if you have any free memory.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

nabil.guellati
Posts: 4
Joined: Sun Oct 20, 2019 10:10 am

Re: A problem appears in my raspberry pi 3B+ after 3 of 4 running days.

Mon Oct 21, 2019 6:04 pm

Thanks a lot for the advice.

I will try these stuff and answer you.

Best regards.

Return to “Troubleshooting”