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

    Posts

    Recent Best Controversial
    • RE: Config for clock not working

      yes true and false are booleans and no strings, so you need to remove the quotes

      posted in Troubleshooting
      strawberry 3.141S
      strawberry 3.141
    • RE: Ability to change color by physical button?

      maybe this will give you a start

      I added the following lines to MagicMirror/css/custom.css

      .male {
      	background: black;
      	color: blue;
      }
      
      .female {
      	background: white;
      	color: pink;
      }
      

      and for testing I edited the clock module (MagicMirror/modules/default/clock/clock.js) because it get’s updated every second.

      put those lines right after line 69

      if(secondsWrapper.innerHTML % 10 == 0){ /*changes class every 10 seconds, because i don't have a button i made this "hack" for testing purposes*/
      			var body = document.querySelector('body');
      			if(body.classList.contains("male")){
      				body.classList.remove("male");
      				body.classList.add("female");
      			} else {
      				body.classList.remove("female");
      				body.classList.add("male");
      			}
      		}
      
      posted in Requests
      strawberry 3.141S
      strawberry 3.141
    • RE: Voice control

      https://vimeo.com/170950524

      posted in Development
      strawberry 3.141S
      strawberry 3.141
    • RE: Voice control

      I made some progress on my voice control module.

      Currently I’m able to switch between different leagues for my soccer standings module.

      A short video demo

      posted in Development
      strawberry 3.141S
      strawberry 3.141
    • RE: MMM-Soccer - Standings, Schedules and Top Scorers

      this is how the module looks like for the german league

      0_1466075701079_soccer standings

      posted in Sport
      strawberry 3.141S
      strawberry 3.141
    • MMM-Soccer - Standings, Schedules and Top Scorers

      Description

      Module to bring your favorite soccer leagues and cups onto the MagicMirror. Display information about standings, schedules, and top scorers.

      Screenshot

      ba708951-602b-411a-9201-909530371ba6-image.png
      f12f16c6-8546-4fa3-91fe-2c5b20adda61-image.png

      Link

      https://github.com/fewieden/MMM-soccer

      [card:fewieden/MMM-soccer]

      posted in Sport bundesliga football modal premiere league primiera division soccer voice control
      strawberry 3.141S
      strawberry 3.141
    • RE: Ability to change color by physical button?

      i was to late to edit :pensive:

      'use strict';
      
      /* Magic Mirror
       * Module: MMM-PIR-Sensor
       *
       * By Paul-Vincent Roll http://paulvincentroll.com
       * MIT Licensed.
       */
      
      /*import dependencies*/
      const NodeHelper = require('node_helper');
      const gpio = require('wiring-pi');
      const exec = require('child_process').exec;
      
      module.exports = NodeHelper.create({
        /*this method got fired when the core is starting your module helper*/
        start: function () {
          this.started = false
        },
        /*this function will activate your monitor by enabling hdmi output or sending a signal to the relais via gpio pin*/
        activateMonitor: function () {
          /* you don't need the following 3 lines, which would set a signal to the relais specified in the config section of your module of the file above*/
          if (this.config.relayPIN != false) {
            gpio.digitalWrite(this.config.relayPIN, this.config.relayOnState)
          }
          /*after removing the previous 3 lines you also need to change "else if" to "if". the following lines run a command in a child process in the background to enable the hdmi output*/
          else if (this.config.relayPIN == false){
            exec("/opt/vc/bin/tvservice -p", null);
          }
        },
      /*this function will deactivate your monitor by disabling hdmi output or sending a signal to the relais via gpio pin*/
        deactivateMonitor: function () {
      /* you don't need the following 3 lines, which would set a signal to the relais specified in the config section of your module of the file above*/
          if (this.config.relayPIN != false) {
            gpio.digitalWrite(this.config.relayPIN, this.config.relayOffState)
          }
       /*after removing the previous 3 lines you also need to change "else if" to "if". the following lines run a command in a child process in the background to disable the hdmi output*/
          else if (this.config.relayPIN == false){
            exec("/opt/vc/bin/tvservice -o", null);
          }
        },
        /*here you receive messages which you send via modulename.js*/
        socketNotificationReceived: function(notification, payload) {
          const self = this;
          /*the following part runs when you receive the notification from your module l. 33 on github "this.sendSocketNotification('CONFIG', this.config);"*/
          if (notification === 'CONFIG' && this.started == false) {
            
            const self = this
            this.config = payload
            
            //Setup pins
            exec("echo '" + this.config.sensorPIN.toString() + "' > /sys/class/gpio/export", null); /*motion sensor pin*/
            exec("echo 'in' > /sys/class/gpio/gpio" + this.config.sensorPIN.toString() + "/direction", null); /*relais pin*/
            /*fllowing lines not important if you're not using relais*/
            if (this.config.relayPIN) {
              exec("echo '" + this.config.relayPIN.toString() + "' > /sys/class/gpio/export", null);
              exec("echo 'out' > /sys/class/gpio/gpio" + this.config.relayPIN.toString() + "/direction", null);
              exec("echo '1' > /sys/class/gpio/gpio" + this.config.relayPIN.toString() + "/value", null);
            }
            
            //Set gpio-mode
            gpio.setup('sys');
            
            //Detected movement
            /*when you detect a movement with your sensor it will run the callback "function(delta){...}"*/
            gpio.wiringPiISR(this.config.sensorPIN, gpio.INT_EDGE_BOTH, function(delta) {
              if (gpio.digitalRead(self.config.sensorPIN) == 1) {
                /* motion detected send the notification to your module*/
                self.sendSocketNotification("USER_PRESENCE", true);
                if (self.config.powerSaving){
                  /*activate the monitor again to show the user data on your screen*/
                  self.activateMonitor()
                }
              }
              //No movement
              else if (gpio.digitalRead(self.config.sensorPIN) == 0) {
                /*send your module the notification tha there is no user present and deactivate the monitor*/
                self.sendSocketNotification("USER_PRESENCE", false);
                if (self.config.powerSaving){
                  self.deactivateMonitor()
                }
              }
            });
           
          this.started = true
          };
        }
        
      });
      
      posted in Requests
      strawberry 3.141S
      strawberry 3.141
    • RE: Ability to change color by physical button?

      i hope the following lines can help you to understand it a bit more and that it is explained correctly.

      this references the module itself

      so in the module you can do this.sendSocketNotification(…) which will call the function sendsocketnotification of your module (this)

      also you can follow this guide to develop a module https://github.com/MichMich/MagicMirror/tree/master/modules

      /* Magic Mirror
       * Module: MMM-PIR-Sensor
       *
       * By Paul-Vincent Roll http://paulvincentroll.com
       * MIT Licensed.
       */
      
      /* registers a module with the name MMM-PIR-Sensor in the magic mirror system*/
      Module.register('MMM-PIR-Sensor',{
      	
              /*config part*/
      	defaults: {
      		sensorPIN: 22, /*number of pin can be different for raspberry pi version e.g. https://raspilab.files.wordpress.com/2014/08/gpiosb.png*/
      		relayPIN: false, /*this is for using relais in this module not needed because you can also set the hdmi output off*/
      		powerSaving: true,
      		relayOnState: 1, /*not important because you're not using relays*/
      	},
      	
              /*here you receive messages which you send via node_helper.js*/
      	socketNotificationReceived: function(notification, payload) {
      		if (notification === "USER_PRESENCE"){
                              /*when you receive the notification user_presence from your node_helper you send a global message with this notification to every module in magic mirror so they can handle this event as well*/
      			this.sendNotification(notification, payload)
      		}
      	},
      	
              /*this method got fired when the core is starting your module
      	start: function() {
                      /* the following 6 lines can be removed if you don't want to use relais. The functionality of these lines is to set relayoffstate depending on the relayonstate defined in the configt section above*/
      		if (this.config.relayOnState == 1){
      			this.config.relayOffState = 0
      		}
      		else if (this.config.relayOnState == 0){
      			this.config.relayOffState = 1
      		}
                      /*here you send a notification to your node_helper.js*/
      		this.sendSocketNotification('CONFIG', this.config);
                       /*here you print some information to the console, which you can't se without enabling the developer console in the electronh wrapper during runtime*/
      		Log.info('Starting module: ' + this.name);
      	}
      });
      
      posted in Requests
      strawberry 3.141S
      strawberry 3.141
    • RE: Ability to change color by physical button?

      if you post your code in here we may can assist you a little bit

      posted in Requests
      strawberry 3.141S
      strawberry 3.141
    • RE: Ability to change color by physical button?

      https://www.raspberrypi.org/learning/physical-computing-with-python/ maybe this can help you to understand how the gpio pins work, but it’s a different programmin language as in this project

      posted in Requests
      strawberry 3.141S
      strawberry 3.141
    • RE: Ability to change color by physical button?

      you could go for a button like this https://www.adafruit.com/products/367 and hook it on the gpio pins.

      then you should write your own module where you can control your pins e.g. like this module https://github.com/paviro/MMM-PIR-Sensor

      instead of shutting down your tv you could change classes of the document to change the design

      posted in Requests
      strawberry 3.141S
      strawberry 3.141
    • RE: Screen Font is too big

      change it globally e.g.

      body {
          font-size: 1em
      }
      

      to change it more precisely use specific selectors to change it

      posted in Troubleshooting
      strawberry 3.141S
      strawberry 3.141
    • RE: External TXT file

      create a node_helper and use fs in there

      var fs = require('fs');
      fs.readFile('file.txt', (err, data) => {
        if (err) throw err;
        //send data to the module
        this.sendSocketNotification('FILE', data);
      });
      

      and then you can display it in the module itself

      further details https://github.com/MichMich/MagicMirror/tree/master/modules

      posted in Troubleshooting
      strawberry 3.141S
      strawberry 3.141
    • RE: Screen Font is too big

      you can set your own font-size in MagicMirror/css/custom.css

      posted in Troubleshooting
      strawberry 3.141S
      strawberry 3.141
    • RE: How to use "require" in a module?

      take a look into the documentation on how to write a module, especially the part with node_helper

      posted in Development
      strawberry 3.141S
      strawberry 3.141
    • Voice control

      I’m currently working on a voice control module.

      For now I’m able to switch between the modes Train, Weather and Spotify.

      In this modes I can already detect:

      play the next song
      shuffle playlist
      stop the music
      how is the weather today
      how is the weather tomorrow
      when does the next train depart

      posted in Development
      strawberry 3.141S
      strawberry 3.141
    • RE: USB-Microphone TP6920

      I reseted all my config changes

      the problem why I changed it was because I couldn’t record with arecord test.wav.
      So i thought the mic is not working, but it’s not the default mic. With arecord -D plughw:1,0 test.wav its’s working now. Thanks

      Any ideas how to change it to the default microphone?

      posted in Hardware
      strawberry 3.141S
      strawberry 3.141
    • RE: USB-Microphone TP6920

      Raspberry Pi

      Syslog
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.370474] usb 1-1.4: new full-speed USB device number 7 using dwc_otg
      Jun 8 21:13:10 raspberrypi rsyslogd-2007: action ‘action 17’ suspended, next retry is Wed Jun 8 21:13:40 2016 [try http://www.rsyslog.com/e/2007 ]
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.500496] usb 1-1.4: New USB device found, idVendor=1130, idProduct=6920
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.500521] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.500534] usb 1-1.4: Product: TP6920
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.500546] usb 1-1.4: Manufacturer: TP6920
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.500558] usb 1-1.4: SerialNumber: 0621
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.504859] snd-usb-audio 1-1.4:1.0: cannot find the slot for index 0 (range 0-0), error: -16
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.504882] usb 1-1.4: cannot create card instance 0
      Jun 8 21:13:10 raspberrypi kernel: [ 2437.504911] snd-usb-audio: probe of 1-1.4:1.0 failed with error -16
      Jun 8 21:13:10 raspberrypi systemd-udevd[1238]: failed to execute ‘/lib/udev/mtp-probe’ ‘mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 7’: No such file or directory

      looks like i probably messed up a config

      i followed a guide and changed

      options snd-usb-audio index=-2

      to

      options snd-usb-audio index=0

      posted in Hardware
      strawberry 3.141S
      strawberry 3.141
    • USB-Microphone TP6920

      Hello guys,

      I bought myself an usb-microphone (TP6920). On my Laptop (Ubuntu 16.04) I can use it plug’n’play, but it’s not getting recognised on the Raspberry Pi 3.

      Any ideas what i can try?

      Thanks in advance

      posted in Hardware usb microphone
      strawberry 3.141S
      strawberry 3.141
    • RE: Weatherunderground - currently - hourly - daily - configurable

      Can be any WU api location info.

      US Example: NY/New_York
      Example: locid:NLXX8014;loctype:1

      so just change it to CA/San_Francisco

      posted in Troubleshooting
      strawberry 3.141S
      strawberry 3.141
    • 1 / 1