bastilimbach / docker-MagicMirror

Docker image for the Magic Mirror 2 project by Michael Teeuw.
https://hub.docker.com/r/bastilimbach/docker-magicmirror/
MIT License
185 stars 54 forks source link

cannot access magicmirror as a client on raspberry pi from terminal #20

Closed bachoo786 closed 5 years ago

bachoo786 commented 5 years ago

hi so everything is working fine and I can access magicmirror if I go to the web browser of my raspberry pi hit the address of the server running magic mirror.

However when I try to run it from terminal with this command i.e. pi@raspberrypi:~ $ node clientonly --address 192.168.0.27 --port 82 I get the following error:

module.js:549
    throw err;
    ^

Error: Cannot find module '/home/pi/clientonly'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

can you please help @bastilimbach ?

thanks.

bastilimbach commented 5 years ago

Correct me, if I'm wrong: You started a Docker container with the image docker-MagicMirror on your server, which you can access via the Browser, right?

Now you try to start the client side on a separate computer, in your case a Raspberry Pi, correct? To do that you need clone the MagicMirror project on the client computer and execute node clientside inside the cloned folder. This error simply tells you, that clientside isn't installed.

bachoo786 commented 5 years ago

thats correct.

I have already got mm running on my raspberry and I have just stopped it using pm2 stop mm. So I tried to run clientmode in the MagicMirror directory and I get this.

pi@raspberrypi:~/MagicMirror $ node clientonly --address 192.168.0.60 --port 82
Client:
(electron:17868): Gtk-WARNING **: cannot open display:
There something wrong. The clientonly is not running code 1

Also can you tell me one thing, is it ok if I just run the client mode from raspberry pi's web browser? so just got to 192.168.0.60:82 on my raspberry pi browser and run from there? will it cause any issues? I noticed if I add module or do any changes to the config then I have to refresh the page as the updates that I made wont show.

bastilimbach commented 5 years ago

Running inside a normal browser window is totally fine. You just need to refresh the page if you make changes to the config or add modules.

bastilimbach commented 5 years ago

cannot open display is a pretty generic error. This is unrelated to docker-MagicMirror or MagicMirror. Try searching for the (electron:17868): Gtk-WARNING **: cannot open display: error in Google.

bachoo786 commented 5 years ago

ok thanks

how do I restart magic mirror if I am running in docker? when running in docker it doesnt come with pm2?

bastilimbach commented 5 years ago

docker restart <container_name>

bachoo786 commented 5 years ago

thanks