OscarVanL / MagicMirror-Toggle

GPIO control for Magic Mirror TV
1 stars 1 forks source link

Use with MagicMirror config.js? #1

Open Burner911 opened 7 years ago

Burner911 commented 7 years ago

Thank you so much for this! I was hoping to implement the same thing, however I can not get the module to work correctly. I assume I need to add:

{ module: 'MagicMirror-Toggle', },

To the MagicMirror config.js file to use it correctly? When I do this the MagicMirror interface does not load. Also does os.system("gpio write 2 1") write on physical pin 4 of the Raspberry Pi?

Thank you for your help!

OscarVanL commented 7 years ago

Sorry the details are a bit fuzzy in my mind but I'll respond as best I can.

This was a really hacky attempt of mine, it's not added to the MagicMirror modules at all, it runs independently on the Pi in the background from boot. You experienced the interface not loading because this isn't supposed to work with it.

You can see the etc/init.d/runPing.sh, all this does is execute the actual mirrorManagement.py program. I set runPing.sh to run at boot time, and this in turn runs mirrorManagement.py

I created this for my Rpi model B. As you probably understand, the system reference to GPIO pins is not the same as their physical location. As per the GPIO pins on this website http://pinout.xyz/ you can work out what you need to change "gpio write X 1" and "gpio write X 0" to. One end of the circuit must be in a 3.3V GPIO pin though.

I hope that's been helpful, sorry I don't run my Magic Mirror anymore so can't be of more help.

Burner911 commented 7 years ago

Thank you so much for your response! I wasn't sure if you were still actively using the module or not. I should take another look. In the meantime I scheduled a script to briefly power a GPIO pin on and off using cron. It is not as nice as being able to trigger with Wi-Fi, but at least it's off when I'm at work.