<?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[Recommended way to read a GPIO pin on start-up]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I'm wondering what the recommended way is, to read a GPIO pin set to input after start-up. Here's my use case:</p>
<p dir="auto">I've an Arduino which is setting a digital pin to high and there's a wire which connects the Ardino's digital pin to a GPIO pin on the Omega. When the Omega detects a high on the input pin it is supposed to run an ash command.</p>
<p dir="auto">Right now, I'm doing this by starting a python script which loops continuously until it detects a high on the pin and then fires of the ash command. Even though I've a python command which is calling this file from the <code>rc.local</code> file, which was supposed to run the python script on-boot, that doesn't happen and I have to manually start the script using <code>python file_dir/file_name.py</code>.</p>
<p dir="auto">How do I ensure that <code>rc.local</code> is actually starting my python script? Is this the right way to read a pin on-boot? Because it seems a bit convoluted for something so simple.</p>
]]></description><link>http://community.onion.io/topic/1073/recommended-way-to-read-a-gpio-pin-on-start-up</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 12:50:36 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/1073.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Nov 2016 15:32:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Recommended way to read a GPIO pin on start-up on Mon, 21 Nov 2016 15:32:10 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I'm wondering what the recommended way is, to read a GPIO pin set to input after start-up. Here's my use case:</p>
<p dir="auto">I've an Arduino which is setting a digital pin to high and there's a wire which connects the Ardino's digital pin to a GPIO pin on the Omega. When the Omega detects a high on the input pin it is supposed to run an ash command.</p>
<p dir="auto">Right now, I'm doing this by starting a python script which loops continuously until it detects a high on the pin and then fires of the ash command. Even though I've a python command which is calling this file from the <code>rc.local</code> file, which was supposed to run the python script on-boot, that doesn't happen and I have to manually start the script using <code>python file_dir/file_name.py</code>.</p>
<p dir="auto">How do I ensure that <code>rc.local</code> is actually starting my python script? Is this the right way to read a pin on-boot? Because it seems a bit convoluted for something so simple.</p>
]]></description><link>http://community.onion.io/post/7034</link><guid isPermaLink="true">http://community.onion.io/post/7034</guid><dc:creator><![CDATA[Syed Hasan]]></dc:creator><pubDate>Mon, 21 Nov 2016 15:32:10 GMT</pubDate></item><item><title><![CDATA[Reply to Recommended way to read a GPIO pin on start-up on Mon, 21 Nov 2016 23:22:11 GMT]]></title><description><![CDATA[<p dir="auto">This post will be usefull to you for your boot sequence script:<br />
<a href="https://community.onion.io/topic/711/resolved-reboot-doesn-t-seem-to-work-in-cron/6" rel="nofollow">https://community.onion.io/topic/711/resolved-reboot-doesn-t-seem-to-work-in-cron/6</a></p>
<p dir="auto">That being said, these little devices are FAST, and weird things may happen on the electric level during power-up.  To be sure that your script takes a valid GPIO measurement, you should make sure that your whole system (any and all processors in your project) is up and running and stabilized.  A way to do this is to add a small delay in your script that is run at boot time if need be (for example, 500ms or 1 sec) before doing anything else.</p>
]]></description><link>http://community.onion.io/post/7038</link><guid isPermaLink="true">http://community.onion.io/post/7038</guid><dc:creator><![CDATA[fossette]]></dc:creator><pubDate>Mon, 21 Nov 2016 23:22:11 GMT</pubDate></item><item><title><![CDATA[Reply to Recommended way to read a GPIO pin on start-up on Tue, 22 Nov 2016 05:43:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1795">@Syed-Hasan</a> I would support all that <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1525">@fossette</a> says in the previous post.</p>
<p dir="auto">You should pay particular attention to 2 issues:</p>
<ol>
<li>Make sure that the system is fully operative by using a delay as suggested by <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/1525">@fossette</a></li>
<li>As is mentioned in the referenced post, make sure the program you want to run at boot terminates in a timely manner and doesn't end up blocking the start up process - e.g. run it in the background</li>
</ol>
]]></description><link>http://community.onion.io/post/7041</link><guid isPermaLink="true">http://community.onion.io/post/7041</guid><dc:creator><![CDATA[Kit Bishop]]></dc:creator><pubDate>Tue, 22 Nov 2016 05:43:31 GMT</pubDate></item></channel></rss>