balassy / MMM-ModuleToggleButton

MagicMirror module that allows displaying and hiding modules when a hardware button is pushed.
MIT License
6 stars 3 forks source link

NOT AN ISSUE: Help request getting started #7

Open awwbaker opened 2 months ago

awwbaker commented 2 months ago

Dear Mr balassy I am a recent Magic Mirror builder. I am hoping to use your module to hide some other modules using a pushbutton. I initially wired a pushbutton as described in the readme. When I start the mirror the designated modules are hidden but a button press does NOT reveal the hidden modules.

When I started I found a simple PY script to test the button wiring and that worked. Using your modules I could not get it to work. After some reading I found I might need to use a resistor for my button. Using this url "https://www.electronicshub.org/raspberry-pi-push-button-interface/" I modified my pushbutton with a "input Pull-Low" resister as described in the article.

Before pulling apart my switch and re-building to Input Pull - High do you have any thoughts. Thank you in advance for your thoughts if you have time

Kindest regards, Anthony Baker

balassy commented 1 month ago

Hello @awwbaker,

Thanks for using this module!

It was a looong time ago when I created this module and set up my MagicMirror, so unfortunately I do not remember everything just thinking out loud here.

I checked my setup and I have not used a resistor, just connected the button to GPIO 6.

It can also happen that the API of MagicMirror has changed significantly in the past 6 years so the code actually fails. If you are familiar with debugging JavaScript code in the browser you can set a breakpoint to the socketNotificationReceived method then follow the code to see if the event is activated and the target modules are found. Maybe this can help to identify whether it is a hardware or software issue.

I know this is not a huge help, but I have no other idea.