Read the statement by Michael Teeuw here.
Button
-
Okay thanks, the script now starting as user pi.
Other question, has my button.py script to run in a loop?EDIT: Okay the message “button pressed” are coming when I turn the floor lights on 0o?
-
- Take out that
'GPIO.cleanup()'
call that you have. That resets everything you just did above it. - Button getting triggered because you turning on the floor (?) lights is because that button is still floating, see #1 above.
- I’m assuming the rpi isn’t on the same circuit as the floor (??) lights, a voltage difference could also falsely trigger the button.
- Take out that
-
Yes it seems it is on the same circuit. The button is pressed when the light goes on and when the light goes off… :D unbelievable
-
So your rpi is then experiencing a dip in voltage, which is coming from whatever you have it connected to, I presume a wall adapter. What’s the output of that adapter? What’s the Amp rating on it? Is it a regulated or unregulated? The latter means with no load, it could very well be supplying ad much as 7-9V, and with a load it drops to 5V, however it also means it will dip rather low if something else comes on on the same circuit. Unfortunately there is no easy way to tell other than to measure its power output.
-
@dicker182
See my previous posting:Probably the cause is some voltage / EMI feedback, likely due to the wires and switches. Try to switch on/off some lights and electrical devices and see the result!
To correct this condition, use a combination of current limiting, filtering and shielding. ;-)Did you read the link?
https://www.raspberrypi.org/forums/viewtopic.php?t=53548Try following:
- Reduce the cable length to the switch.
- Detect either only the rising (GPIO.RISING) or falling event.
- Use bouncetime in ms (minimum time between two callbacks in milliseconds (intermediate events will be ignored))
- Use a capacitor, see folowing example.
http://raspberrypihobbyist.blogspot.ch/2014/11/debouncing-gpio-input.html
-
Hi,
after I install the module and type “pm2 restart mm” there is just a white screen. No UI loaded. Any idea? -
@All, sry for the lait answer, I followed all your guides, but I can´t solve the problem. I have to use another power circuit.
@cruunnerr, same here, you have to restart your pi. After the video starts for the first time, the bug is there. You can only reload mm when the video never starts in the same session.
-
Hi,
i tried to setup the button to watch the news with the MMM-Podcast module.
When i add the MMM-Button module to the config.js and start MM i only get an white screen.
With pm2 logs mm i get this#########################
Loading config …
mm-0 Loading module helpers …
mm-0 No helper found for module: alert.
mm-0 WARNING! Could not load config file. Starting with default configuration. Error found : Error: Module version mismatch. Expected 49, got 46.
mm-0 Loading module helpers …
mm-0 No helper found for module: alert.
mm-0 App threw an error during load
mm-0 Error: Module version mismatch. Expected 49, got 46.
mm-0 at Error (native)
mm-0 at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:167:20)
mm-0 at Object.Module._extensions…node (module.js:568:18)
mm-0 at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:167:20)
mm-0 at Module.load (module.js:458:32)
mm-0 at tryModuleLoad (module.js:417:12)
mm-0 at Function.Module._load (module.js:409:3)
mm-0 at Module.require (module.js:468:17)
mm-0 at require (internal/module.js:20:19)
mm-0 at bindings (/home/pi/MagicMirror/modules/MMM-Button/node_modules/onoff/node_modu les/epoll/node_modules/bindings/bindings.js:76:44)
mm-0 Whoops! There was an uncaught exception…
mm-0 Error: Module version mismatch. Expected 49, got 46.
mm-0 at Error (native)
mm-0 at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:167:20)
mm-0 at Object.Module._extensions…node (module.js:568:18)
mm-0 at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:167:20)
mm-0 at Module.load (module.js:458:32)
mm-0 at tryModuleLoad (module.js:417:12)
mm-0 at Function.Module._load (module.js:409:3)
mm-0 at Module.require (module.js:468:17)
mm-0 at require (internal/module.js:20:19)
mm-0 at bindings (/home/pi/MagicMirror/modules/MMM-Button/node_modules/onoff/node_modu les/epoll/node_modules/bindings/bindings.js:76:44)#############
Version mismatch from what?
Does someone know how to fix this? -
Have the Same Problem. Take a Look here and Tell me if anything helped you.
https://forum.magicmirror.builders/topic/707/mmm-button-doesn-t-work
-
Thanks for the link. I tried but the error is still there.
One thing changed.
Before:
Error: Module version mismatch. Expected 49, got 46
Now:
Error: Module version mismatch. Expected 50, got 46