MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Strange issue

    Troubleshooting
    6
    24
    3538
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • richland007
      richland007 last edited by richland007

      Hi all i have my magic mirror running “flawlessly” with all my modules arranged nicely ready for final hardware install.
      I have been leaving it running on my Rpi and monitor for a while before the whole final, on the wall install but something strange is happening … I have pm 2 running and MMM-watchdog and all seems to be going perfect until MM gets abruptly restarted and it happens quite often.

      Where can i look for errors on what’s been causing this??.. also can i change any setting somewhere whether on pm2 or watchdog so it can be more “tolerating” and “forgiving”??

      Any help will be greatly appreciated
      Thank you
      Denis

      O 1 Reply Last reply Reply Quote 0
      • O
        OceanK @richland007 last edited by

        @richland007

        Hey mate!

        Same issue here. I might suspect that the pi gets overloaded somehow. If I run less modules it’s not restarting.

        I’m going to try a Intel NUC see what’s happening

        cowboysdude 1 Reply Last reply Reply Quote 1
        • richland007
          richland007 last edited by

          Please some help!!! anybody!!
          Where and how do i check for errors and whats casuing them and what module is the hardest and most tasking.
          The strange thing is that my cpu usage is never more than 30% with 10 -20 % of free ram at all times!!

          D

          1 Reply Last reply Reply Quote 0
          • lolobyte
            lolobyte last edited by

            Incrase the swapfile?

            1 Reply Last reply Reply Quote 0
            • evroom
              evroom last edited by yawns

              Hi,

              Investigating crashes and freezes, etc, can be very difficult.
              When everything is running fine and you collect data, you will see that everything is more or less okay.
              When it crashed or is frozen, you are too late.

              Since a few weeks I had the problem that my MM was frozen and I could not enter any commands or a command took painstakingly long to return output.
              A command like top was out of the question for example.
              Using a script running as a cron job, I was able to identify a memory issue with electron.js.
              I then decide to use a usb stick on which I created a swap device.
              Since then my MM is not freezing anymore.
              And I am able to see electron.js using up my memory and sometimes I see spikes in CPU usage.

              Mind you, that crashing is something different then freezing, but the tools to use are more or less the same, provided the MM application or a MM module is not the culprit.

              My script to check memory usage, very basic and simple:

              pi@MagicPi:~ $ cat top.sh
              #!/bin/sh
              
              date >> /home/pi/top.txt
              top -b -o +%MEM | head -n 22 >> /home/pi/top.txt
              echo "=============================================" >> /home/pi/top.txt
              

              The cron job:

              00,05,10,15,20,25,30,35,40,45,50,55 * * * * /home/pi/top.sh >/dev/null 2>&1
              

              %CPU will sort on CPU usage.

              Concerning swap space, top will show the usage, but this gives a quick view:

              $ free -h
              

              Swap details via:

              $ swapon -s
              

              There are many more commands and settings to look at, but one has to start somewhere 🙂

              Good luck.

              MagicMirror version: 2.21.0
              Raspberry Pi 3 Model B Plus Rev 1.3
              Raspbian GNU/Linux 10 (buster)

              1 Reply Last reply Reply Quote 1
              • richland007
                richland007 last edited by

                @evroom Thank you for your reply and i want to try all that you have written as i really feel it may help my case … but i am having a hard time decoding your steps.

                Please walk me through it, on a step by step all the way to the end on how to even increase the swap file, and what to put on my scrip and make it executable and what is a cron job?? that will be my first one actually 🙂

                Denis

                1 Reply Last reply Reply Quote 0
                • evroom
                  evroom last edited by

                  @richland007
                  Since you managed to setup MM to the point that it is running, but crashing, I take it you know a little bit of Linux.
                  Otherwise it will be more like a Linux workshop.

                  Do you know how to use nano and/or vi to edit files?
                  Know what for example cat, tail and head does?
                  Just some Linux basics.

                  I do not want to sound like a smartarse and knowitall, am a hobbyist just like you.
                  Just to know the level of describing that is needed.

                  MagicMirror version: 2.21.0
                  Raspberry Pi 3 Model B Plus Rev 1.3
                  Raspbian GNU/Linux 10 (buster)

                  1 Reply Last reply Reply Quote 0
                  • richland007
                    richland007 last edited by

                    @evroom Hahah dont’ worry about coming out the wrong way … i know a little bit and i do know what nano and vi does …i use nano.
                    I am not familiar with cats and tails etc but i am a fast learner and i have set up quite a bit of MM modules some stubborn ones as well but i am no expert by all means.

                    I couldn’t read your first response at the beginning for some reason it wasn’t structured properly or my browser wasn’t reading it right now its a bit better but i still need some guidance

                    So i need to set up a script called “top” and make it executable right??
                    Than i have no idea what to do with cron 🙂 !!!

                    Lets start somewhere 🙂

                    Denis

                    1 Reply Last reply Reply Quote 0
                    • evroom
                      evroom last edited by

                      @richland007

                      Then let’s give it a try 🙂

                      First create the script:

                      pi@MagicPi:~ $ cd
                      pi@MagicPi:~ $ nano top.sh
                      

                      Copy-paste this:

                      !/bin/sh
                      
                      date >> /home/pi/top.txt
                      top -b -o +%MEM | head -n 22 >> /home/pi/top.txt
                      top -b -o +%MEM | head -n 22 >> /home/pi/top.txt
                      echo "=============================================" >> /home/pi/top.txt
                      

                      Make it executable:

                      pi@MagicPi:~ $ chmod 755 top.sh
                      

                      Perhaps a good idea to prepare the output file in order to be sure the cron user can write in it:

                      pi@MagicPi:~ $ touch /home/pi/top.txt
                      pi@MagicPi:~ $ chmod 666 /home/pi/top.txt
                      

                      Now we add a cronjob:

                      pi@MagicPi:~ $ crontab -e
                      

                      Add this line at the end:

                      00,05,10,15,20,25,30,35,40,45,50,55 * * * * /home/pi/top.sh >/dev/null 2>&1
                      

                      To verify:

                      pi@MagicPi:~ $ crontab -l
                      

                      To verify if the cronjob is actually running:

                      pi@MagicPi:~ $ tail -F /var/log/syslog
                      

                      To check if something comes in your output file:

                      pi@MagicPi:~ $ tail -F top.txt
                      

                      The script will run every 5 minutes, every hour, every day.
                      It will output the top 15 MEMory usage and the top 15 CPU usage.

                      In your case, it will be interesting to look at the last entries before the crash.
                      Need to identify first if it is an CPU or MEM issue, or both.
                      Then we can modify the script.

                      Please do not post lengthy output.
                      Better we minimise the output by grepping and sorting, etc.

                      Success!

                      MagicMirror version: 2.21.0
                      Raspberry Pi 3 Model B Plus Rev 1.3
                      Raspbian GNU/Linux 10 (buster)

                      1 Reply Last reply Reply Quote 0
                      • richland007
                        richland007 last edited by

                        @evroom Ahhh you are a great man
                        I will set it up as soon as i get home
                        thanks in advance
                        Denis

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 3
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy