It worked with the pm2 way ! thanks
In mm.sh I wrote npm run server and everything is up n runnin again .
Thanks again !
It worked with the pm2 way ! thanks
In mm.sh I wrote npm run server and everything is up n runnin again .
Thanks again !
It worked with the pm2 way ! thanks
In mm.sh I wrote npm run server and everything is up n runnin again .
Thanks again !
Thanks! I will try that, seems smooth.
@sdetweil the VM has only terminal interface I access it with ssh
oo cool script. shall i run it inside my MagicMirror directory or outside in my user directory or in my root folder ?
Hello I have setup my magicmirror (latest) as follows
Virtual machine on a dell optiplex running magicmirror serveronly
Raspberry pi running chromium-browser in kiosk pointing at VM
BUT when running npm run serveronly on VM my mm-client (raspberrrypi fetch and shows magicmirror interface from server)
then I stop npm serveronly and make a systemd script as the one in magicmirror documents.
[Unit]
Description=MagicMirror
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=sentinel
WorkingDirectory=/home/sentinel/MagicMirror/
ExecStart=/usr/bin/node /home/sentinel/MagicMirror/serveronly
[Install]
WantedBy=multi-user.target
and systemctl start and then status magicmirror.service result in following
● magicmirror.service - MagicMirror
Loaded: loaded (/etc/systemd/system/magicmirror.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2024-04-21 18:36:18 CEST; 1ms ago
Main PID: 1016038 ((node))
Tasks: 1 (limit: 8826)
Memory: 256.0K
CPU: 224us
CGroup: /system.slice/magicmirror.service
└─1016038 (node)
Apr 21 18:36:18 MagicMirrorVm systemd[1]: Started MagicMirror.
but after this action my mm-client (raspberry pi) cant connect to server anymore I get “this site cant be reached”
How do I solve this, to me it seems that mm-serveronly does not start but I’m not sure .
AH! Sorry!
Changed it now your snippet in 1st Line
And we have Success!!! Finally!!
Thanks Alot @sdetweil
I added your code snippet in 1st line after
var mpd = require('mpd'),
and output
[2020-10-24 01:56:54.490] [ERROR] WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/modules/mpd_client/node_helper.js:1
var mpd = require('mpd'),const NodeHelper = require("node_helper");
^^^^^
SyntaxError: Unexpected token const
at Module._compile (internal/modules/cjs/loader.js:722:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
at Module.load (internal/modules/cjs/loader.js:645:32)
at Function.Module._load (internal/modules/cjs/loader.js:560:12)
at Module.require (internal/modules/cjs/loader.js:685:19)
at require (internal/modules/cjs/helpers.js:16:16)
at loadModule (/home/pi/MagicMirror/js/app.js:134:17)
at loadNextModule (/home/pi/MagicMirror/js/app.js:169:5)
at /home/pi/MagicMirror/js/app.js:171:6
at Class.loaded (/home/pi/MagicMirror/js/node_helper.js:18:3)
@sdetweil said in Add JS Code to the Mirror:
mpd_client
ok then
fresh install and download after your instructions:
[[ERROR] WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: ReferenceError: NodeHelper is not defined
at Object.<anonymous> (/home/pi/MagicMirror/modules/mpd_client/node_helper.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:786:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
at Module.load (internal/modules/cjs/loader.js:645:32)
at Function.Module._load (internal/modules/cjs/loader.js:560:12)
at Module.require (internal/modules/cjs/loader.js:685:19)
at require (internal/modules/cjs/helpers.js:16:16)
at loadModule (/home/pi/MagicMirror/js/app.js:134:17)
at loadNextModule (/home/pi/MagicMirror/js/app.js:169:5)
at /home/pi/MagicMirror/js/app.js:171:6
[2020-10-24 01:33:46.979] [LOG] Loading module helpers ...
[2020-10-24 01:33:46.980] [LOG] No helper found for module: alert.
[2020-10-24 01:33:46.981] [LOG] Initializing new module helper ...
[2020-10-24 01:33:46.982] [LOG] Module helper loaded: updatenotification
[2020-10-24 01:33:46.983] [LOG] No helper found for module: clock.
[2020-10-24 01:33:46.984] [LOG] Initializing new module helper ...
[2020-10-24 01:33:46.985] [LOG] Module helper loaded: calendar
[2020-10-24 01:33:46.986] [LOG] No helper found for module: .
[2020-10-24 01:33:46.988] [LOG] No helper found for module: currentweather.
[2020-10-24 01:33:46.990] [LOG] No helper found for module: weatherforecast.
[2020-10-24 01:33:46.991] [LOG] Initializing new module helper ...
[2020-10-24 01:33:46.992] [LOG] Module helper loaded: newsfeed
[2020-10-24 01:33:46.994] [ERROR] App threw an error during load
[2020-10-24 01:33:47.003] [ERROR] ReferenceError: NodeHelper is not defined
at Object.<anonymous> (/home/pi/MagicMirror/modules/mpd_client/node_helper.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:786:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
at Module.load (internal/modules/cjs/loader.js:645:32)
at Function.Module._load (internal/modules/cjs/loader.js:560:12)
at Module.require (internal/modules/cjs/loader.js:685:19)
at require (internal/modules/cjs/helpers.js:16:16)
at loadModule (/home/pi/MagicMirror/js/app.js:134:17)
at loadNextModule (/home/pi/MagicMirror/js/app.js:169:5)
at /home/pi/MagicMirror/js/app.js:171:6
[2020-10-24 01:33:47.006] [ERROR] Whoops! There was an uncaught exception...
[2020-10-24 01:33:47.007] [ERROR] ReferenceError: NodeHelper is not defined
at Object.<anonymous> (/home/pi/MagicMirror/modules/mpd_client/node_helper.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:786:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
at Module.load (internal/modules/cjs/loader.js:645:32)
at Function.Module._load (internal/modules/cjs/loader.js:560:12)
at Module.require (internal/modules/cjs/loader.js:685:19)
at require (internal/modules/cjs/helpers.js:16:16)
at loadModule (/home/pi/MagicMirror/js/app.js:134:17)
at loadNextModule (/home/pi/MagicMirror/js/app.js:169:5)
at /home/pi/MagicMirror/js/app.js:171:6
[2020-10-24 01:33:47.014] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[2020-10-24 01:33:47.014] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
[2020-10-24 01:33:49.707] [LOG] Launching application.]
something wrong with nodehelper I believe.
Or maybe I have wrong port and IP to my mpd.
and then change folder name to mod-client ?
is it mod-client (folder) and mod_client in config.js in config array. do I also change name in mpd-client.js file?
so then i throw mpd client folder in trash and follow your
install instructions?
because I believe there have been a problem when I first installed mpd_client, I did not been clear where the npm install should been placed, if you read in mpd-client readme.md maybe you understand, english is not my first language, and my linux-fu is below first grade :)
yes and and result is
pi@raspberrypi:~/MagicMirror $ grep version package.json
"version": "2.13.0",