MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Remote-Control

    Scheduled Pinned Locked Moved Utilities
    58 Posts 10 Posters 2.6k Views 9 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • KristjanESPERANTOK Offline
      KristjanESPERANTO Module Developer @vtek
      last edited by

      Hi @vtek, glad you figured it out! Just for reference: when secureEndpoints: true is set, the API key can be passed in two ways:

      1. URL parameter: ?apiKey=YOUR_KEY
      2. 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 🙂

      1 Reply Last reply Reply Quote 0
      • KristjanESPERANTOK Offline
        KristjanESPERANTO Module Developer @rkorell
        last edited by

        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_HOME or pm_id environment variables), it now skips app.relaunch() and only calls app.quit(), letting pm2 handle the restart cleanly.

        Would be great if you could confirm it works on your setup!

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          rkorell @KristjanESPERANTO
          last edited by

          @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

          KristjanESPERANTOK 1 Reply Last reply Reply Quote 1
          • KristjanESPERANTOK Offline
            KristjanESPERANTO Module Developer @rkorell
            last edited by

            @rkorell Thank you very much for this feedback and appreciation 🙂 It’s interesting that you took a deeper look at the changes.

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jakabasej4 @KristjanESPERANTO
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote -1
              • 1
              • 2
              • 3
              • 4
              • 5
              • 6
              • 2 / 6
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy