Read the statement by Michael Teeuw here.
How I got my Magic Mirror working on a Raspberry Pi 0 (zero)
-
@Wieber Not to bother you much more but i still have one more question. When i try to access the MM like you said to change the config file i get an error.
pi@raspberrypi:~ $ /MagicMirror/Config/config.js.sample
-bash: /MagicMirror/Config/config.js.sample: No such file or directoryany idea?
-
@SebTota Uuhm, can’t check right now, but if I recall correctly the directory is /home/MagicMirror/Config/config.js.sample . It’s probably due to an error I made somewhere along the line (not installing in the preferred directory)
-
@Wieber I have a feeling that there was a problem installing MagicMirror because my SSH disconnected but I just continued through the steps. Do you think it would help to just run the command again to install the program or is there a way to update it and it would find if there are any files missing?
-
@SebTota Well I think there isn’t really anything wrong with your Mirror, since it shows the default page for when the Config.js is missing.
What you could do is search for the ‘config.js.sample’ file with the following command:
find -name “config.js.sample”
I haven’t used this command myself, but more info on it is found here: https://www.digitalocean.com/community/tutorials/how-to-use-find-and-locate-to-search-for-files-on-a-linux-vpsEdit: a loss in SSH connection doesn’t necessarily means that your Pi messed anything up, just like your PC can still run when your monitor disconnects. Although a connection loss could have a lot of reasons that would also mess up the Pi ofc ;)
-
This post is deleted! -
This post is deleted! -
This post is deleted! -
This post is deleted! -
Alright after some time I figured it out.
cd MagicMirror
cd config
sudo nano config.js
then the file should open.This is for the noobs like me who might need that.
-
@SebTota What @Wieber has forgotten to mention is that the
config.js.samplefile is the default configuration that is included with the mirror software. The mirror software itself is looking forconfig.js. So the step that is missing is to copy the sample to the end file name. Once you have it copied over, this will become the file that you use to change your mirror’s behavior.You copy the file with this command:
cp ~/MagicMirror/config/config.js.sample ~/MagicMirror/config/config.jsYou can then edit the
config.jscommand as you have already discovered:nano ~/MagicMirror/config/config.jsNano is the editor,config.jsis the file you are editing. -
Great guide!
I have a quick question though. When my pi zero boots, it boots into a command line where i can see the modules are loading. It ends with
Ready to go! Please point your browser to: http://localhost:8080 Whoops! There was an uncaught exception... { [Error: listen EADDRINUSE :::8080] code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'listen', address: '::', port: 8080 }any ideas what causes this and how it can be fixed?
-
@piziie I believe my pi had the same response but after a few seconds it boots into the browser and shoes the mirror and works fine. Is it the same with you?
-
@SebTota
unfortunately no, it remains on the terminal. When i open a browser and go to localhost:8080 it does appear to be working so i know the MM and modules load correctly.It seems to be an issue with the midori start script?
/home/pi/startMidori.sh
#!/bin/sh xset -dpms # disable DPMS (Energy Star) features. xset s off # disable screen saver xset s noblank # don’t blank the video device matchbox-window-manager & unclutter & midori -e Fullscreen -a http://localhost:8080My /home/pi/start.sh script:
#!/bin/bash cd ~/MagicMirror node serveronly & sleep 45 sudo xinit /home/pi/startMidori.shand the last line in .bashrc
/home/pi/start.shanother side note- on boot i get this error:
(EE) Fatal server error: (EE) Server is already active for display 0 If this server is no longer running, remove /tmp/.X0-lock and start again. (EE) (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. (EE) Starting MagicMirror: v2.1.0 Loading config ... Loading module helpers ... No helper found for module: alert. Initializing new module helper ... No helper found for module: clock. XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 6 requests (6 known processed) with 0 events remaining.could this be the source of the error?
-
@piziie In my experience, this means that the mirror process is already running and you’ve attempted to start it again. Are you using PM2 to manage the mirror process? Is it possible that two of your scripts are both trying to start the mirror? Have you changed any init settings to auto-boot the mirror?
-
@piziie if you want I can post my image and you can write my image to your sd
-
@bhepler pm2 doesnt appear to be installed, however i do have npm installed. Could that cause a conflict?
Any way to the sources from which start the mirror process is starting?
Also i may have created a conflict by following the OP steps as well as the steps outlined by @kobie
Also… Instead of adding start.sh to the end of .bashrc, it’s better practice to have the script run automatically on start-up. To do this: sudo mv /home/pi/start.sh /etc/init.d/startMagicMirror.sh sudo update-rc.d startMagicMirror.sh defaults 100 This moves the script to the standard location for start-up scripts and tells the system to run it after each boot.I went back and deleted the startMagicMirror.sh file, however. Does update-rc.d need to be rolled back as well?
-
@piziie That sounds right. Without tracing too closely, it sounds like your
startMagicMirror.shscripts and yourstart.shscript are both starting the mirror process. -
@bhepler after deleting startMagicMirror.sh the same problem exists
-
@piziie After you deleted the
startMagicMirror.shdid you run the update command you quoted?
sudo update-rc.d startMagicMirror.sh remove
(more information at the the update-rc man page) -
@bhepler i have run that command, same issue persists.
Could it have something to do with VNCserver?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login