Read the statement by Michael Teeuw here.
How to communicate with magic mirror from a second raspberry pi?
-
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.
-
@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 -
@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
-
@raspberrypi9 see here
https://github.com/sdetweil/MMM-Gesturesbranch 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 alwaysthe 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) -
@raspberrypi9 i deleted the duplicate topic