<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Buttons only work if I access via python first]]></title><description><![CDATA[<p dir="auto">I’ve had this problem for a while and I’m not sure how to fix it.<br />
I’m using MMM-Buttons to switch between scenes from MMM-Scenes and it’s working. However, it only works if I first use a little python test program I have to test the buttons. Why? I don’t even have to actually press a button, just run the python and then exit. After that, the buttons work.</p>
<p dir="auto">I thought I posted this before but can’t find it. I apologize if this is a duplicate.</p>
<p dir="auto">Python:</p>
<pre><code>import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)


while True:
    input_state25 = GPIO.input(25)
    input_state24 = GPIO.input(24)
    if input_state25 == False:
        print('Button Pressed 25')
        time.sleep(0.2)
    if input_state24 == False:
        print('Button Pressed 24')
        time.sleep(0.2)
</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/17985/buttons-only-work-if-i-access-via-python-first</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 01:54:04 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/17985.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Sep 2023 21:09:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Buttons only work if I access via python first on Thu, 05 Oct 2023 17:10:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a> see this maybe</p>
<p dir="auto"><a href="https://roboticsbackend.com/raspberry-pi-gpios-default-state/" target="_blank" rel="noopener noreferrer nofollow ugc">https://roboticsbackend.com/raspberry-pi-gpios-default-state/</a></p>
]]></description><link>https://forum.magicmirror.builders/post/111379</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/111379</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 05 Oct 2023 17:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Buttons only work if I access via python first on Thu, 05 Oct 2023 17:09:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a><br />
Sorry, I read the module but found nothing suspicious in that. The module and its dependencies look normal. ATM, I cannot guess the issue.</p>
]]></description><link>https://forum.magicmirror.builders/post/111378</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/111378</guid><dc:creator><![CDATA[MMRIZE]]></dc:creator><pubDate>Thu, 05 Oct 2023 17:09:36 GMT</pubDate></item><item><title><![CDATA[Reply to Buttons only work if I access via python first on Thu, 05 Oct 2023 15:38:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mmrize" aria-label="Profile: MMRIZE">@<bdi>MMRIZE</bdi></a> No. I still need to run my little test script to get the buttons to work. It’s not a huge deal, I just wonder why that’s the case.</p>
]]></description><link>https://forum.magicmirror.builders/post/111356</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/111356</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Thu, 05 Oct 2023 15:38:53 GMT</pubDate></item><item><title><![CDATA[Reply to Buttons only work if I access via python first on Thu, 05 Oct 2023 15:01:46 GMT]]></title><description><![CDATA[<p dir="auto">Oh, I’m realized I’m not actually using <a href="https://github.com/sdetweil/MMM-Buttons" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/sdetweil/MMM-Buttons</a> to fix the install issues</p>
]]></description><link>https://forum.magicmirror.builders/post/111351</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/111351</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Thu, 05 Oct 2023 15:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to Buttons only work if I access via python first on Thu, 05 Oct 2023 14:59:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a><br />
Is your issue solved?</p>
]]></description><link>https://forum.magicmirror.builders/post/111350</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/111350</guid><dc:creator><![CDATA[MMRIZE]]></dc:creator><pubDate>Thu, 05 Oct 2023 14:59:37 GMT</pubDate></item><item><title><![CDATA[Reply to Buttons only work if I access via python first on Thu, 05 Oct 2023 14:52:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mmrize" aria-label="Profile: MMRIZE">@<bdi>MMRIZE</bdi></a> Sorry for the delay I missed your response.</p>
<p dir="auto">I’m using <a href="https://github.com/Jopyth/MMM-Buttons" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/Jopyth/MMM-Buttons</a> but happy to switch if there’s something better.</p>
<p dir="auto">I’m using it to switch scenes in MMM-Scenes by sending “SCENES_NEXT” or “SCENES_PREV”</p>
]]></description><link>https://forum.magicmirror.builders/post/111349</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/111349</guid><dc:creator><![CDATA[gonzonia]]></dc:creator><pubDate>Thu, 05 Oct 2023 14:52:53 GMT</pubDate></item><item><title><![CDATA[Reply to Buttons only work if I access via python first on Mon, 04 Sep 2023 06:35:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gonzonia" aria-label="Profile: gonzonia">@<bdi>gonzonia</bdi></a><br />
A few modules have similar names; which one are you using exactly?</p>
]]></description><link>https://forum.magicmirror.builders/post/110812</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/110812</guid><dc:creator><![CDATA[MMRIZE]]></dc:creator><pubDate>Mon, 04 Sep 2023 06:35:21 GMT</pubDate></item></channel></rss>