MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. evroom
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 2
    • Topics 18
    • Posts 494
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Strange issue

      To disable MMM-WatchDog, edit the config.js file.
      Locate:

      module: 'MMM-WatchDog',
      

      Edit this like this:

      module: 'MMM-WatchDog',
      disabled: true,
      

      and restart MM:

      $ pm2 restart mm
      

      Use

      pm2 list
      

      to check if your application name actually is mm, or something else.

      Later you can enable it again by updating config.js like this:

      disabled: false,
      

      This works for all modules.
      When I test modules I normally leave the config lines and disable a module in this fashion.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: Strange issue

      Okay, this calls for some more basics.

      Print the whole file:
      $ cat top.txt

      Load the file in an editor:
      $ nano top.txt
      $ vi top.txt

      I am old-school, so I use vi, but nano is more Word-like.

      To show the last 50 lines:
      $ tail -50 top.txt

      To show the first 50 lines:
      $ head -50 top.txt

      Where of course 50 is just an example.

      To show text that is appending:
      $ tail -f top.txt

      To show text that is appending and re-open the file when necessary (useful for rotating log files):
      $ tail -F top.txt

      On disabling a module see the next reply.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: Can't find out what I did wrong in my config.js...

      Glad to help.
      So many errors after only one mistake (the most common to make; we all did it sometime I guess) :slightly_smiling_face:

      posted in Troubleshooting
      evroomE
      evroom
    • RE: Can't find out what I did wrong in my config.js...

      Perhaps this is a start, provided I copy/pasted it right ?
      Although I think you are familiar with this and used other linters to find the ‘mistake’.

      pi@MagicPi:~/MagicMirror $ cd ~/MagicMirror; npm run config:check
      
      Checking file...  /home/pi/MagicMirror/config/config.js
      Line 213 col 42 Missing semicolon.
      Line 218 col 18 Missing semicolon.
      Line 222 col 5 Expected '}' to match '{' from line 190 and instead saw '{'.
      Line 223 col 7 Expected ']' to match '[' from line 28 and instead saw 'module'.
      Line 223 col 13 Expected '}' to match '{' from line 11 and instead saw ':'.
      Line 223 col 14 Missing semicolon.
      Line 224 col 7 Expected an assignment or function call and instead saw an expression.
      Line 224 col 15 Missing semicolon.
      Line 224 col 7 Unrecoverable syntax error. (94% scanned).
      

      I think you missed a } around line 220.

      The “Missing semicolon” messages normally are just nitpicking, but the "Expected ‘}’ to match ‘{’ " are usually true.

      posted in Troubleshooting
      evroomE
      evroom
    • calendar module: Today at HH:MM

      Hi,

      Searching did not lead to a solution.
      My current config shows date and time for all items (for example Nov 19th 12:00).
      I would like to see “Today at 12:00” for todays items.
      Is that posible ?

      module: "calendar",
      disabled: false,
      header: "Family Calendar",
      position: "top_left",
      maximumEntries: 12,
      maximumNumberOfDays: 365,
      fetchInterval: 300000,
      maxTitleLength: 35,
      getRelative: 0,
      timeFormat: "absolute",
      dateFormat: "MMM Do kk:mm",
      fullDayEventDateFormat: "MMM Do",
      showEnd: false,
      displaySymbol: false,
      
      posted in Troubleshooting
      evroomE
      evroom
    • RE: Strange issue

      @richland007
      I re-read your first post and your problem is more restarting then actual crashing.
      Of course a restart can be caused by a crash …
      MMM-WatchDog tends to restart MM, so I too would suggest to remove this module.
      In principle all it does is sending a ping and restarting MM using pm2 when a timeout occurs.
      I also would expect to see some lines in the pm2 logs on WatchDog.
      Can you do ?:

      pi@MagicPi:~ $ grep -i watchdog /home/pi/.pm2/logs/mm-out.log
      pi@MagicPi:~ $ grep -i watchdog /home/pi/.pm2/logs/mm-error.log
      

      What is alo a good package to install is sysstat:

      pi@MagicPi:~ $ sudo apt-get install sysstat
      

      This allows for commands like iostat and sar.

      vmstat 10 10
      iostat 10 10
      sar 10 10
      
      posted in Troubleshooting
      evroomE
      evroom
    • RE: Strange issue

      Ha ha, not that great, my MM is as slow as a turtle again.
      The used swap on my USB stick in the meanwhile is 1GB.
      Cannot use any commands to investigate further.
      Not very satisfactory. :frowning_face:

      posted in Troubleshooting
      evroomE
      evroom
    • RE: Strange issue

      @richland007

      Then let’s give it a try :slightly_smiling_face:

      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!

      posted in Troubleshooting
      evroomE
      evroom
    • RE: Strange issue

      @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.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: Strange issue

      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.

      posted in Troubleshooting
      evroomE
      evroom
    • 1 / 1