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
.
Read the statement by Michael Teeuw here.
Posts
-
RE: Nubie question... How do I kill magic mirror so that I test new settings for config.js
-
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.
-
RE: ipWhitelist HowTo
A way to tell if you need to use
"::ffff:192.168.1.120"
or just"192.168.1.120"
Runnetstat -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. -
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. -
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. -
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.
-
RE: ipWhitelist doesn't work for me
I got it to work using
"::ffff:192.168.1.1/24"
. -
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). -
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.