Read the statement by Michael Teeuw here.
MMM-Remote-Control
-
Hi @vtek, glad you figured it out! Just for reference: when
secureEndpoints: trueis set, the API key can be passed in two ways:- URL parameter:
?apiKey=YOUR_KEY - HTTP header:
Authorization: apiKey YOUR_KEY
Also, starting with v4.2.4 the error message now directly hints at the solution, so the next person running into this should find it faster 🙂
- URL parameter:
-
Hi @rkorell, thank you for the detailed bug report — the root cause analysis was spot on and made it straightforward to fix!
The fix is included in v4.2.4: when MMM-Remote-Control detects it’s running under pm2 (via
PM2_HOMEorpm_idenvironment variables), it now skipsapp.relaunch()and only callsapp.quit(), letting pm2 handle the restart cleanly.Would be great if you could confirm it works on your setup!
-
@KristjanESPERANTO Dear Kristijan,
just tested v4.2.4 — works perfectly! Restart via the Remote-Control UI now completes cleanly
under pm2, no orphaned Electron process, no port conflict. Exactly the behavior you’d expect.I also noticed you added a dedicated handleRestart.test.js with 210 lines of unit tests covering
both the pm2 and standalone code paths — that’s really impressive and goes well beyond just a
quick fix. Having proper test coverage for this kind of dual-mode behavior is exactly the right
thing to do. Much appreciated!Thanks for the incredibly fast turnaround and the quality of the fix. Consider this confirmed
working on:- MagicMirror 2.34.0
- MMM-Remote-Control 4.2.4
- Node.js v22, Electron 39.5.2
- Raspberry Pi 5, Debian 13 (Trixie)
- pm2 with file-watch
Warmest regards,
Ralf -
@rkorell Thank you very much for this feedback and appreciation 🙂 It’s interesting that you took a deeper look at the changes.
-
This post is deleted!
