Good day fellow builders,
I’m building my second MagicMirror and it works for 95%.
I’m using the MMM-GroveGesture module to switch between Pages (MMM-Pages and MMM-Page indicator).
I’m having WS2801 LED’s connected. For these LED’s I wrote two Python scripts. When executing the python scripts in the RPI (4) terminal they work flawless.
However I want to activate the scripts by the gestures. So with the up gesture, switching on the LED’s, and with the down gesture, switching them off.
Reading the MMM-Grove Gesture module readme I can use three types of executions:
- shellExec: “…”,
- notificationExec: { … },
- moduleExec: { … },
Now I’m a bit lost. I tried to use the shellExec command, but it does not start my python script. If I change it to for example ‘sudo reboot now’ the execution of the gesture does work. Here is (a part) of my config file:
{
module: "MMM-GroveGestures",
position: "top_right",
config: {
autoStart: true, //When Mirror starts, recognition will start.
gestureMapFromTo: { //When your sensor is installed with rotated direction, you can calibrate with this.
"Up": "RIGHT",
"Down": "LEFT",
"Left": "UP",
"Right": "DOWN",
"Forward": "FORWARD",
"Backward": "BACKWARD",
"Clockwise": "CLOCKWISE",
"anti-clockwise": "ANTICLOCKWISE",
"wave": "WAVE"
},
defaultNotification: "GESTURE",
pythonPath: "/usr/bin/python", // your python path
defaultCommandSet: "default",
commandSet: {
"default": {
"LEFT": {
notificationExec: {
notification: "PAGE_INCREMENT",
payload: null
}
},
"RIGHT": {
notificationExec: {
notification: "PAGE_DECREMENT",
payload:null,
}
},
"UP": {
shellExec: "sudo reboot now",
},
"DOWN": {
shellExec: "python ws2801_uitschakelen.py",
}
},
},
}
},
So I’m wondering, how to start my python script with this module? Anyone can point me in the right direction? Thanks in advance.
Regards Robert