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

    Posts

    Recent Best Controversial
    • Javascript Timing Events

      Gals/Guys,

      I don’t know if anyone else has been experiencing the same weird things that seem to be happening to a couple of my modules.
      In 2 modules, that used to work with no issue, they stopped updating. I checked them and one used setTimeout() while the other used setInterval() to refresh the data. These modules have been working for some time and all of a sudden they stopped. I reset my pi to see if that’d help, no luck. I apt-get update and rpi-update to see if that’d help. Didn’t help my issue. I’m running the latest non-develop build of MM.
      I tried some troubleshooting by using setInterval() with a 5 minute delay.
      I just had one of the faulty modules in my config.js so nothing else would mess with it.
      I had a counter that updated every time the function was supposed to run. It ran the first time, and never again. So I switched to setTimeout() with the same delay and counter. It runs 5-270 times randomly(random to me at least).
      I have a bunch of console.log()'s in my code to see if any part fails. Those never get triggered.

      So in summary, 2 of my 10 or so modules have started acting erratically with their timing events. SetInterval() stopped working for me all together, and setTimeout() stops updating at random times. The other modules I use all update fine with setTimeout().

      If anyone has seen this before and knows how to fix it, I’d be greatly appreciative. Thanks!

      P.S. I see the same freezes using MagicMirror’s built in browser as well as Chrome and Firefox from a separate computer.

      posted in Troubleshooting
      M
      mochman
    • RE: MMM-Swipe: deprecated WARNINGS plus ERROR

      Thomas,

      I haven’t developed it since I first made it so I’m not sure if it still works with all the updates the pi & MM have gotten. Sorry.

      If you want to still try and get it to work, yes you do need 2 sensors to detect movement between them. You also need to run the MagicMirror with sudo to allow permissions to the GPIO pins in MagicMirror.

      posted in Troubleshooting
      M
      mochman
    • RE: ipWhitelist HowTo

      @AAPS If /24 is working for you then stick with it. The /120 just allows less IPs the ability to access your mirror.

      If you aren’t forwarding your pi’s ports outside your local network it really shouldn’t matter.

      posted in Tutorials
      M
      mochman
    • RE: Calendar config

      @JbeesonMagic16 Yeah, @in_a_days recommendation fixes the problems in the jshint. Hopefully that works for you.

      posted in Troubleshooting
      M
      mochman
    • RE: Calendar config

      @JbeesonMagic16 No, it’s a general javascript problem finder. If you paste your config.js file in it’s entirety into http://jshint.com/. You should see it say “One undefined variable”. If you see

      Expected '}' to match '{' from line XXX and instead saw ']'
      

      You are missing a bracket. Look at line XXX and then follow the code down to see where the missing bracket is.

      posted in Troubleshooting
      M
      mochman
    • RE: Calendar config

      Try putting your config.js in a website like http://jshint.com/. It should help you find any brackets you might be missing.

      posted in Troubleshooting
      M
      mochman
    • RE: MMM-Nest

      @fox I don’t have a camera so I’m not too sure how to program for it. The API does allow you to get data from the camera as well as take snapshots. The API also gives you the video URL which I imagine you can use to get video on the mirror.

      posted in Utilities
      M
      mochman
    • RE: MMM-Swipe - Hand gestures

      @Snille Yeah, this module requires root access. I haven’t developed it since I first made it so I’m not sure if it still works with all the updates the pi & MM have gotten. Sorry.

      posted in Troubleshooting
      M
      mochman
    • RE: Magic Mirror With Amazon Alexa

      I’m not sure about MMM-Alexa, but MMM-AlexaPi needs AlexaPi installed and configured correctly to work.

      posted in Requests
      M
      mochman
    • RE: Trying to write my own Module...

      You should just need to put

      var row = document.createElement("tr");
      var header = document.createElement("th");
      var header2 = document.createElement("th");
      header.innerHTML = "Load";
      row.appendChild(header);
      header2.innerHTML = "KWh";
      row.appendChild(header2);
      table.appendChild(row);
      

      before

      var channels = this.xml.getElementsByTagName("channel");
      

      You can add a title by modifying your config.js file to add a header.
      The documentation for that is here.

      posted in Development
      M
      mochman
    • RE: Nubie question... How do I kill magic mirror so that I test new settings for config.js

      Right, the nohup command removes the process from the terminal window. If you shut down the terminal, it’ll also shut down your magic mirror without the nohup command before npm.

      posted in Troubleshooting
      M
      mochman
    • RE: Nubie question... How do I kill magic mirror so that I test new settings for config.js

      If you’re using pm2 then SSH in and run
      pm2 stop mm

      If you’re using the nohup command to run it, you’ll have to find the PID by running
      ps aux | grep npm
      You should see something like
      pi 26292 38.3 4.3 122360 38428 pts/0 Sl 19:17 0:03 npm
      pi 26318 0.0 0.2 4276 1952 pts/0 S+ 19:18 0:00 grep --color=auto npm

      use the first number you see in the line that just has “npm” (in this example it’s 26292)

      then run
      kill 26292 (using your PID number)

      I recommend setting up pm2. It makes it much easier.

      posted in Troubleshooting
      M
      mochman
    • RE: Can't access mirror from external source - IPwhitelist doesnt work

      Or this guide.

      posted in Troubleshooting
      M
      mochman
    • RE: ipWhitelist HowTo

      A way to tell if you need to use "::ffff:192.168.1.120" or just "192.168.1.120"
      Run netstat -lnpt, if you see something like:

      tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1271/electron.js

      Then you are using IPv4 and should add "YO.UR.IP.AD" or "YO.UR.IP.AD/24" to the whitelist.

      If you see: tcp6 0 0 :::8080 :::* LISTEN 1170/electron.js

      You are using IPv6 address schemas and need to add "::ffff:YO.UR.IP.AD" or "::ffff:YO.UR.IP.AD/120" to the whitelist.


      If you have IPv6 and want to turn it off, add ipv6.disable=1 to your /boot/cmdline.txt and restart your pi.

      posted in Tutorials
      M
      mochman
    • RE: ipWhitelist HowTo

      @looolz When you run the mirror through VNC. If you leave the terminal open then try to open the mirror on your other computer, do you see the

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

      message? If so, does anything pop up in your terminal?

      Another thing to look at, if you run ifconfig and take a look at your wlan0 (assuming you are using wifi to get internet) do you see a “inet6 addr:”? If not, just try adding "10.0.0.95" to the whitelist.

      posted in Tutorials
      M
      mochman
    • ipWhitelist HowTo

      Since a couple people are having issues with the ipWhitelist (me included), I’m putting this up to help people use the whitelist correctly.

      For starters, the easiest way to whitelist your IP is to start up Magic Mirror with the default settings. Try opening it up remotely from the computer you want to grant access to. You’ll probably see an error that says:

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

      Now you need to check your MagicMirror logs.

      • If you are VPN’d into (or running directly on your pi), take a look at the terminal output.
      • If you are running MagicMirror using SSH and DISPLAY=:0 nohup npm start & to start your mirror, take a look at your nohup.out file (tail -f ~/MagicMirror/nohup.out) to see the output.
      • If you are using pm2, run tail -f ~/.pm2/logs/mm-out-0.log

      You should see an error in there stating something like

      Access denied to IP address: ::ffff:192.168.1.120

      Change/Add your ipWhitelist in your config.js.
      If you upgraded to MM 2.1.0 you’ll probably need to add the line
      ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.120"], to your file, otherwise just add the IP that was denied to the list.


      If you want to give all of your network IPs access to your MagicMirror
      You’ll have to use IPv6 CIDR.
      For example, you have a couple devices with the IPs of 192.168.1.120, 192.168.1.155, 192.168.1.230 and you want to give them all access (along with everything else in the 192.168.1.X range), you should put "::ffff:192.168.1.1/120" in your ipWhitelist.
      If you want to allow 192.168.0.0 - 192.168.255.255 access, you should use "::fff:192.168.1.1/112"


      Restart MagicMirror to update your changes


      The reason why “/24” works
      A couple different threads state to add /24 to the end of the IP address. (I’ve put a couple of those up before doing some research too). While this will indeed allow your network devices access to your magic mirror, it will also allow any device with an IPv4 based address access to your mirror (obviously your router would need to be configured to allow this).
      This “/24” in IPv6 CIDR allows 20,282,409,603,651,670,423,947,251,286,016 different IP addresses access. (IPv4’s total addresses are 4,294,967,296).


      More information
      If you’d like to learn more or have different sub-netting needs, I found this page useful.

      posted in Tutorials
      M
      mochman
    • RE: ipWhitelist doesn't work for me

      @DazDavid Yeah, I messed up with the CIDR notation for IPv6. The reason why “/24” works is because that gives you practically every IP (especially every IP4 address). If you want to just have 192.168.X.0 - 192.168.X.255 whitelisted, you should use "::ffff:192.168.X.1/120".

      I added a HOWTO guide here to help out everyone.

      posted in Bug Hunt
      M
      mochman
    • RE: ipWhitelist doesn't work for me

      I got it to work using "::ffff:192.168.1.1/24".

      posted in Bug Hunt
      M
      mochman
    • RE: MMM-Admin-Interface

      You might also have to add "::ffff:192.168.X.Y" as well. You could also just add "192.168.X.1/24 , ::ffff:192.168.X.1/24" to whitelist all of the IPs in your network (assuming you are using 192.168.X.1-254).

      posted in System
      M
      mochman
    • RE: Trying to write my own Module...

      You’re going to have to modify the code to get that info. Take a look here for info on how it’s done.

      posted in Development
      M
      mochman
    • 1 / 1