MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

After adding MMM-GPIO-Notifications, config.js doesn't work...



  • Hi!

    My config.js has an error in it and I’m not able to solve it. Here it is:

    /* 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: "localhost", // 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: ["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: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    
    		{
    			module: "newsfeed",
    			position: "bottom_bar",
    			config: {
    				feeds: [
    					{
    						title: "Neue Zürcher Zeitung",
    						url: "https://www.nzz.ch/recent.rss"
    					},
    
    
    				],
    				showSourceTitle: true,
    				showPublishDate: true,
    				broadcastNewsFeeds: true,
    				broadcastNewsUpdates: true
    			}
    		},
    
    		    {
    
          			module: "MMM-CalendarExt",
          			position: "top_left",
          			config: {
            		system: {
              				show: ["daily"],
              				locale: 'de',
              				redrawInterval:60000,
            			},
            			views: {
              				daily: {
                						position:'lower_third',
                						counts:7,
              					},
    
            				},
    
            			defaultCalendar: {
              						maxEntries:50,
              						maxDays:180,
              						interval: 1000*60*5,
            					},
    
            			calendars :[
              					{
                						name: "Tommaso",
                						url: "https://calendar.google.com/calendar/ical/tommaso.peduzzi%40gmx.ch/private-088063fff967db8474e57b3a7cdf176a/basic.ics",
    							profiles: ['Tom'],
              					},
              					{
                						name: "Ferien",
                						url: "https://www.ferienwiki.ch/exports/ferien/2019/ch/basel-stadt",
    							profiles: ['default'],
              					},
    
        
            				],
          				}
        		},    						
    				{
            		module: 'MMM-ProfileSwitcher',
           				config: {
               					// See 'Configuration options' for more information.
        					}
      			},
            {
                module: "currentweather",
                position: "top_right",
                config: {
                  location: "Basel",
                  locationID: "6458763",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                  appid: "123"
              }
            },
            {
                module: "weatherforecast",
                position: "top_right",
                header: "Weather Forecast",
                config: {
                  location: "Basel",
                  locationID: "6458763",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                  appid: "123"
              }
            },
    
    	
    
    
    			{
    			    module: 'MMM-GPIO-Notifications',
    			    config: {
    			        '17': {
    			          gpio_state: 1,
    			          gpio_debounce: 10,
    			          notifications: [
    			            {
    			              notification: "'CURRENT_PROFILE', 'Tom'",
    			              payload: { true }
    			            },
    			            {
    			              notification: 'SCREEN_ON',
    			              payload: { 'forced': false }
    			            }
    			          ]
    			        },
    			        '4': {
    			          gpio_state: 1,
    			          gpio_debounce: 20,
    			          notifications: [
    			            {
    			              'notification': 'SCREEN_TOGGLE',
    			              'payload': { 'forced': true }
    			            }
    			          ]
    			        }
    			    }
    },
    ]
    };
    
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") {module.exports = config;}
    
    
    

    Can anybody help me here?

    tomXGames



  • @tomXGames run

    npm check:config
    

    Fix errors top down



  • @sdetweil said in After adding MMM-GPIO-Notifications, config.js doesn’t work...:

    npm check:config

    It says, that there is no such command… I’m running it in the MagicMirror directory…



  • @tomXGames sorry,

    npm config:check

    See list of npm enabled commands in package.json



  • @sdetweil The command still doesn’t work and after adding a comma, nothing is even shown. What am i doing wrong?



  • @tomXGames you do this command in the MagicMirror folder



  • @sdetweil Yeah that’s what I did


  • Project Sponsor

    @tomXGames THis certainly doesn’t look right:
    notification: "'CURRENT_PROFILE', 'Tom'",



  • @tomXGames what do u mean by doesn’t work?

    Black screen could indicate another problem
    Are u using pm2?
    If so, pm2 logs to see what the output is.

    Also, dev mode

    pm2 stop 0
    cd ~/MagicMirror
    npm start dev
    

  • Project Sponsor

    @tomXGames IF not mistaken, the “,” after the last module should not be there either.


Log in to reply