• 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.

MMM-Carousel config.js Help Please

Scheduled Pinned Locked Moved Troubleshooting
10 Posts 2 Posters 993 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.
  • A Offline
    aecandroid @sdetweil
    last edited by Apr 22, 2020, 3:28 PM

    @sdetweil Thanks for your help. Unfortunately that doesn’t seem to be working for me. I can’t post what it’s telling me as the reply keeps getting flagged for spam? Essentially it’s telling me the proper usage of npm and asking if I meant npm config. Maybe I’m doing something wrong? I’m doing cd MagicMirror then npm config:check. Sorry, it would be much easier if I could copy / paste but for whatever reason, it won’t let me.

    S 1 Reply Last reply Apr 22, 2020, 4:23 PM Reply Quote 0
    • S Offline
      sdetweil @aecandroid
      last edited by Apr 22, 2020, 4:23 PM

      @aecandroid ok try
      npm run config:check

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      A 2 Replies Last reply Apr 22, 2020, 8:43 PM Reply Quote 0
      • A Offline
        aecandroid @sdetweil
        last edited by Apr 22, 2020, 8:43 PM

        @sdetweil thanks, that worked. Looks like I’ve got some clean up to do in my initial code before moving on. I’ll clean this up tonight and implement the new module tomorrow. Thanks again for your help.

        1 Reply Last reply Reply Quote 0
        • A Offline
          aecandroid @sdetweil
          last edited by Apr 23, 2020, 2:35 PM

          @sdetweil Thanks for the npm run config:check That has helped me to clean up my config.js to not have any errors. After fixing all the issues (mainly with the use of ( ’ ) as opposed to ( " ), which is confusing when most of the code already written uses the single quote instead of the double?) I then went to add the Carousel to the top of my code as below:

          /* 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: ["::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: "en",
          	timeFormat: 24,
          	units: "imperial",
          
          	modules: [
          		{
          			module: "MMM-Carousel",
          			config: {
          				transitionInterval: 10000,
          				mode: "global"
                      }
                  }
          		{
          			module: "alert",
          		},
          		{
          			module: "clock",
          			position: "top_left"
          		},
          		{
          			module: "calendar",
          			header: "What are we doing?",
          			position: "top_left",
          			config: {
          				calendars: [
          					{
          						symbol: "calendar-check-o ",
          						url: "webcal://it's-still-my-secret.ical"
          					}
          				]
          			}
          		},
          		 {
          			       module: "MMM-TFL",
          			       position: "bottom_right", // This can be any of the regions but works best on either side of the display
          			       config: {
          				               updateTime: 600000,
          				               modes: ["tube", "overground", "national-rail"],
          				               lines: ["c2c", "bakerloo", "central", "district", "hammersmith-city", "jubilee", "metropolitan", "northern", "piccadilly", "victoria", "waterloo-city"],
          				             }
          			     },
          		{
          			units: "imperial",
          			module: "currentweather",
          			position: "top_right",
          			config: {
          				location: "*****",
          				locationID: "********", //ID from http://www.openweathermap.org/help/city_list.txt
          				appid: "********************************",
          				roundTemp: "true",
          				degreeLabel: "true",
          				showPeriod: "fasle",
          				onlyTemp: false,
          				iconTable: {
          					    					"01d": "wi-day-sunny",
          					    					"02d": "wi-day-cloudy",
          					    					"03d": "wi-cloudy",
          					    					"04d": "wi-cloudy-windy",
          					    					"09d": "wi-showers",
          					    					"10d": "wi-rain",
          					    					"11d": "wi-thunderstorm",
          					    					"13d": "wi-snow",
          					    					"50d": "wi-fog",
          					    					"01n": "wi-night",
          					    					"02n": "wi-night-cloudy",
          					    					"03n": "wi-night-cloudy",
          					    					"04n": "wi-night-cloudy",
          					    					"09n": "wi-night-showers",
          					    					"10n": "wi-night-rain",
          					    					"11n": "wi-night-thunderstorm",
          					    					"13n": "wi-night-snow",
          					    					"50n": "wi-night-alt-cloudy-windy"
          				}
          			}
          		},
          		{
          			units: "imperial",
          			module: "weatherforecast",
          			position: "top_right",
          			header: "Weather Forecast",
          			config: {
          				location: "London",
          				locationID: "*******", //ID from http://www.openweathermap.org/help/city_list.txt
          				appid: "********************************"
          			}
          		},
          		{
          			module: "MMM-UKNationalRail",
          			position: "bottom_left",
          			header: "Departures", //Optional - delete this line to turn OFF the header completely
          			config: {
          				stationCode: "***", // CRS code for station
          				app_id: "********", // TransportAPI App ID
          				app_key: "*********************************", // TransportAPI App Key
          				maxResults: 5, //Optional - Maximum results to display.
          				showOrigin: false //Optional - Show the origin of the train in the table
          			}
          		},
          	]
          
          };
          
          /*************** DO NOT EDIT THE LINE BELOW ***************/
          if (typeof module !== "undefined") {module.exports = config;}
          

          With the code implemented at the top, I ran npm run config:check and it now comes back that it doesn’t like the { before "module: "alert", referring to it as an Unexpected token. When I’ve taken that out, it says the Unexpected token is now module. I’m thinking I’m missing something that should be there as opposed to something that shouldn’t but I’m not sure what the token it’s expecting is?

          S 1 Reply Last reply Apr 23, 2020, 3:33 PM Reply Quote 0
          • S Offline
            sdetweil @aecandroid
            last edited by Apr 23, 2020, 3:33 PM

            @aecandroid said in MMM-Carousel config.js Help Please:

                }
              {
              	module: "alert",
            

            yes,

            each module is

            {
              module: name,
              config: {
              }
            },   //< ---- note the trailing comma
            

            there is a missing comma before the module alert {

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            A 2 Replies Last reply Apr 23, 2020, 3:49 PM Reply Quote 0
            • A Offline
              aecandroid @sdetweil
              last edited by Apr 23, 2020, 3:49 PM

              @sdetweil right you are!! “Your configuration file doesn’t contain syntax errors :)” is now what I’m seeing. Thank you for all your help.

              1 Reply Last reply Reply Quote 0
              • A Offline
                aecandroid @sdetweil
                last edited by Apr 23, 2020, 5:18 PM

                @sdetweil right, feeling pretty stupid at the moment. I’ve added the code with global setting but it doesn’t appear to have changed anything. No errors are coming up. Do I need to add or change any code of the existing modules in my config? I was a bit confused as most modules need an npm install but this one doesn’t appear to need that according to the readme. Sorry to be a continuous pain. Your help is greatly appreciated.

                S 1 Reply Last reply Apr 23, 2020, 5:34 PM Reply Quote 0
                • S Offline
                  sdetweil @aecandroid
                  last edited by Apr 23, 2020, 5:34 PM

                  @aecandroid no idea. haven’t used this module.

                  a module needs an npm install ONLY IF is contains a package.json file

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    7/10
                    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