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.

    How to communicate with magic mirror from a second raspberry pi?

    Scheduled Pinned Locked Moved Development
    5 Posts 2 Posters 672 Views 2 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.
    • R Offline
      raspberrypi9
      last edited by

      I want to use the MMM-gestures module which requires that you connect a grove gesture sensor to the GPIO of the raspberry pi that is running your magic mirror. That raspberry pi is attached to a frame that is mounted to my bathroom wall and is totally not easily accessible. So instead I would like to connect the grove gesture sensor to the gpio of a second raspberry pi that will talk over the WiFi network to the pi that runs my mirror. What is the best way to make this pi to magic
      Mirror connection happen?

      Thanks so much for your help.

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @raspberrypi9
        last edited by

        @raspberrypi9 you will have to use something like socket io between the two systems

        node_helper on the MagicMirror side, maybe some node app on the other (sensor)

        if you used a second MagicMirror on the sensor machine you could do an logical send notification to the mirror node_helper
        at the point it senses and the mirror would forward that on to the module side

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @sdetweil
          last edited by

          @raspberrypi9 the MagicMirror socketNotifications use socketio under the covers

          so at the sensor side you can send the same data the sendSocketNotification would have sent up to the module to the mirror side which can forward it up to the module

          pretty small mods on each side, all in the node helper

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @sdetweil
            last edited by sdetweil

            @raspberrypi9 see here
            https://github.com/sdetweil/MMM-Gestures

            branch withremote

            config parms

            role : "none"(default, normal execution)| "server"| "remote"
            in role=remote (with sensor)
            server=url   in your wall, server: "http://mirror:port"
            

            I also lifted the commands for monitor off/on to config

            	power_on_command: 'vcgencmd display_power 1',
            	power_off_command: 'vcgencmd display_power 0'
            

            that way you can config them

            so the remote listens for the arduino like always, but sends the data to the server side
            the server side sendSocketNotification to the module like always

            the server side does NOT attempt to contact arduino

            tested with local fixed list of gesture commands, two instances,
            one server
            one remote
            hard coded to set in node_helper test_local:true (defaults to false)

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @sdetweil
              last edited by

              @raspberrypi9 i deleted the duplicate topic

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • 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