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

    Posts

    Recent Best Controversial
    • RE: My First Mirror... until now ^^

      @fischi87

      Just type a header in the config:

      {
          			module: "MMM-EasyPix",
      			header: "WLAN-Code",
      			position: "bottom_left",
      			config: {
      				picName: "guest_wifi_config.png", // Enter the picture file name.
      				maxWidth: "150px",      // Size picture precisely. Retains aspect ratio.
      			}
      		},
      
      posted in Show your Mirror
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @blebbens said in {HowTo} turn on/off your monitor (Time based, PIR/Button, App):

      Thanks for this tutorial…

      I am using a PIR. The monitor switches on immediately after detection of motion. I am looking for an option to switch on the monitor if a person stands in front of it for 10 seconds. Mine is a floor mirror, so some people are crossing the floor many times a day without looking at the mirror.

      If u use the external PIR script (point 2.2) u could try to change line 25 in the script and define a TURNON-DELAY.

      if turned_off and time.time() >= TURNON_DELAY:
      

      The whole script would look like this:

      #!/usr/bin/env python
      
      import sys
      import time
      import RPi.GPIO as io
      import subprocess
      
      io.setmode(io.BCM)
      SHUTOFF_DELAY = 120 # in seconds, how long the monitor will be on until next button press or PIR detection
      TURNON_DELAY = 10
      PIR_PIN = 22       # 15 on the board (this needn't to be a PIR. Can be a button also)
      LED_PIN = 16      # optional, don't use as Relay-PIN. It just shows detection time of the PIR without delay time
      
      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 and time.time() >= TURNON_DELAY:
                      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()
      
      

      Don’t know if it will work. Just brainstorming cause i haven’t much time

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: MagicMirror and Domoticz

      change the port of domoticz or MM. I think they are using both 8080

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Project overview - 09.02.2018 - revisited

      I totally agree with the “coffee is life” :D

      Looks good. Keep us up on date please ;)

      posted in Show your Mirror
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      Hey dude,

      sorry for not answering, but i am only rarely here :(

      First i would try to edit the config file:

      sudo nano /boot/config.txt
      

      try to uncomment “hdmi_force_hotplug=1” and try to uncomment “config_hdmi_boost=4”

      maybe play around with some other settings.
      https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

      Rebooting the pi once a day is not the best solution :/
      But however, if necessary:
      http://www.simsalabim-solutions.net/vademecum/raspberry_pi/setting_up_reboot_cron_job_on_pi

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: Temperature regulated fan on RPI

      @Peter

      why not just using a python script?

      found this one here:

      #!/usr/bin/env python3
      # coding: utf-8
      
      import os
      import time
      import signal
      import sys
      import RPi.GPIO as GPIO
      pin = 36 # The pin ID, edit here to change it
      maxTMP = 50 # The maximum temperature in Celsius after which we trigger the fan
      GPIO.setmode (GPIO.BOARD)
      
      def setup():
          GPIO.setmode(GPIO.BOARD)
          GPIO.setup(pin,GPIO.OUT)
          GPIO.setwarnings(False)
          return()
      def getCPUtemperature():
          res = os.popen('vcgencmd measure_temp').readline()
          temp =(res.replace("temp=","").replace("'C\n",""))
          print("temp is {0}".format(temp)) #Uncomment here for testing
          return temp
      def fanON():
          setPin(True)
          return()
      def fanOFF():
          setPin(False)
          return()
      def getTEMP():
          CPU_temp = float(getCPUtemperature())
      
          if CPU_temp>maxTMP:
              fanON()
      
          else:
              fanOFF()
      
          return()
      def setPin(mode): # A little redundant function but useful if you want to add logging
          GPIO.output(pin, mode)
          return()
      try:
          setup()
          while True:
              getTEMP()
              time. sleep(8) # Read the temperature every 5 sec, increase or decrease this limit if you want
      except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt
      	GPIO.cleanup()
      
      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: MMM-MyCommute

      For sure this is no problem. Take as much time as u need for your family. thats much more important!

      didn’t find a private message option, just a chat^^ sorry for that. I post my config right here.

      just for info: I didn’t touch the MMM-MyCommute.js, so its just this one i need: https://github.com/jclarke0000/MMM-MyCommute/blob/master/MMM-MyCommute.js

      So here is my full config:

      /* Magic Mirror Config Sample
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       *
       * For more information how you can configurate this file
       * See https://github.com/MichMich/MagicMirror#configuration
       *
       */
      
      var config = {
      	address: "0.0.0.0", // Address to listen on, can be:
      	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
      	                      // - another specific IPv4/6 to listen on a specific interface
      	                      // - "", "0.0.0.0", "::" to listen on any interface
      	                      // Default, when address config is left out, is "localhost"
      	port: 8080,
      	ipWhitelist: ["192.0.0.0/3", "::fff:0.0.0.0/1", "::fff:128.0.0.0/2", "::fff:192.0.0.0/3", "::fff:224.0.0.0/4", "127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
      	                                                       // or add a specific IPv4 of 192.168.1.5 :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
      	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
      
      	language: "de",
      	timeFormat: 24,
      	units: "metric",
      
      	modules: [
      		{
      			module: "alert",
      		},
      		{
              		module: 'MMM-Remote-Control'
              		// uncomment the following line to show the URL of the remote control on the mirror
              		// , position: 'bottom_left'
              		// you can hide this module afterwards from the remote control itself
          		},
      		{
      		module: 'MMM-SystemStats',
      		position: 'top_center', // This can be any of the regions.
      		classes: 'small dimmed', // Add your own styling. Optional.
      		config: {
      			updateInterval: 5000,
      			animationSpeed: 0,
      			align: 'right', // align labels
      			//header: 'System Stats', // This is optional
      			},
      		},
      		{
      			module: "updatenotification",
      			position: "top_bar"
      		},
      		{
      			module: "clock",
      			position: "top_left"
      		},
      		{
      			module: 'calendar',
      			header: 'Chris Kalender',
      			position: 'top_left',
      			config: {
      				calendars: [
      					{
      						symbol: 'calendar-check-o ',
      						url: '*private*'
      					},
      					{
                                                      symbol: 'calendar-check-o ',
                                                      url: 'http://i.cal.to/ical/61/nrw/feiertage/71e91ccb.83fad41c-d19fda68.ics'
                                              },
      
      				]
      
      			}
      		},
      		{
      			module: 'MMM-MyCommute',
      			position: 'top_left',
      			header: 'Verkehrslage',
      			classes: 'default everyone',
      			showSummary: 'true', 
      			config: {
      				apikey: '*private*',
          				origin: '*private*',  
      				destinations: [
            				{
              				destination: '*private*',
              				label: 'Arbeit',
              				mode: 'driving',
      					alternatives: 'true',
      					time: null
            				},
            				{
              				destination: '*private*',
              				label: '*private*',
              				mode: 'driving',
              				time: null
            				},
          				]
         			}
        		},
      //		{
      //			module: "compliments",
      //			position: "lower_third"
      //		},
      //		{
      //			module: "currentweather",
      //			position: "top_right",
      //			config: {
      //				location: "New York",
      //				locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
      //				appid: "YOUR_OPENWEATHER_API_KEY"
      //			}
      //		},
      //		{
      //			module: "weatherforecast",
      //			position: "top_right",
      //			header: "Weather Forecast",
      //			config: {
      //				location: "New York",
      //				locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
      //				appid: "YOUR_OPENWEATHER_API_KEY"
      //			}
      //		},
      		{
      			disabled: false,
      			module: 'MMM-NOAA',
      			position: 'top_right',
      			config: {
      
      				apiKey: "*private*",    // https://www.wunderground.com/weather/api  select the middle plan... 
      				useAir: false,             // set to false if you do not want to use Air Quality Index
      				airKey: "*private*",    // IF you want Air Quality Index
      				pws: "*private*",         // go here to find your pws: https://www.wunderground.com/wundermap
      				showClock: false,           // Hides or shows clock
      				dformat: false,             // for M/D/YYYY format, false for D/M/YYYY
      				format: "24",              // 12 or 24 hour format.. will default to 12 hour if none selected.
      				ampm: false,                // to show AM and PM on Sunrise/Sunset time
      				showGreet: false,          // deafult is false - to show greeting under clock and above date
      				name: "",                  // Your name
      				showWind: false,
      				showDate: false,
      				showForecast: true,         //show bottom 3 day forecast
      				flash: true,                 //Today in forecast flashes halo
      				showUV: true,               //show UV index
      	      			showBar: true,             // show Barometer
      	    			showHum: true,              //show Humidity level
      				position: 'top_right',       //whatever you have in above position must also be here
      	      			alert: true                //show weather alerts default is true
      				}
      		},
      		{
      			module: 'MMM-Globe',
      			position: 'top_right',
      			config: {
      					style: 'natColor',
      					imageSize: 200,
      					ownImagePath:'',
      					updateInterval: 10*60*1000
      				}
      		},
      		{
      			module: "newsfeed",
      			position: "bottom_bar",
      			config: {
      				feeds: [
      					{
      						title: "Tagesschau Themen",
      						url: "http://www.tagesschau.de/xml/rss2"
      					}
      				],
      				showSourceTitle: true,
      				showPublishDate: true,
      				showDescription: true,
      				updateInterval: 25000,
      			}
      		},
      	]
      
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== "undefined") {module.exports = config;}
      

      Thank u very much for helping :)

      posted in Transport
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @Rec3ptor

      If u followed the guide i posted, your PIGPIOD installation path should be “/usr/local/bin/pigpiod”

      For autostart when booting u must edit the rc.local. Mine is like this:

      pi@MagicMirror:~ $ cat /etc/rc.local
      #!/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
      
      iwconfig wlan0 power off &
      
      sleep 5 &
      
      /usr/local/bin/pigpiod
      
      sleep 10 &
      
      /usr/bin/python /home/pi/pir.py &
      
      exit 0
      

      So enter this via ssh:

      sudo nano /etc/rc.local
      

      and just put this into the file:

      /usr/local/bin/pigpiod
      
      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: Trying to use MMM-MyCommute, config.js doesn't look right

      @deerbelac said in Trying to use MMM-MyCommute, config.js doesn’t look right:

      You’re my new best internet friend.

      LOL

      you are welcome mate ;)

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: MMM-GoogleMapsTraffic

      @sheddingmyskin said in MMM-GoogleMapsTraffic:

                                  lat: '30.00000',
                                  lng: '-90.000000',
      

      This is wrong. Must look like this:

      lat: 30.00000,
      lng: -90.000000,
      

      Without the ’

      posted in Transport
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      There is no mistake as far as i can see.

      The “&” just need to be written, when a second or third command follows.

      So when u are just using this one command both (with or without the “&”) should work

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: Hello-Lucy

      I am full of admiration for your work. This is a great addition to anyone who already uses or wants to use voice commands.

      AWESOME :D

      posted in Fun & Games
      cruunnerrC
      cruunnerr
    • RE: Heat Problem

      i agree with @barnosch
      the power supply is not causing the heat problem! Well, if u can call it a problem… 66-70° while running magic mirror is ok. As barnosch said u probably can reduce it by removing unused stuff. :)

      @howi42
      maybe same recommendation here. Remove unused stuff. Thats the reason, why i am a fan of using the Lite versions of raspbian ^^
      Alexa-pi is maybe waiting all the time for your voice and that also needs CPU Power. And MagicMirror can raise the temp, too when using much modules. Especially when using modules with animation…

      Just to say:
      I am running my Magic Mirror in a completely closed frame (without any holes). Just put the small heatsinks u can buy everywhere on eBay on it and i have temperatures about 58-63°. When the monitor is on for about 10 minutes it will raise to max. 66-67°.

      For using a fan regulated by the Pi’s temperature u can check this: https://forum.magicmirror.builders/topic/6495/temperature-regulated-fan-on-rpi/3

      @mykle1
      Didn’t see your post, cause i was writing.
      But i never understood your temperature and your System Load :D
      even with using raspbian Lite and just installing MM i never got this results. Even when the Pi lays on my table with heatsinks.^^
      was always above 50°

      Maybe u are sitting in an igloo XD

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @chandra said in {HowTo} turn on/off your monitor (Time based, PIR/Button, App):

      Screen goes off after 120sec, But when it sense the motion, the screen is black.

      Hint from the main post:

      To check if it works just go into terminal via ssh and type:

      sudo tvservice -o to turn off
      sudo tvservice -p to turn on

      edit: for some monitors the following commands work better. Please use them if your monitor needs it:

      vcgencmd display_power 0 to turn off
      vcgencmd display_power 1 to turn on

      edit:
      also check this:
      https://forum.magicmirror.builders/topic/6291/howto-turn-on-off-your-monitor-time-based-pir-button-app/11

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: Hello-Lucy

      That is really lovely :)

      Another suggestion could be to say “Go to standby” and it will turn off the Monitor or something like that. Just for the need to say 1 command instead of 2 or 3 commands.
      And “Wake up” will show the last used configuration.

      But anyway a wonderful addition :D

      posted in Fun & Games
      cruunnerrC
      cruunnerr
    • RE: how to start an image slide show with a press of a button?

      So you use the camera module i posted?

      unfortunately i don’t use this module, so i am maybe the wrong person to ask…

      But i took a look at the webcam.js of the module and in line 46/47 the width and hight is defined.
      Maybe u should play around with that…
      https://github.com/alexyak/camera/blob/master/webcam.js

      nano MagicMirror/modules/camera/webcam.js

      also check the camera.js at line 62/63…

      nano MagicMirror/modules/camera/camera.js

      I don’t know if it would be necessary to set the resolution of the cam within raspbian… ?

      To start the cam with a button u can even use the MMM-Buttons module. This should work, if i understand the camera-module correct ^^

      {
      		    module: 'MMM-Buttons',
      		    config: {
      			maxShortPressTime: 1000,
      		        buttons: [
      		            {
      		                pin: 15,
      		                name: "camera",
      		                shortPress: {
      		                    notification: "SHOW_CAMERA",
                                               }
      		             },
                                      longPress: {
                                      notification: "HIDE_CAMERA",
                                               },
      		             },
      		         ]
      		     }
      		},
      
      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Hello-Lucy

      @Mykle1 said in Hello-Lucy:

      Is this what you meant?

      Jap :)
      This is going to be the alexa for every mirror :D

      posted in Fun & Games
      cruunnerrC
      cruunnerr
    • RE: TypeError: Cannot read property 'hash' of null

      @RoboDoc said in TypeError: Cannot read property ‘hash’ of null:

      at /home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:68:31

      line 68 in the node_helper of the update notification seems to check all modules on GitHub for updates, if i understand that correctly…

      So there are two options:

      1. Your mirror lost it’s wifi/internet connection. Maybe u could check on your router if the device had logged off from the wifi.
        Or check the strength of the connection. Maybe take a look at the wifi_rebooter, as the wifi on the RPi 3 is not the best. So i installed an automatically wifi_rebooter here. U could try that as well: http://alexba.in/blog/2015/01/14/automatically-reconnecting-wifi-on-a-raspberrypi/
        in my case my Pi pings my router address every 3 minutes and when it cannot reach it, it reboots it’s wifi itself.

      2. Some of the 3rd party modules has errors. But i don’t think so. To check it u could just run the default modules for a while

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Why does my installation show 2 instances?

      Because u used the automatic installer and pressed “yes” when it asked you for starting MagicMirror automatically ;)

      try

      pm2 stop mm

      pm2 delete mm

      pm2 save

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Refresh every day at midnight

      i would use pm2 for that.

      sudo nano /etc/crontab

      # /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 )
      59 23   * * *   pi      pm2 restart mm
      #
      

      should work…

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • 1 / 1