• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Problem of running MMM-Podcast and MMM-Button

Scheduled Pinned Locked Moved Troubleshooting
13 Posts 2 Posters 6.1k Views 2 Watching
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.
  • H Offline
    hirsnmirsn
    last edited by yawns May 4, 2017, 3:03 PM May 4, 2017, 10:21 AM

    Hello,
    i have the same problem.

    my config.js looks like

    {
           			module: 'MMM-Button',
            		config: {
    				//https://github.com/PtrBld/MMM-Button
    				//https://developer.microsoft.com/en-us/windows/iot/samples/pushbutton
    				//pin GIPO 5 und Ground
    				buttonPIN: '5'
    			}
    		},
    
    {
          			module: 'MMM-Podcast',
           			position: 'middle_center',
            		config: {
              			feedurl: 'http://www.tagesschau.de/export/video-podcast/webm/tagesschau-in-100-sekunden/'
           		 	}
    		},
    

    My button.js looks like

    /* global Module */
    
    /* Magic Mirror
     * Module: MMM-Button
     *
     * MIT Licensed.
     */
    
    Module.register('MMM-Button',{	
    	requiresVersion: "2.1.0",
    	defaults: {
    		buttonPIN: 5,
    		//time in miliseconds before another button click is recognized
    		clickDelay: 500,		
    	},	
    	// Override socket notification handler.
    	socketNotificationReceived: function(notification, payload) {
    		if (notification === "BUTTON_PRESSED"){
    			this.sendNotification(notification, payload)
    		}
    	},	
    	start: function() {
    		this.sendSocketNotification('BUTTON_CONFIG', this.config);
    		Log.info('Starting module: ' + this.name);
    	}
    });
    

    Can anybody help us?

    1 Reply Last reply Reply Quote 0
    • A Offline
      alex84
      last edited by May 4, 2017, 2:59 PM

      in the config.js there is a missing , behind buttonPIN: ‘5’

      H 1 Reply Last reply May 4, 2017, 4:05 PM Reply Quote 0
      • H Offline
        hirsnmirsn @alex84
        last edited by hirsnmirsn May 4, 2017, 4:08 PM May 4, 2017, 4:05 PM

        @alex84 if i had the , behind the buttonPIN:5 ther is always the Black screen

        1 Reply Last reply Reply Quote 0
        • A Offline
          alex84
          last edited by May 4, 2017, 4:09 PM

          there is missing a comma

          H 1 Reply Last reply May 4, 2017, 4:17 PM Reply Quote 0
          • H Offline
            hirsnmirsn @alex84
            last edited by May 4, 2017, 4:17 PM

            @alex84 yes

            	{
               			module: 'MMM-Button',
                		config: {
            			//https://github.com/PtrBld/MMM-Button
            			//https://developer.microsoft.com/de-de/windows/iot/win10/samples/PushButton.htm
            			//pin GIPO 5 und Ground
            			buttonPIN: '5',
            		}
            	},		
            

            but i have always the Black screen.

            1 Reply Last reply Reply Quote 0
            • A Offline
              alex84
              last edited by May 4, 2017, 7:34 PM

              Change into the MMM-Button folder and execute the following commands

              sudo npm install --save-dev electron-rebuild

              the

              ./node_modules/.bin/electron-rebuild

              H 1 Reply Last reply May 5, 2017, 2:32 PM Reply Quote 0
              • H Offline
                hirsnmirsn @alex84
                last edited by hirsnmirsn May 5, 2017, 2:38 PM May 5, 2017, 2:32 PM

                @alex84 Thank You,
                Now i have no mor Black Screen, but the Button dont work.
                I have a Pyton Script, this works.

                #Tagesschau.py
                import RPi.GPIO as GPIO
                import os
                import sys
                from subprocess import Popen

                GPIO.setmode(GPIO.BCM)

                GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_UP)

                movie1 = (“http://media.tagesschau.de/video/100s/2017/0504/TV-100s-1840.webm.h264.mp4”)

                last_state1 = True
                last_state2 = True

                input_state1 = True
                input_state2 = True
                quit_video = True

                player = False

                while True:
                #Read states of inputs
                input_state1 = GPIO.input(5)

                #If GPIO(5) is shorted to Ground
                if input_state1 != last_state1:
                    if (player and not input_state1):
                        os.system('killall omxplayer')
                        omxc = Popen(['omxplayer', movie1])
                        player = True
                    elif not input_state1:
                        omxc = Popen(['omxplayer', movie1])
                        player = True
                
                #If omxplayer is running and GIOP(5) are not shorted to Ground
                elif (player and input_state1 and input_state2):
                    os.system('killall omxplayer')
                    player = False
                
                #Set last_input states
                last_state1 = input_state1
                

                Has anybody a working config and button config that he can post?

                1 Reply Last reply Reply Quote 0
                • A Offline
                  alex84
                  last edited by May 5, 2017, 2:54 PM

                  I will you later Post my config of the button and my config as well as the config of the podcast. I’m on the road. :)

                  H 1 Reply Last reply May 5, 2017, 7:17 PM Reply Quote 0
                  • H Offline
                    hirsnmirsn @alex84
                    last edited by May 5, 2017, 7:17 PM

                    @alex84 Thank You :ok_hand_tone3:

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      alex84
                      last edited by alex84 May 6, 2017, 11:22 AM May 6, 2017, 9:58 AM

                      Hello hirsnmirsn

                      sorry for the late reply

                      This is in my Config.js

                      {
                      module: “MMM-Podcast”
                      },
                      {
                      module: “MMM-Button”,
                      config: {
                      }
                      },

                      and last but not least the MMM-Button.js

                      /* global Module */

                      /* Magic Mirror

                      • Module: MMM-Button
                      • MIT Licensed.
                        */

                      Module.register(‘MMM-Button’,{
                      requiresVersion: “2.1.0”,
                      defaults: {
                      buttonPIN: 5,
                      //time in miliseconds before another button click is recognized
                      clickDelay: 500,
                      },
                      // Override socket notification handler.
                      socketNotificationReceived: function(notification, payload) {
                      if (notification === “BUTTON_PRESSED”){
                      this.sendNotification(notification, payload)
                      }
                      },
                      start: function() {
                      this.sendSocketNotification(‘BUTTON_CONFIG’, this.config);
                      Log.info('Starting module: ’ + this.name);
                      }
                      });

                      Make a reboot after Change your config.js

                      The only difference I can see in the files is that you tried to load another Solution (so it stands in your Config.js)

                      Feedurl: ‘http://www.tagesschau.de/export/video-podcast/webm/tagesschau-in-100-sekunden/’

                      I have tried it and with me everything runs without problems.

                      H 1 Reply Last reply May 6, 2017, 4:20 PM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        6/13
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy