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

    Posts

    Recent Best Controversial
    • RE: ipWhitelist HowTo

      Maybe I have missed this from someone else, but one important thing about the whitelisting message:

      “This device is not allowed to access your mirror.
      Please check your config.js or config.js.sample to change this.”
      

      The EXACT SAME message appears (in my case) if the config.js has syntax errors. Locally your mirror will tell you that there is no config file or just give you a black screen, but if you try to reach it from outside through a browser (Firefox and Chrome in my case) with a broken config.js, you will get the whitelisting message above.

      So, before trying to get your ipWhitelist in the right shape, make sure you have no other syntax errors with the mirror, e.g. using

      npm run config:check
      

      If you had some and had them corrected, be safe and restart the mirror.
      Below you can see the example in my case.

      pi@magicmirror2:~ $ tail ~/.pm2/logs/mm-out-0.log
      No helper found for module: helloworld.
      All module helpers loaded.
      Starting server on port 8080 ...
      Server started ...
      Connecting socket for: updatenotification
      Sockets connected & modules started ...
      Launching application.
      Access denied to IP address: 66.249.93.64
      Access denied to IP address: 80.157.5.50
      Access denied to IP address: 80.157.5.50
      pi@magicmirror2:~ $ cd MagicMirror/
      pi@magicmirror2:~/MagicMirror $ npm run config:check
      
      > magicmirror@2.1.2 config:check /home/pi/MagicMirror
      > node tests/configs/check_config.js
      
      Checking file...  /home/pi/MagicMirror/config/config.js
      Line 260 col 9 Expected ']' to match '[' from line 26 and instead saw '{'.
      Line 261 col 16 Expected '}' to match '{' from line 11 and instead saw 'module'.
      Line 261 col 22 Missing semicolon.
      Line 261 col 16 Unrecoverable syntax error. (95% scanned).
      pi@magicmirror2:~/MagicMirror $ sudo nano config/config.js
      pi@magicmirror2:~/MagicMirror $ npm run config:check
      
      > magicmirror@2.1.2 config:check /home/pi/MagicMirror
      > node tests/configs/check_config.js
      
      Checking file...  /home/pi/MagicMirror/config/config.js
      Your configuration file don't containt syntax error :)
      pi@magicmirror2:~/MagicMirror $ pm2 restart mm
      Use --update-env to update environment variables
      [PM2] Applying action restartProcessId on app [mm](ids: 0)
      [PM2] [mm](0) ✓
      ┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬──────────┬──────┬──────────┐
      │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem      │ user │ watching │
      ├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼──────────┼──────┼──────────┤
      │ mm       │ 0  │ fork │ 901 │ online │ 6       │ 0s     │ 18% │ 2.3 MB   │ pi   │ disabled │
      └──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴──────────┴──────┴──────────┘
       Use `pm2 show ` to get more details about an app
      pi@magicmirror2:~/MagicMirror $
      
      
      posted in Tutorials
      lavolp3L
      lavolp3
    • RE: Default Calendar not Displaying Holidays

      @swvalenti Sorry Iw as too fast and too occupied. It was in the github repository in the issues (and the ones already solved

      Using the default URL (“webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics”) only gets you an ics for >2017-2018 holidays, so nothing shows now. You can verify this by downloading it and opening it in a calendar app.

      Trying using the new URL “https://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics” in your config file and >that should get your MagicMirror to show the holidays in 2019.

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: MM booting to black

      @dwleo Oh boy, you’re really new to this :-)
      How can i describe?

      https://www.raspberrypi.org/documentation/remote-access/ssh/

      You’ve got a lot to learn young padawan

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: MMM-Calender

      @janne said in MMM-Calender:

      I would be a bit more easy to look at if I could insert a flag or cake for a birthday etc…

      You can do this by using different font awesome icons. And choose a different color.
      I have done it like this:

      0_1551132781989_6afe1f30-d5f5-46c2-b35f-bcf5a338f1f2-image.png

      posted in Requests
      lavolp3L
      lavolp3
    • RE: How to start

      @pukacz

      1. Install the latest Raspbian WITH desktop environment (but without recommended software) on your SD card from here
      2. Fire up your RasPi 3B+, set up wifi or lan, SSH, and everything you would set up for a running Raspbian system (if you donÄt know why, you will first have to make yourself acquainted with Raspbian itself.
      3. Open the console (directly on the RasPi or via ssh) and follow installation procedure given on github
      1. Enjoy!

      Questions? Get back here :-)

      posted in Tutorials
      lavolp3L
      lavolp3
    • RE: MMM-NowPlayingOnSpotify, installed but nothing appears on MM

      @RIKKO14 Tell me Rikko what module are you using for the map and what module for the beautiful weather forecast?

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: Unable to Install Dependencies

      @alenba2 your npm and node versions are way too old.

      Update npm using:

      npm install npm@latest -g
      

      (you may need sudo access for that, I’m not sure anymore. Try without first.)

      Update node FOR EXAMPLE by using n:

      npm cache clean -f
      npm install -g n
      n stable
      

      Again, I’m not sure, try without sudo. If it’s not working try with sudo.

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: MMM-Calender

      @janne The problem here might be that you are specifically using iOS emojis. There are several issues in the web using iOS emojis with Roboto.
      I think (!) Roboto does not include the unicode conversion for every emoji.
      As you can see above, Android worked at least for the more common ones. iOS might be a problem.
      Maybe this emoji font family on github can help but I’m not sure how it could be implemented on a mirror.

      posted in Requests
      lavolp3L
      lavolp3
    • RE: ipWhitelist HowTo

      @openPhiL
      Well, suggest a better solution then. Maybe in a more constructive way.
      Or just go ahead find something else.

      posted in Tutorials
      lavolp3L
      lavolp3
    • Troubleshooting MagicMirror modules

      I have started a gist with a guide on how to troubleshoot modules, directed to users that have problems after installation of a module and don’t know what to do / where to look.
      I’d like to use it as a reference for troubleshooting threads.

      This is still a work in progress and not fully complete.
      Any contribution is HIGHLY appreciated.

      Find the source here
      https://gist.github.com/lavolp3/db7de8c0664ba95e8b9247ba685095fe

      This documentation describes the workflow to debug Magic Mirror modules. It is to the most part valid for any Magic Mirror module out there but especially directed to my modules and their debugging function.

      1 - HELP!

      Well, help is on the way. Let’s get started!
      There are two main issues that you’ll face:

      1.1 - The mirror won’t show

      The two main reasons are:

      • config.js is probably not interpretable anymore. Check out debugging config.js
      • the DOM (document object model, which is the sum of objects in the HTML document created by the code) could not be created due to syntax errors. Check out debugging main.js

      1.2 - My module won’t show / won’t show complete / shows unexpected behaviour

      There probably is a syntax error in your module. Check out debugging main.js

      1.3 - My module won’t update

      You may have a problem at the server side, probably in the node_helper. Check out debugging node_helper

      1.4 - My module shows up but looks weired

      There are many possible reasons for that but it’s worthwile to have a look at css. Check out debugging css

      2 - Bug hunt

      This describes the debugging workflow. You can do this workflow from start to finish to check for all obvious issues or check specific parts coming from part 1 above.

      2.1 - Activate debug function

      This is valid for my modules oand some others, but not nearly all. THe config options for my modules generally include a debug function. Set it to true to receive much more debugging output.

      debug: true
      

      2.2 - Debugging node_helper

      The server side of the mirror works in the background, usually you can’t directly see the errors the modules create here.

      2.2.1 - pm2 logs

      If you have pm2 installed it is possible to check for errors in a running system using the command

      pm2 logs
      

      You can add the flag --lines xx to include more lines.

      pm2 will throw out a tail of the last logs in three different categories: pm2 system logs, error logs, and info logs. You’re especally interested in the error logs (usually red), so have a look there for anything related to your module.

      2.2.2 - npm dev mode

      A more general way is to use the included npm dev mode.

      pm2 stop all
      npm start dev
      

      It is important to stop all instances of the mirror before starting here, otherwise the dev mode won’t work because the port (usually 8080) is blocked by the other instance.
      Above command will throw out all messages from the server side that are sent to the console and that you usually wouldn’t see.
      Here you can have a look if your module creates an error.
      If you want to post an issue to the forum or to github, it’s best to attach an output of this.
      You can stop the dev mode with ctrl+c.
      Then start pm2 again using the command pm2 restart mm or however the alias of your MM instance ins named.

      2.3 - Debugging main.js

      2.3.1 - Using the browser to debug front-end

      To debug the front-end side (anything that is in your main.js) you can use your browser on the laptop or computer. It is advised to use Chrome or Firefox.

      Open your browser and type into the address field

      http://magicmirror:8080
      

      Here you obviously need to use another host name (instead of magicmirror) if you have changed it. You will know whether you have. The general host name is magicmirror. You may have also changed the port in config.js. Use the one you chose.

      If you have a running system (via pm2, or one of the node commands node serveronly, npm start dev etc), your browser will build up the mirror frontend. Now press F12 (or ctrl+i) and you will see the so-called developer’s tools.
      Here you can choose between the console output, the DOM elements, debugging functions and possibly styling functions.
      For now you are looking for the ‘console’ part. Here you will find an output of messages, together with the .js file they are originating from. Found anything in red color? That will probably need to be fixed. Copy it and paste it together with your issue on github or on the forum.

      2.4 - Debugging config.js

      The config.js file is a challenge for new users. It is javascript code and gets included into the MM framework in runtime, meaning it needs to be free of any syntax errors.
      That is quite a challenge, especially if you’re using the console or simple text editors to edit config.js.
      Fortunately there is an easy-to-understand implemented config check (a so-called js linter).
      Run this in the Magic Mirror folder

      npm run config:check
      

      It will create an output showing all syntax errors.
      Move into the respective line in the config.js and find the error. If you use nano as editor for your console, don’t forget the -c flag which includes line numbers

      nano -c config/config.js
      

      Here is an example for a common output of the check:

      > magicmirror@2.10.1 config:check /home/pi/MagicMirror
      > node tests/configs/check_config.js
      
      Checking file...  /home/pi/MagicMirror/config/config.js
      Line 47 col 5 Expected ']' to match '[' from line 29 and instead saw '{'.
      Line 48 col 9 Expected '}' to match '{' from line 12 and instead saw 'disabled'.
      Line 48 col 17 Missing semicolon.
      

      Quite a big output for a missing comma.
      Try to read and work on the errors one by one. All errors may result from one source, like it does here.
      The only I did was missing a comma in line 46.

          {
              //disabled: true,
              module: "MMM-NavigationBar",
              position: "bottom_bar",
              config: {
              }
          }               <-- HERE the comma is missing!!!
          {
      

      So why the output?
      The linter reads config.js as a file containing javascript code. It starts with var config = { setting up the config as an object. Then, after declaration of some general config variables there is an array called modules:

      modules: [
          {
              module: "alert",
          },
          {
              module: "updatenotification",
              position: "top_bar"
          },
      ...
      

      The array consists of the module entries, each being an object (note the { and }, around every entry). Array items MUST be separated by comma, so every module entry needs to be closed with a },.
      When this comma is missing, the linter thinks the array is finished, expecting the ] that closes an array (in this case the modules-array).
      That is the reason for the first error message above:

      Line 47 col 5 Expected ']' to match '[' from line 29 and instead saw '{'.
      

      All further error messages are logical derivatives of this, and will vanish as soon as you add the comma.

      > magicmirror@2.10.1 config:check /home/pi/MagicMirror
      > node tests/configs/check_config.js
      
      Checking file...  /home/pi/MagicMirror/config/config.js
      Your configuration file doesn't contain syntax errors :)
      

      So again, check and clear out the errors one by one. If you don’t know what to do, post the error message and the respective line on the forum.

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 12
    • 13
    • 6 / 13