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.

    Magic mirror serving multiple clients

    Scheduled Pinned Locked Moved General Discussion
    14 Posts 7 Posters 11.3k Views 7 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.
    • Z Offline
      zack949
      last edited by

      Hello,

      I have a server running a Debian virtual machine that I am currently running in server only mode. I have 3 devices connecting to this through the browser, but obviously it would be nice to have different displays on each mirror. How can I configure the server to serve multiple configurations, presumably a different port for each instance. I need some help configuring the client to have at least 3 different connections open for my various clients. Is this possible, has anyone had experience with this before?

      N 1 Reply Last reply Reply Quote 1
      • N Offline
        ninjabreadman @zack949
        last edited by

        @zack949 I think you’ll need to run three separate instances, but should be straightforward. You’ll want three installs (e.g. ~/MagicMirror1, ~/MagicMirror2, etc.). Suggest you install/build MM, then just copy the directory twice with all the dependencies. You’ll need to set each up on its own port to avoid collisions.

        Interesting idea to permit multiple server instances from a single install, but I think it would become confusing for many. The single server/client does satisfy the vast majority of use cases atm.

        Problem with config or JavaScript? Copy/paste it into JSHint.
        Check out the detailed walkthroughs on install, config, modules, etc.

        1 Reply Last reply Reply Quote 0
        • Z Offline
          zack949
          last edited by

          I will look into that, is there a place where I can find a list of available commands for server controls. For example how do I stop the server once I start it? I do not have much in the way of experience for this and would appreciate any help you can give me.

          1 Reply Last reply Reply Quote 0
          • P Offline
            pinsdorf Module Developer
            last edited by

            @zack949, could you report back after you got it solved? I think this is an interesting use case, which might be relevant for more people.

            If you start your mirror with pm2 as suggested in documentation, then you can use commands like pm2 stop mm, pm2 restart mm, pm2 start mm to control your mirror.

            I would make three different start scripts, e.g. mm1.sh, mm2.sh, and mm3.sh, where each one starts one specific instance. This is in line with @ninjabreadman’s suggestion to have three install directories.

            1 Reply Last reply Reply Quote 1
            • Z Offline
              zack949
              last edited by

              What @ninjabreadman suggested worked wonderfully and could act as a long term solution. A gui could make the whole process of managing instances easier.

              N 1 Reply Last reply Reply Quote 0
              • N Offline
                ninjabreadman @zack949
                last edited by

                @zack949 I suggest you register mm1.sh, mm2.sh and mm3.sh with pm2 (per manual install guide). I would then also create a mm-start.sh that runs pm2 start mm1 && pm2 start mm2 && pm2 start mm3 and likewise for stop. You might even create an mm.sh that just sends the following command (e.g. mm.sh start) for all three MM instances managed by pm2, but that will require some bash scripting.

                Problem with config or JavaScript? Copy/paste it into JSHint.
                Check out the detailed walkthroughs on install, config, modules, etc.

                1 Reply Last reply Reply Quote 0
                • Z Offline
                  zack949
                  last edited by

                  Is there currently any development to make a GUI for better visualizing config.js changes?

                  N 1 Reply Last reply Reply Quote 0
                  • N Offline
                    ninjabreadman @zack949
                    last edited by

                    @zack949 Not of which I’m aware. Most dev effort is spent on the display/features end. It would also have to track the config options for dozens of regularly changing modules, which presents its own challenges.

                    I recommend using a syntax-highlighting code editor, like (the free) Atom. It will help with closing brackets/braces, and using the proper quotes. You can also run “Atom Beautify” in “Packages” regularly to keep formatting for legibility.

                    Problem with config or JavaScript? Copy/paste it into JSHint.
                    Check out the detailed walkthroughs on install, config, modules, etc.

                    1 Reply Last reply Reply Quote 1
                    • cowboysdudeC Offline
                      cowboysdude Module Developer
                      last edited by

                      @strawberry 3.141 didn’t you help someone accomplish this? I would LOVE to do this so my big mirror and bathroom mirror are both running the same thing… ;)

                      strawberry 3.141S 1 Reply Last reply Reply Quote 0
                      • strawberry 3.141S Offline
                        strawberry 3.141 Project Sponsor Module Developer @cowboysdude
                        last edited by

                        @cowboysdude take a look at https://github.com/fewieden/MMM-syslog-slave thats the only thing were I connected multiple instances

                        Please create a github issue if you need help, so I can keep track

                        cowboysdudeC 1 Reply Last reply Reply Quote 1
                        • E Offline
                          E3V3A
                          last edited by

                          This sound cool. But your need depends on how you want to interact with multiple instaces.

                          • One master MM with multiple non-interactive slaves:
                            • Just open browser on new device and point to master MM IP, and expand to full-screen
                          • One master MM with multiple, one-at-the-time interactive slaves:
                            1. Need some hardware hacking: try to find a way to connect several PIR, microphone to multiple monitors, could be over cable, wifi or bluetooth. (Seem hard and ugly to implement)
                            2. Implement some kind of HDMI switching mechanism
                          • One master MM with multiple, all-independent interactive slaves:
                            • Do what’s described above with using mm1,mm2,mm3,.... This surely would eventually overload a RPi, as you add different and concurrent modules.

                          "Everything I do (here) is for free – altruism is the way!"
                          MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

                          1 Reply Last reply Reply Quote 0
                          • cowboysdudeC Offline
                            cowboysdude Module Developer @strawberry 3.141
                            last edited by

                            @strawberry-3.141 Thank you! @zack949 there’s a way to run one as master and others as slave… look at the response from strawberry :)

                            serge cherpyS 1 Reply Last reply Reply Quote 0
                            • serge cherpyS Offline
                              serge cherpy @cowboysdude
                              last edited by

                              @cowboysdude

                              Bonjour avec mon Français je voudrait savoir si vous avez réussi a conclure le multiple clients sur un pi, peut on échanger des informations pour que je reproduise le mème serveur sur deux poste client Merci Serge

                              cowboysdudeC 1 Reply Last reply Reply Quote 0
                              • cowboysdudeC Offline
                                cowboysdude Module Developer @serge cherpy
                                last edited by

                                @serge-cherpy the only way to do this would be to set up a pi as a master and the rest as slaves…ie

                                one pi running your main mirror at [for example] 192.168.1.2:8080 [master]
                                Then running another pi and opening up a browser to 192.168.1.2:8080 [slave]

                                Is one way to do it. I don’t do it that way because all my mirrors do different things and have different purposes.

                                Bathroom mirror is an actual mirror
                                alarm clock mirror is a 10" touch panel that functions as an alarm clock
                                32" inch mirror is a home automation mirror

                                But the above method master->slave would work providing you have them all on the same network… if you wanted to run master on one network and the slave on another that would take more work :)

                                1 Reply Last reply Reply Quote 0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                • 1 / 1
                                • 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