Read the statement by Michael Teeuw here.
Problem server client configuration
-
Hi all
I have a MM on my Ubuntu server and it seems to work fine, i can watch on 192.168.x.x:8080 on my browser.
Now the question is…the only way to watch the mirror on a Raspberry pi3 client is by chromium or there is a way with electron ?
I tried to change my mm.sh with: node clientonly --address 192.168.2.100 --port 8080 but I got error:pi@raspberrypi:~/MagicMirror $ node clientonly --address 192.168.2.100 --port 8080
Client:
(electron:1213): Gtk-WARNING **: cannot open display:
There something wrong. The clientonly is not running code 1Some help to solve ?
-
@akkor Are you trying to start the MagicMirror via an
SSH
connection?You can’t start an MagicMirror instance via
SSH
: https://github.com/MichMich/MagicMirror#installation -
-
@akkor Ok, check the log with the following command:
pm2 log mm
On the top you will see the last 15 lines of the error log.
-
This post is deleted! -
@idoodler
This is the answerpi@raspberrypi:~ $ pm2 log mm [TAILING] Tailing last 15 lines for [mm] process (change the value with --lines option) /home/pi/.pm2/logs/mm-error.log last 15 lines: 0|mm | (electron:2017): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2027): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2037): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2047): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2057): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2067): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2077): Gtk-WARNING **: cannot open display: 0|mm | Client: 0|mm | (electron:2093): Gtk-WARNING **: cannot open display:
-
Pls help I cannot find any solution
-
if you are trying to start over an ssh session, you need to add this before the node clientonly
if [ -z “$DISPLAY” ]; then #If not set DISPLAY is SSH remote or tty
export DISPLAY=:0 # Set by default display
fi -
@akkor - Ugh. Why would you want to use Electron if you didn’t have to? There’s already a web browser on your Pi. Just point it at the MM server and be done with it.
I’ve learned that you can get Chromium to start in kiosk mode at a particular URL with about an hour of research and testing. Minimal swearing was involved.
-
@bhepler Electron is already a premade solution that works great. However using Chromium in Kiosk mode is also a nice and easy solution. And it may solve the issue here.
@Akkor How to open Chromium in kioksmode on startup: https://raspberrypi.stackexchange.com/questions/40631/setting-up-a-kiosk-with-chromium