Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Magic Mirror Server and Client mode documentation #186

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Changes from 15 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
70acd0c
Update installation.md
briodan Sep 15, 2023
956cc9e
Update installation.md
briodan Sep 15, 2023
f158683
Update installation.md
briodan Sep 15, 2023
68522f3
Update installation.md
briodan Sep 15, 2023
457bdf5
Update installation.md
briodan Sep 15, 2023
d6cd8c7
Update installation.md
briodan Sep 15, 2023
2502639
Update installation.md
briodan Sep 18, 2023
2445414
Update installation.md
briodan Sep 18, 2023
51810c9
Update installation.md
briodan Sep 18, 2023
0b20703
Update installation.md
briodan Sep 18, 2023
14fec29
Update installation.md
briodan Sep 18, 2023
1d92044
Update installation.md
briodan Sep 18, 2023
433214a
Merge branch 'develop' into master
rejas Oct 4, 2023
ab6f81c
Merge branch 'develop' into master
rejas Oct 13, 2023
0bc1e54
Update installation.md
briodan Oct 13, 2023
1429733
Update installation.md
briodan Oct 14, 2023
7e8f28f
weather.md: update for recent changes (#230)
crazyscot Jan 29, 2024
154a843
add updates feature configuration (#234)
bugsounet Mar 23, 2024
a78bd1f
Update calendar.md (#236)
bugsounet Mar 23, 2024
2ce3c94
updateOnFetch feature Docs (#235)
bugsounet Mar 23, 2024
4e451f8
Minor changes (#238)
KristjanESPERANTO Mar 30, 2024
43103c3
Merge branch 'mm-master' into mm-develop
rejas Apr 2, 2024
942936f
Merge branch 'mm-master' into mm-develop
rejas Jul 3, 2024
6b6eb2d
Update compliments docs page (#242)
WallysWellies Jul 3, 2024
87ff347
Cleanup formatting (#247)
rejas Jul 3, 2024
f642eb1
Merge branch 'mm-master' into mm-develop
rejas Jul 3, 2024
82004ba
Merge branch 'develop' into master
briodan Jul 8, 2024
61f70b7
UK Met Office Documentation Fix (#253)
jargordon Jul 8, 2024
89b6259
Merge branch 'master' into develop
khassel Jul 11, 2024
7f29d9b
Merge branch 'develop' into master
briodan Jul 12, 2024
98b72b3
Merge remote-tracking branch 'upstream/master'
briodan Nov 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 45 additions & 17 deletions getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ installers can be found under:

## Manual Installation

These instructions deploy a standalone version of Magic Mirror, for [Server Only](/getting-started/installation.html#server-only) and [Client Only](/getting-started/installation.html#client-only) installs please read the install specific instructions below
briodan marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rejas last time you lintered the lines to a max. length, will you do this here before/after merge?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after merge I will lint again

1. Download and install the latest _Node.js_ version, see the official documentation:
- [Linux based distributions](https://github.com/nodesource/distributions)
- [Others](https://nodejs.org/en/download)

2. Clone the repository and check out the master branch:
`git clone https://github.com/MichMich/MagicMirror`
3. Enter the repository: `cd MagicMirror/`
4. Install the application: `npm run install-mm`
5. Make a copy of the config sample file:
`cp config/config.js.sample config/config.js`
6. Start the application: `npm run start` \
For **Server Only** use: `npm run server` .
6. Start the application: `npm run start`

::: warning NOTE The installation step for `npm run install-mm` will take a very
long time, often with little or no terminal response! For the RPi3 this is
Expand Down Expand Up @@ -120,17 +120,23 @@ Note the following:

### Server Only

In some cases, you want to start the application without an actual app window.
In this case, you can start MagicMirror² in server only mode by manually running
`npm run server`. This will start the server, after which you can open the
application in your browser of choice. Detailed description below.
In some cases, you want to start the application without an actual app window. To do so after installation you can start MagicMirror² in server only mode by manually running the following command within the MagicMirror directory
`npm run server`

::: warning IMPORTANT Make sure that you whitelist the interface/ip
(`ipWhitelist`) in the server config where you want the client to connect to,
otherwise it will not be allowed to connect to the server. You also need to set
the local host `address` field to `0.0.0.0` in order for the RPi to listen on
all interfaces and not only `localhost` (default).
:::
::: warning IMPORTANT please read the information below on fully setting up MagicMirror² for running in server only mode otherwise you wont be able to connect to your MagicMirror² server from a remote device
:::

In order to run MagicMirror² in server mode you need to:
- Allow Remote Connections to MagicMirror²
- Start MagicMirror² in Server mode on boot

#### Allow Remote Connections to MagicMirror²

By default MagicMirror² does not allow other remote devices to connect, this is controlled by settings inside the `config/config.js` file by interface and ip
- change address to `0.0.0.0` this will allow MagicMirror² to listen on all network interfaces
- change `ipWhitelist` to the list of IP's you want to allow to connect

Sample Configuration below [and link to full configuration options](/configuration/introduction.html#introduction)

```javascript
let config = {
Expand All @@ -141,10 +147,32 @@ let config = {
};
```

#### Start MagicMirror² in Server mode on boot

To always start MagicMirror² in server only mode you need to edit the `installers/mm.sh` file otherwise it will start in full mode after a reboot:

1. Backup mm.sh: `cp installers/mm.sh installers/mm.sh.bak`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rejas don't know anything about this mm.sh stuff, totally irrelevant when using docker, so is this a standard setup or how should we document it here?
Found in mm.sh this line

# This file is still here to keep PM2 working on older installations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the mm.sh file is removed on develop so installers/mm.sh will not exist anymore with next release. This file will be part of sam's script repo.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, please remove the stuff about mm.sh

2. Edit mm.sh: `nano mm.sh` (you can use your favorite editor)
3. Replace
`DISPLAY=:0 npm start`
with
`DISPLAY=:0 npm server`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm server this will not work, must be npm run server

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its running for me with npm server changed it to npm run server and didn't see any difference. but i'll admit i don't fully understand how this works, just documenting what i had to do to get it working :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also say, that npm server does not work for me (or in general as far as i know). Only a few scripts work out of the box, like start and test

Maybe you got some shortcuts somewhere, but please update here to use "start"

4. Reboot

### Client Only

This is when you already have a server running remotely and want your RPi to
connect as a standalone client to this instance, to show the MM from the server.
Then from your RPi, you run it with:
`node clientonly --address 192.168.1.5 --port 8080`. (Specify the ip address and
port number of the server)
connect as a standalone client to this instance, to show theMagicMirror² from the server.
briodan marked this conversation as resolved.
Show resolved Hide resolved

You can start MagicMirror² in client mode by manually running the following command with the MagicMirror directory:
briodan marked this conversation as resolved.
Show resolved Hide resolved
`node clientonly --address 192.168.1.5 --port 8080`

To always start MagicMirror² in client mode you need to edit `installers/mm.sh` file otherwise it will start in full mode after a reboot:

1. Backup mm.sh: `cp installers/mm.sh installers/mm.sh.bak`
2. Edit mm.sh: `nano mm.sh` (you can use your favorite editor)
3. Replace
`DISPLAY=:0 npm start`
with
`DISPLAY=:0 node clientonly --address 192.168.1.5 --port 8080` (Specify the ip address and port number of the server)
4. Reboot