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

    Posts

    Recent Best Controversial
    • RE: MMM-Remote-Control add menu "Show video files" in the remote.html

      Would be nice if you will write a tutorial for us :)
      Looks pretty interesting for some of us.

      posted in Requests
      cruunnerrC
      cruunnerr
    • RE: Want to turn off my monitor

      did u try:

      sudo tvservice -o to turn off your Monitor
      sudo tvservice -p to turn on your monitor
      ?

      If this isn’t working i think your Monitor or your HDMI Cable are not supporting CEC.

      If this works u have several options.
      For example u can create two *.sh files and make them executable. Put these scripts into cronjob file for time based turning on or off the monitor.
      Or u can use a PIR or a simple Button to do that. Let me give you a small software tutorial for this example:

      Tutorial beginning:

      cd
      nano monitor_on.sh (creates the file)

      write this in this file:

      sudo tvservice -p
      

      save with “ctrl+x” and say “y” to save the file.

      nano monitor_off.sh

      write this in this file:

      sudo tvservice -o
      

      save with “ctrl+x” and say “y” to save the file.

      chmod +x monitor_on.sh (to make it executable)
      chmod +x monitor_off.sh

      So now you have two options. Write a python script to automatically start the shell scripts by using a GPIO or just put the Shell scripts into a cronjob.

      Here is the first way:

      nano pir.py (creates a script which executes the *.sh files via PIR or Button)

      write this into the file:

      #!/usr/bin/env python
      
      import sys
      import time
      import RPi.GPIO as io
      import subprocess
      
      io.setmode(io.BCM)
      SHUTOFF_DELAY = 119 # in seconds, how long the monitor will be on until next button press or PIR detection
      PIR_PIN = 25       # 22 on the board (this needn't to be a PIR. Can be a button also)
      LED_PIN = 16      # optional
      
      def main():
          io.setup(PIR_PIN, io.IN)
          io.setup(LED_PIN, io.OUT)
          turned_off = False
          last_motion_time = time.time()
      
          while True:
              if io.input(PIR_PIN):
                  last_motion_time = time.time()
                  io.output(LED_PIN, io.LOW)
                  print ".",
                  sys.stdout.flush()
                  if turned_off:
                      turned_off = False
                      turn_on()
              else:
                  if not turned_off and time.time() > (last_motion_time + 
                                                       SHUTOFF_DELAY):
                      turned_off = True
                      turn_off()
                  if not turned_off and time.time() > (last_motion_time + 1):
                      io.output(LED_PIN, io.HIGH)
              time.sleep(.1)
      
      def turn_on():
      	subprocess.call("sh /home/pi/monitor_on.sh", shell=True)
      
      def turn_off():
      	subprocess.call("sh /home/pi/monitor_off.sh", shell=True)
      
      if __name__ == '__main__':
          try:
              main()
          except KeyboardInterrupt:
              io.cleanup()
      
      

      save with “ctrl+x” and say “y” to save the file.

      chmod +x pir.py

      You can check if your button works by simply typing python pir.py. Every time u move through the PIR or press the button it will show you some …
      End the test with “ctrl+c”

      now we editing the rc.local to start the script after booting the Pi:

      sudo nano /etc/rc.local

      write this in the file (above the “exit 0”):

      python /home/pi/pir.py &

      save with “ctrl+x” and say “y” to save the file.

      after all it should look like this:

      #!/bin/sh -e
      #
      # rc.local
      #
      # This script is executed at the end of each multiuser runlevel.
      # Make sure that the script will "exit 0" on success or any other
      # value on error.
      #
      # In order to enable or disable this script just change the execution
      # bits.
      #
      # By default this script does nothing.
      
      # Print the IP address
      _IP=$(hostname -I) || true
      if [ "$_IP" ]; then
        printf "My IP address is %s\n" "$_IP"
      fi
      
      python /home/pi/pir.py
      
      exit 0
      

      Here comes the second way:

      Next steps we will do as root to be sure it works. Maybe not the best way, but i am just a simple guy, who is still learning the stuff. ^^
      Lets say we want to turn on the monitor every day at 6am and turn off at 8pm:

      sudo nano /etc/crontab (to open the crontab)

      write this into the file:
      0 6 * * * /home/pi/monitor_on.sh
      0 20 * * * /home/pi/monitor_off.sh

      this should look like this:

      # /etc/crontab: system-wide crontab
      # Unlike any other crontab you don't have to run the `crontab'
      # command to install the new version when you edit this file
      # and files in /etc/cron.d. These files also have username fields,
      # that none of the other crontabs do.
      
      SHELL=/bin/sh
      PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
      
      # m h dom mon dow user  command
      17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
      25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
      47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
      52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
      0 6     * * *   root      /home/pi/monitor_on.sh
      0 20    * * *   root      /home/pi/monitor_off.sh
      #
      

      I wrote this just out of my head so i hope i didn’t forget anything.

      Tutorial ending!

      That is just an example of using a GPIO to turn off and on your monitor via HDMI-CEC.
      How i said, if your monitor or cable doesn’t support this u need to choose another way (turn a relays on and off to the power supply of the monitor e.g.)

      edit:

      sorry @mykle1, did not notice that you already answered, because I already started to write while you answered :D

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Changing the length of the line under the header

      @goprojojo

      its not a module. Its just a background. Take a look here, i described it a little further down

      posted in Custom CSS
      cruunnerrC
      cruunnerr
    • RE: MagicMirror ready to boot Image

      Great idea :)

      I installed your image just for fun and it works like u described.

      As goonerbeatyaa said before the first time i start the MM it shows me, that it isn’t up to date (86 commits behind actual version). On your website u said it is automatically fetching the actual version every sunday. That seems not working ???

      Anyhow, i went to the MagicMirror folder and did the update automatically (git pull && npm install). That works without issues and i got an up to date MagicMirror with small effort.
      Great idea so i just wanted to pay homage to you :D

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: MMM-CalendarExt

      Hi,

      I realized, that every time the Calendars will be fetched, pm2 creates a log entry in it’s log file.
      Well, sometime the log file will be very big, so my question is if it is necessary or advisable to delete the log file and if there is a way to do that automatically.

      :)

      posted in Productivity
      cruunnerrC
      cruunnerr
    • RE: [IDEA] Integrating Raspotify to MagicMirror

      like this: https://github.com/CatoAntonsen/MMM-SpotifyConnectUI

      or this: https://github.com/PtrBld/MMM-Scrobbler

      ?

      posted in General Discussion
      cruunnerrC
      cruunnerr
    • RE: Something is wrong ....

      Lets hope there will be no “next time” ;)

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Something is wrong ....

      alright. so u used the automatic installer AND did the “how to autostart”-Tutorial from MichMich, too ^^

      no problem, we will try to fix. As u can read here, ninjabreadman wrote how to remove one of the instances.

      so please try:

      cd
      pm2 stop mm && pm2 delete mm && pm2 save
      rm mm.sh

      now there should just be the “MagicMirror” process even when u reboot.

      Better now, to erase all logs and wait, if your problems come up again. So type:

      pm2 flush

      Next time u got any problems, please type:
      pm2 logs MagicMirror
      and post it here

      Hope that will help ;)

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Something is wrong ....

      @Peter

      Lets write here, so the other thread would not be filled up with this problem ;)

      so u don’t know how it starts. That sound like u used the automatic installer and clicked “YES” when it asked u to start automatically.

      Please type in console:

      pm2 status
      U will see a process name (probably “MagicMirror”)

      now u can use
      pm2 start MagicMirror to start MM
      pm2 stop MagicMirror to stop MM
      pm2 restart MagicMirror to restart MM

      or even
      pm2 logs MagicMirror to see logs and errors. Please try if i am right and then post the error log here

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: MMM-NOAA - Another Weather Module

      if u use pm2, u should check pm2 logs and check the errors. Other way is to start MM with develop mode: npm start dev or with ssh: DISPLAY=:0 npm start dev

      Or start it with Firefox on your pc and use Firebug

      posted in System
      cruunnerrC
      cruunnerr
    • 1 / 1