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

    mochman

    @mochman

    Module Developer
    71
    Reputation
    5.8k
    Profile views
    146
    Posts
    2
    Followers
    0
    Following
    Joined
    Last Online
    Age 43
    Website github.com/mochman
    Location Virginia

    mochman Unfollow Follow
    Module Developer

    Best posts made by 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
      mochmanM
      mochman
    • Mochman's first mirror

      I finally got all the parts and pieces I needed to build the mirror for my wife and me.

      Luckily I was purchasing the monitor during the Amazon Prime Day so I got it at a little discount.

      Monitor - ASUS VE278H 27" via HDMI
      Sound - Kingwin USB 3D Sound Adaptor (for Alexa)
      Button - PV6F240SS-3R1
      Mirror - 1/4" Acrylic
      Raspberry Pi 3

      ToDo’s:
      Add Swipe wiring (sensors are already installed behind speaker mesh)
      Add PIR wiring (already mounted too)

      I used the AlexaPi program with the Button/LEDs to get Alexa Voice (independent of the mirror app)

      0_1470265978175_mirror-big.jpg

      Looking up close, I wish I put some electrical tape under the edge of the monitor to try and stop it from coming through, same goes for the wood “notch” it sits on.

      posted in Show your Mirror
      mochmanM
      mochman
    • RE: Module ignoring node_helper.js?

      node_helper.js doesn’t output console.log() to the same place the MMM-HiWorld.js does. You’ll see the log pop up in the npm output. You can see the data when you run npm start on the raspberry pi. If you are using pm2 to autostart Magic Mirror, you can ssh into your pi and run
      tail -f ~/.pm2/logs/mm-out-0.log to see the console messages. You can also run tail -f ~/.pm2/logs/mm-error-0.log to see all of your node_helper.js errors.

      posted in Development
      mochmanM
      mochman
    • RE: ipWhitelist HowTo

      @open_book Just looking at your pi’s IP. It looks like it’s using 192.168.0.X and you’re whitelisting the 192.168.1.X IPs. Can you try adding

      "::ffff:192.168.0.1/120", "192.168.0.1/24"
      

      to your whitelist and see if that fixes it up?

      posted in Tutorials
      mochmanM
      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
      mochmanM
      mochman
    • RE: Can't access mirror from external source - IPwhitelist doesnt work

      Or this guide.

      posted in Troubleshooting
      mochmanM
      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
      mochmanM
      mochman
    • MMM-GPSWeather

      I made a module that pulls wunderground.com’s weather from a lat/long page/file.

      I set up my phone with Hervé Renault’s Self-Hosted_GPS-Tracker.
      Wunderground weather based off of MattLugar’s module.

      I travel a lot, so when the wife looks at the mirror, she can see the city I’m in as well as the weather there.

      0_1464203442498_module.jpg

      posted in Utilities
      mochmanM
      mochman
    • RE: Calendar config

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

      posted in Troubleshooting
      mochmanM
      mochman
    • RE: ipWhitelist HowTo

      @open_book The ipWhitelist should have no affect on your SSH ability. This sounds like there is some problem with either your network or the pi itself. The ipWhitelist just affects what can connect to the MagicMirror software.

      Can you give me your network setup and how you’re trying to access it through SSH? I’m guessing that you are trying to SSH in from inside your network and not from somewhere else.

      I haven’t used the remote control module so I’m not to sure how it works with the whitelist. From how you’re describing it, it sounds like whatever the IP of the device you use the remote control with is what the MagicMirror needs whitelisted. If that’s the case, are you just trying to access your mirror from devices on your internal network or are you using a data plan with your mobile? If so, that IP probably changes frequently.

      Those IPs you listed ("...1.1/120"), are those IPv6 or IPv4 IPs?

      posted in Tutorials
      mochmanM
      mochman

    Latest posts made by mochman

    • RE: MM Update - GIT error

      Maybe this was the issue.
      https://www.geekwire.com/2018/github-recovering-widespread-outage-caused-networking-database-issues/

      posted in Troubleshooting
      mochmanM
      mochman
    • RE: MMM-Gas

      @rob73 I haven’t tried this to see how it looks, but you may just be able to comment out a few of the lines in MMM-Gas.js
      Try commenting out the last 2 lines of this code in the getDom() function.

       var td5 = document.createElement("td");
       td5.innerHTML = dist;
       TDrow.appendChild(td5);
       weatherTable.appendChild(TDrow);
      

      It should look like this when you’re done.

      var td5 = document.createElement("td");
      td5.innerHTML = dist;
      //TDrow.appendChild(td5);
      //weatherTable.appendChild(TDrow);
      

      You should also comment out this part as well.

      var bjumpy = document.createElement("th");
      bjumpy.setAttribute("style", "text-align:center");
      bjumpy.classList.add("xsmall");
      bjumpy.innerHTML = "Distance";
      //xFCRow.appendChild(bjumpy);
      //weatherTable.appendChild(xFCRow);
      
      posted in Transport
      mochmanM
      mochman
    • RE: MMM-Gas

      @3d Hmm, the code is supposed to use that variable as an integer. What kind of error were you getting when you had items: 10,?

      Edit: Guess it doesn’t matter. Math.min() still works using a string.

      posted in Transport
      mochmanM
      mochman
    • RE: MMM-Gas

      @cowboysdude I just sent you a pull request that should fix their new page.

      posted in Transport
      mochmanM
      mochman
    • RE: Applied change to config.txt, MM fails to boot.

      I had the same issue. I changed dtoverlay=vc4-kms-v3d to dtoverlay=vc4-fkms-v3d and was able to boot up again.

      posted in Troubleshooting
      mochmanM
      mochman
    • RE: MMM-Nest

      Please use these steps. If you have any questions after that, I’ll be happy to answer.

      posted in Utilities
      mochmanM
      mochman
    • RE: ipWhitelist HowTo

      That doesn’t sound like an ipWhitelist problem. Did you install MMM-Remote-Control per the instructions? If so, what exactly are you getting your error message on and what are the IPs of your magicmirror and device?

      posted in Tutorials
      mochmanM
      mochman
    • RE: Unable to display weather description

      Glad to hear it.

      posted in Requests
      mochmanM
      mochman
    • RE: Unable to display weather description

      Well I’m glad it started mostly working. Sorry about the array of weather I was talking about earlier. I though you were using the weatherforecast module to get this info, not currentweather. The way you’re describing the issue, it sounds like the updateDOM() function is getting called before that value is set. Where in the processWeather() function did you put this.desc = data.weather[0].description;? is it before this section?

      this.show(this.config.animationSpeed, {lockString:this.identifier});
      this.loaded = true;
      this.updateDom(this.config.animationSpeed);
      this.sendNotification("CURRENTWEATHER_DATA", {data: data});
      
      posted in Requests
      mochmanM
      mochman
    • RE: Unable to display weather description

      Yeah, it does look like the module gets back an array of weather data for each day. Have you tried putting some console.log() statements in your code to try and troubleshoot where the problem is. Like

      this.desc = data.weather[0].description;
      console.log("Description Var - " + this.desc); //See if anything is output
      

      At least then you’d know if the variable is correct and your div statement isn’t working, or the variable isn’t getting set correctly.

      posted in Requests
      mochmanM
      mochman