<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>logIt &#187; Raspberry Pi</title>
	<atom:link href="https://lakm.us/logit/tag/raspberry-pi/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Mobile WiFi NAS on Raspberry Pi with TrueCrypt</title>
		<link>https://lakm.us/logit/2014/06/mobile-wifi-nas-raspberry-pi-truecrypt/</link>
		<comments>https://lakm.us/logit/2014/06/mobile-wifi-nas-raspberry-pi-truecrypt/#comments</comments>
		<pubDate>Sun, 01 Jun 2014 04:23:18 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[General Linux]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[ARMv6]]></category>
		<category><![CDATA[file system]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=778</guid>
		<description><![CDATA[Mobile NAS sounds like an idea worth waiting for to run on my mini Raspberry Pi Model A. Unfortunately, it only took me a while, before abandoning it. I&#8217;ve waited since writing about Raspberry Pi USB problem, that is to finally cut the backfeeding power line from the el cheapo powered USB hub. There comes [...]]]></description>
				<content:encoded><![CDATA[<p>Mobile <a href="http://en.wikipedia.org/wiki/Network-attached_storage" target="_blank">NAS</a> sounds like an idea worth waiting for to run on my mini <a href="http://www.raspberrypi.org/tag/model-a/" target="_blank">Raspberry Pi Model A</a>. Unfortunately, it only took me a while, before abandoning it. I&#8217;ve waited since <a href="../../../2013/03/raspberry-pi-common-usb-problems/" title="Raspberry Pi Common USB Problems" target="_blank">writing about Raspberry Pi USB problem</a>, that is to <a href="https://flic.kr/p/kqopvk" title="Cutting backfeed from el cheapo USB hub to make friend with dual rating power bank &#038; Raspberry Pi" target="_blank">finally cut the backfeeding power line from the <em>el cheapo</em> powered USB hub</a>. There comes new problem afterward, my &#8220;big storage&#8221; ―a <a href="http://www.seagate.com/external-hard-drives/portable-hard-drives/standard/backup-plus/" title="Backup Plus Slim Portable Drive" target="_blank">Seagate® Backup Plus Slim Portable Drive</a>, shipped with no bulky power supply line― can&#8217;t be mounted. Silence soon follows rotating motor sound a while after plugging-in. I&#8217;ve tried both <a href="http://en.wikipedia.org/wiki/Ext3" target="_blank">ext3</a> and <a href="http://en.wikipedia.org/wiki/NTFS-3G" target="_blank">NTFS (using ntfs-3g)</a> without luck. Later, as benchmark whether it is USB power in question, I try to connect the same set of <em>el cheapo</em> USB hub plus external power to laptop, and it works, leaving me stranded with other issue (is it USB 3.0? 256MB of the Model A? Anything?). I must say that it isn&#8217;t completely not-working as the USB hub set can mount with <a href="http://www.ebay.co.uk/itm/Ritmo-R-Driver-III-USB-2-0-to-sata-Ide-cable-/221221820375" title="R-Driver III USB 2.0 to sata / Ide cable" target="_blank">USB to IDE converter</a> and my old internal hard disk (noting that there shouldn&#8217;t be similar power issue this way). If only it weren&#8217;t for the AC power adapter and large size, this is Mobile NAS; beats me.</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="Mobile NAS [Raspberry Pi hack] by aqila_rifti, on Flickr" src="https://farm6.staticflickr.com/5193/14317107955_73226c6432_n.jpg" title="Mobile NAS [Raspberry Pi hack] by aqila_rifti, on Flickr" width="320" height="320" /><p class="wp-caption-text">Battery power bank, WiFi USB stick, and thumb drive</p></div>
<p>I then turn away to motor-less small storage, a <a href="http://www.sandisk.com/products/usb/drives/cruzer-switch/" title="Sandisk Cruzer CZ52 " target="_blank">32 Gigs USB thumb drive</a> so I can move on to other concern: on-the-fly encryption. Hence, I follow <a href="http://kenfallon.com/truecrypt-on-a-respberry-pi-no-gui/" target="_blank">instructions to install True Crypt on Raspberry Pi</a>. After unpacking of <code>wxWidgets-2.8.12.tar.gz</code> and <code>TrueCrypt 7.1a Source.tar.gz</code> in place, putting header files from <code>pkcs-11-cryptoki2.20</code>, and then install <code>libfuse-dev</code>, the following <code>make</code> will require long time:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKCS11_INC</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>truecrypt<span style="color: #000000; font-weight: bold;">/</span>pkcs<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">NOGUI</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">WX_ROOT</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>wxWidgets wxbuild
Configuring wxWidgets library...
Building wxWidgets library...
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>wxWidgets<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>common<span style="color: #000000; font-weight: bold;">/</span>string.cpp:<span style="color: #000000;">84</span>:<span style="color: #000000;">39</span>: warning: ‘wxEmptyString’ initialized and declared ‘extern’ <span style="color: #7a0874; font-weight: bold;">&#91;</span>enabled by default<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><span id="more-778"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">NOGUI</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">WX_ROOT</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>wxWidgets wxbuild
Compiling Buffer.cpp
Compiling Exception.cpp
Compiling Event.cpp
...
..<span style="color: #000000; font-weight: bold;">/</span>Crypto<span style="color: #000000; font-weight: bold;">/</span>Aeskey.c:<span style="color: #000000;">527</span>:<span style="color: #000000;">25</span>: warning: operation on ‘ss<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>’ may be undefined <span style="color: #7a0874; font-weight: bold;">&#91;</span>-Wsequence-point<span style="color: #7a0874; font-weight: bold;">&#93;</span>
..<span style="color: #000000; font-weight: bold;">/</span>Crypto<span style="color: #000000; font-weight: bold;">/</span>Aeskey.c:<span style="color: #000000;">527</span>:<span style="color: #000000;">25</span>: warning: operation on ‘ss<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>’ may be undefined <span style="color: #7a0874; font-weight: bold;">&#91;</span>-Wsequence-point<span style="color: #7a0874; font-weight: bold;">&#93;</span>
..<span style="color: #000000; font-weight: bold;">/</span>Crypto<span style="color: #000000; font-weight: bold;">/</span>Aeskey.c:<span style="color: #000000;">527</span>:<span style="color: #000000;">25</span>: warning: operation on ‘ss<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">7</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>’ may be undefined <span style="color: #7a0874; font-weight: bold;">&#91;</span>-Wsequence-point<span style="color: #7a0874; font-weight: bold;">&#93;</span>
...
Converting Language.xml
Compiling Resources.cpp
Linking truecrypt</pre></div></div>

<p>I created the TrueCrypt volume separately via its desktop GUI with <code>ext3</code> file system to then mount it in Pi to a configured <a href="http://en.wikipedia.org/wiki/Samba_(software)" target="_blank">Samba share</a>. As pointed out in <a href="http://raspberrywebserver.com/serveradmin/share-your-raspberry-pis-files-and-folders-across-a-network.html" target="_blank">a post</a>, the following changes are added to <code>smb.conf</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
wins support = <span style="color: #c20cb9; font-weight: bold;">yes</span>
...
<span style="color: #7a0874; font-weight: bold;">&#91;</span>pitruecrypt<span style="color: #7a0874; font-weight: bold;">&#93;</span>
   <span style="color: #007800;">comment</span>= Pi Truecrypt Volume
   <span style="color: #007800;">path</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>the <span style="color: #c20cb9; font-weight: bold;">mount</span> path of the USB thumb drive TrueCrypt volume<span style="color: #000000; font-weight: bold;">&gt;</span>
   <span style="color: #007800;">browseable</span>=Yes
   <span style="color: #007800;">writeable</span>=Yes
   only <span style="color: #007800;">guest</span>=no
   create <span style="color: #007800;">mask</span>=0777
   directory <span style="color: #007800;">mask</span>=0777
   <span style="color: #007800;">public</span>=no</pre></div></div>

<p>and then user-password are entered via interactive command.</p>
<p>For mobility, I already had the Pi as WiFi access point using <code><a href="hostap.epitest.fi/hostapd/" target="_blank">hostapd</a></code> (check <a href="http://sirlagz.net/2012/08/09/how-to-use-the-raspberry-pi-as-a-wireless-access-pointrouter-part-1/" target="_blank">these steps</a>) and <a href="http://www.amazon.com/HAME-10400mAh-Double-Indicators-Capacity/dp/B00B5OFC5I" target="_blank">power bank</a>, so it&#8217;s now matter of performance. In the case of <code><a href="http://www.samba.org/rsync/" target="_blank">rsync</a></code>, initial sync of some 1,500 items totaling in 1 Gig size elapses in approximately the same 12 minutes of time compared to one bulk file of the same size. Of course, over the next incremental sync, it only takes less than a minute for the thousand items to just update slight differences.</p>
<h3>Security</h3>
<p>Back to security, there surely risk by opening Samba share to mounted TrueCrypt volume. But, for me it would be practically manageable (cross my finger). There is more concern to the fate of <a href="http://truecrypt.sourceforge.net/" target="_blank">TrueCrypt</a> after it is being closed in such a weird way, given that <a href="https://opencryptoaudit.org/reports/iSec_Final_Open_Crypto_Audit_Project_TrueCrypt_Security_Assessment.pdf" target="_blank">last audit</a> finds nothing severe. Anyway, I found brute force tool, but no critical attack exists currently, unless e.g. it stays powered on and mounted, the person gain physical access. Beats me again.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2014/06/mobile-wifi-nas-raspberry-pi-truecrypt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Any m-by-n Matrix Keypad for Raspberry Pi</title>
		<link>https://lakm.us/logit/2014/02/any-m-x-n-matrix-keypad-raspberry-pi/</link>
		<comments>https://lakm.us/logit/2014/02/any-m-x-n-matrix-keypad-raspberry-pi/#comments</comments>
		<pubDate>Sat, 08 Feb 2014 18:30:57 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=746</guid>
		<description><![CDATA[What about instantiating any m x n matrix keypad by a Python class? Raspberry Pi takes me to learn how to build a Python class for the first time while expanding my initial WiringPi-based matrix keypad into a derivative work. A matrix keypad instance is defined by: Actual GPIO pins used forming the row and [...]]]></description>
				<content:encoded><![CDATA[<p>What about instantiating any m x n matrix keypad by a <a href="http://docs.python.org/2/tutorial/classes.html" title="Python Classes" target="_blank">Python class</a>? <a href="http://www.raspberrypi.org/" target="_blank">Raspberry Pi</a> takes me to learn how to build a Python class for the first time while expanding my initial <a href="../../2013/03/raspberry-pi-membrane-matrix-keypad-gpio-input-2/" title="Raspberry Pi: Membrane (Matrix) Keypad as GPIO Input" target="_blank">WiringPi-based matrix keypad</a> into a derivative work.</p>
<p>A matrix keypad instance is defined by:</p>
<ol>
<li>Actual GPIO pins used forming the row and column of the m x n matrix</li>
<li>Individual character in-use as symbol for each button</li>
</ol>
<p>Hence, I instantiate and call method like</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">...
<span style="color: black;">QPad</span>  = matrixQPi<span style="color: black;">&#40;</span>keyPad=keyPad,row=row,col=col<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> QPad.<span style="color: black;">scanQ</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>to print the character being pressed. Some examples pushed to <a href="https://github.com/bandono/matrixQPi/tree/v2.0" title="Github: matrixQPi v2.0" target="_blank">my github</a> explains how the above <code>keyPad</code>, <code>row</code>, and <code>col</code> are defined to scan-read pressed button of 2&#215;2, 2&#215;3, and 4&#215;3 matrix keypads <time datetime="2014-02-23">(or have it 3&#215;4 matrix keypads in other words)</time>.</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="Illustration of any m-by-n matrix: 4x3, 2x2, and 2x3 keypad with different button symbols &#038; GPIO combinations" src="../../../../images/any-mxn-matrix-keypad-raspberry-pi.png" title="Illustration of any m-by-n matrix: 4x3, 2x2, and 2x3 keypad with different button symbols &#038; GPIO combinations" width="368" height="264" /><p class="wp-caption-text">Illustration of any m-by-n matrix: 4x3, 2x2, and 2x3 keypad with different button symbols &#038; GPIO combinations</p></div>
<p>I used deprecated <a href="https://github.com/WiringPi/WiringPi-Python" title="WiringPi-Python" target="_blank">Wiring-Pi Python</a> (they already moved to <a href="https://github.com/WiringPi/WiringPi2-Python" title="WiringPi2-Python" target="_blank">2.x version</a>) without problem. However, you&#8217;ll fail building from latest commit and must use combination of older commits as described by my updated part of <a href="../../2013/03/raspberry-pi-gpio-input-button-basics-1/" title="Raspberry Pi GPIO Input Button Basics" target="_blank">an old-post</a>. By the way, there&#8217;s I/O expander support for <a href="https://github.com/WiringPi/WiringPi2-Python" title="WiringPi2-Python" target="_blank">WiringPi2-Python</a> which is good, considering:</p>
<blockquote><p>GPIO is expensive and for the sake of a keypad, you should not spend all.</p></blockquote>
<p>(A friend told me that once)</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2014/02/any-m-x-n-matrix-keypad-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modem usb_modeswitch in Raspberry Pi</title>
		<link>https://lakm.us/logit/2013/03/modem-usb_modeswitch-raspberry-pi/</link>
		<comments>https://lakm.us/logit/2013/03/modem-usb_modeswitch-raspberry-pi/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 03:35:30 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[ARMv6]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=571</guid>
		<description><![CDATA[USB modem these days are plug-and-play as CD-ROM first allowing driver and internet dialer application installations and then as modem afterwards. This Windows-behavior is handled by USB_ModeSwitch in Linux. Likely three years ago we did eject and other driver attachment by writing udev rules. Now it&#8217;s almost automatically attached as modem after insertion and people [...]]]></description>
				<content:encoded><![CDATA[<p>USB modem these days are plug-and-play as CD-ROM first allowing driver and internet dialer application installations and then as modem afterwards. This Windows-behavior is handled by <a href="http://www.draisberghof.de/usb_modeswitch/" target="_blank">USB_ModeSwitch</a> in Linux. Likely three years ago we did eject and other driver attachment by <a href="http://www.reactivated.net/writing_udev_rules.html" target="_blank">writing <code>udev</code> rules</a>.</p>
<p>Now it&#8217;s almost automatically attached as modem after insertion and people have been contributing to list of device-and-target device after mode-switching (find it as <code>/usr/share/usb_modeswitch/configPack.tar.gz</code>). At least for <a href="http://www.raspberrypi.org/" target="_blank">Raspberry Pi (RPi)</a>, I have one device list from August 2012 when playing around with <a href="http://xbian.org/" target="_blank">XBian 0.8.3</a> and one from May 2012 in when using <a href="http://www.raspbian.org/" target="_blank">Raspbian Wheezy (2012-08-16)</a>.</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="old-huawei-e220-newer-e153-raspberry-pi-compatibility.jpg" src="../../../../images/old-huawei-e220-newer-e153-raspberry-pi-compatibility.jpg" title="Huawei E220 requires no mode-switch" width="310" height="380" /><p class="wp-caption-text">Huawei E220 requires no mode-switch from vendor-product ID 12d1:1003 to function as modem</p></div>
<p>There is still wrapper for udev in <code>/lib/udev/rules.d/40-usb_modeswitch.rule</code> and my Huawei E153 HSDPA stick recognized and switched successfully as shown:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usb_modeswitch: switching device 12d1:<span style="color: #000000;">1446</span> on 001<span style="color: #000000; font-weight: bold;">/</span>005
...
logger: usb_modeswitch: switched to 12d1:14ac on 001<span style="color: #000000; font-weight: bold;">/</span>006</pre></div></div>

<p><span id="more-571"></span>But I didn&#8217;t get there in the first place. Because of USB power problem (<a href="../../../2013/03/raspberry-pi-common-usb-problems/" title="Raspberry Pi Common USB Problems" target="_blank">detailed in previous post</a>), I used to plug USB devices before powering up so that I could use <a href="http://htc-linux.org/wiki/index.php?title=File:Usb-y-power-cable.jpg" title="File:Usb-y-power-cable.jpg" target="_blank">Y-cable injected by separate power source</a> without powered USB-hub. It turned out that if I had plugged the USB before powering up the RPi the mode-switching didn&#8217;t occur.</p>
<p>The HSDPA USB modem used is <a href="http://www.huaweidevice.co.id/webmain/main/product/detail/35/huawei-e153" target="_blank">Huawei E153</a> appearing in <code>lsusb</code> with vendor-product ID <code>12d1:1446</code>. Using aforementioned <a href="http://xbian.org/" target="_blank">XBian</a> and target device <code>12d1:140c</code> (suggested in <a href="http://www.santinoli.com/open/e1692-howto.html" target="_blank">Santinoli&#8217;s post</a>), I arbitrarily succeeded to switch to modem and dial internet with <code>pppd</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ usb_modeswitch <span style="color: #660033;">-v</span> 12d1 <span style="color: #660033;">-p</span> <span style="color: #000000;">1446</span> <span style="color: #660033;">-P</span> 140c</pre></div></div>

<p>(I placed Santinoli&#8217;s config in <code>/etc/usb_modeswitch.conf</code>)<br />
This wasn&#8217;t stable however (also note that XBian consumed CPU above 50% for <a href="http://xbmc.org/" title="XBMC" target="_blank"><code>xbmc</code></a>).</p>
<p>Later I find out that it will automatically switch to <code>12d1:14ac</code> instead when plugged in after RPi is up. However, since it also won&#8217;t switch if plugged before power-up, I also try to mode-switch manually using config file found inside <code>/usr/share/usb_modeswitch/configPack.tar.gz</code> archive named <code>12d1:1446</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ usb_modeswitch <span style="color: #660033;">-v</span> 12d1 <span style="color: #660033;">-p</span> <span style="color: #000000;">1446</span> <span style="color: #660033;">-c</span> 12d1\:<span style="color: #000000;">1446</span></pre></div></div>

<p>It doesn&#8217;t seem to work. Modification to something close to my previous config also fails. Hence, consistent result only occurs if the stick is plugged in after RPi up. Then I decide to use USB-hub (also <a href="../../../2013/03/raspberry-pi-common-usb-problems/" title="Raspberry Pi Common USB Problems" target="_blank">detailed in previous post</a>) to tackle power issue (it will reboot anyway if you plug in without adequate powering). However, after successful mode-switch what&#8217;s being reported in <a href="http://elinux.org/RPi_VerifiedPeripherals">eLinux Wiki</a> often happens: it slows down, try <code>lsub</code> command for example.</p>
<p>Currently I give up the idea of using that modem and choose older <a href="http://en.wikipedia.org/wiki/Huawei_E220" target="_blank">Huawei E220</a>:</p>
<ol>
<li>No <code>usb_modeswitch</code>. <a href="../../../2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/" title="Compile USB Serial Modem Using option.c (Ubuntu on Beagleboard xM)" target="_blank">Driver attached directly by the kernel as <code>option.ko</code> device</a> (this device has been on the list for long)</li>
<li>Stable. No slowing down</li>
</ol>
<p>The E153 modem itself has been implemented to stream video using the <a href="http://en.wikipedia.org/wiki/ARM_Cortex-A8" target="_blank">higher ARM type</a> <a href="http://beagleboard.org/hardware-xm" target="_blank">BeagleBoard-xM</a> without significant stability issue (check <a href="https://www.youtube.com/watch?v=yFZoFsqAdS8" title="Zoom IP Camera Streaming &#038; Control on BeagleBoard (Over HSDPA Network)" target="_blank">my YouTube demo</a>). It mode-switched when powering up Ubuntu on the Beagle.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2013/03/modem-usb_modeswitch-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi Common USB Problems</title>
		<link>https://lakm.us/logit/2013/03/raspberry-pi-common-usb-problems/</link>
		<comments>https://lakm.us/logit/2013/03/raspberry-pi-common-usb-problems/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 08:02:29 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[ARMv6]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=556</guid>
		<description><![CDATA[USB problem is the first thing to arise with Raspberry Pi when plugging-in peripherals. This isn&#8217;t exclusive though, learning that my Linux laptop also has it and the higher ARM architecture, BeagleBoard-xM, also experiences the same issue sometime. But with Raspberry Pi (RPi) in]]></description>
				<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Universal_Serial_Bus" title="Universal Serial Bus" target="_blank">USB</a> problem is the first thing to arise with <a href="http://www.raspberrypi.org/" title="www.raspberrypi.org" target="_blank">Raspberry Pi</a> when plugging-in peripherals. This isn&#8217;t exclusive though, learning that my Linux laptop also has it and the higher ARM architecture, <a href="http://beagleboard.org/hardware-xm">BeagleBoard-xM</a>, also experiences the same issue sometime. But with Raspberry Pi (RPi) in <a href="http://www.pcworld.com/article/156494/superspeed_usb.html" title="""Over 6 billion products are in the market, and over 2 billion ship a year now"" target="_blank">the universe of many viable USB device options</a>, you&#8217;ll definitely need to double its popular credit card-sized form to have powered USB-hub docked next to it, although Y-cable with separate power assistant injecting the USB device directly is sometime adequate.</p>
<div class="wp-caption aligncenter" style="width: 460px"><a href="http://www.flickr.com/photos/aqila_rifti/8580224756/" title="y-cable . #Pi USB power-hog? buggy? by aqila_rifti, on Flickr"><img src="http://farm9.staticflickr.com/8244/8580224756_00de511912_n.jpg" width="310" height="310" alt="y-cable . #Pi USB power-hog? buggy?"></a><p class="wp-caption-text">Y-cable for USB modem stick &#038; various current rating-AC power adapters for smartphone/tablet to go with Raspberry Pi</p></div>
<p><a href="http://elinux.org/RPi_VerifiedPeripherals" title="RPi Verified Peripherals" target="_blank">eLinux Wiki lists</a> market available USB-hubs reported to work. A decent brand (that will cost you) qualifies:</p>
<ul>
<li>Doesn&#8217;t leak power back to RPi via USB port (check this by unplugging the main power, then check the red LED indicator) as this will interfere with the <code>reboot</code> command (physical state vs software).</li>
<li>Provides charging from one of its port for RPi, meaning no separate source for <a href="http://www.raspberrypi.org/archives/260" title="Power supply confirmed as 5V micro USB" target="_blank">the exclusive 700 mA requirement</a>. A single AC power adapter with high current rating will fit all (check <a href="http://www.ianrolfe.com/raspberry-pi/keys-to-getting-the-pi-working/" title="Keys to getting the Pi working" target="_blank">single power connectivity sketch in this blog post</a>)</li>
</ul>
<p><span id="more-556"></span>An ugly situation when I plugged in WiFi stick and modem looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1836.871640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> smsc95xx <span style="color: #000000;">1</span>-<span style="color: #000000;">1.1</span>:<span style="color: #000000;">1.0</span>: eth0: Failed to <span style="color: #c20cb9; font-weight: bold;">read</span> register index 0x00000118
...
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1803.780601</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> phy0 -<span style="color: #000000; font-weight: bold;">&gt;</span> rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed <span style="color: #000000; font-weight: bold;">for</span> offset 0x101c with error -110.</pre></div></div>

<p>tail of the above <code>syslog</code> is saying error with the (1) ethernet (<a href="http://www.raspberrypi.org/faqs" target="_blank">this is actually also a USB 2.0</a> but not appearing in <code>lsusb</code> command) and (2) the WiFi stick used (in this case with <a href="http://www.mediatek.com/_en/01_products/04_pro.php?sn=1007">RT5370 chipset</a>). Then, of course (3) doing things with the just plugged modem you&#8217;ll expect more instability.</p>
<p>I mentioned <a href="http://beagleboard.org/hardware-xm">BeagleBoard-xM</a> which also came with similar USB ethernet on-board. Unfortunately, Beagle was more stable when my case was to have it stream a zoom-camera input to internet (check <a href="https://www.youtube.com/watch?v=yFZoFsqAdS8" title="Zoom IP Camera Streaming &#038; Control on BeagleBoard (Over HSDPA Network)" target="_blank">my YouTube demo</a>). The camera decoder and modem were both USB plugged without Y-cable or additional power supply. As a standalone system, part of the design was to <code>reboot</code> under trouble detected by the software. Again, OS command <code>reboot</code> is not achievable consistently with the RPi when power backfeeds through USB port.</p>
<p>(PS: Note that previous comparison solely points out what to expect when dealing with USB among other considerations e.g. price, different ARM, etc. which are entirely different.)</p>
<p>As an absolute requirement for me, I found a powered USB-hub available in Indonesian market as <strong>7 ports XTec Go</strong>. Yes, it leaks power back as confirmed by the vendor-product ID <code>05e3:0608</code> of the chipset listed in <a href="http://elinux.org/RPi_VerifiedPeripherals" title="RPi Verified Peripherals" target="_blank">eLinux Wiki lists</a> with a bunch of different names (judging the picture, <a href="http://uk.shopping.com/Hama-USB2-0-HUB-1-7-M-NETZT-KA/info?sb=1" target="_blank">Hama</a> is closest).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ lsusb
...
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-<span style="color: #000000;">2.0</span> <span style="color: #000000;">4</span>-Port HUB
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-<span style="color: #000000;">2.0</span> <span style="color: #000000;">4</span>-Port HUB
...</pre></div></div>

<div class="wp-caption aligncenter" style="width: 460px"><a href="http://www.flickr.com/photos/aqila_rifti/8581522699/" title="old HSDPA Huawei modem requiring no usb_modeswitch. Cheap USB hub Genesys chipset. WiFi stick. #Pi by aqila_rifti, on Flickr"><img src="http://farm9.staticflickr.com/8510/8581522699_b1bfcdf05f_n.jpg" width="300" height="300" alt="old HSDPA Huawei modem requiring no usb_modeswitch. Cheap USB hub Genesys chipset. WiFi stick. #Pi"></a><p class="wp-caption-text">Three Musketeers: powered USB-hub (Genesys chipset), Huawei E220 HSDPA modem, and TL-WN727N WiFi stick</p></div>
<p>My el cheapo USB-hub, HDSPA modem, and WiFi stick are the matchmaking of brands shown in the above image. It achieves long uptime like 6 hours serving internet when RPi used as router. I still use separate AC power adapter on the go with me: regular 700 mA that comes with smartphone will do for the RPi, while for the USB-hub, I have 2A rating from tablet charger. However, I&#8217;ve also plugged separate 500 mA charger for the hub without problem and/or excessive heat (you need to touch the supply sometime to feel any nasty heat as some of them might have been low quality build that could blow up. Yes it did). My plan with mobility is to have power bank with dual USB charging output (<a href="http://www.amazon.com/HAME-10400mAh-Double-Indicators-Capacity/dp/B00B5OFC5I" title="HAME MP1 10400mAh Power Bank Double USB Output 5V/1A &#038; 5V/2.1A 4 LED Indicators Show Power Level Full Capacity" target="_blank">this Hame has 1A and 2.1A</a>) when no AC source nears.</p>
<p>Have I tested other USB modem stick? Check <a href="../../../2013/03/modem-usb_modeswitch-raspberry-pi/" title="Modem usb_modeswitch in Raspberry Pi" target="_blank">my other post related to <code>usb_modeswitch</code></a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2013/03/raspberry-pi-common-usb-problems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi: Membrane (Matrix) Keypad as GPIO Input</title>
		<link>https://lakm.us/logit/2013/03/raspberry-pi-membrane-matrix-keypad-gpio-input-2/</link>
		<comments>https://lakm.us/logit/2013/03/raspberry-pi-membrane-matrix-keypad-gpio-input-2/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 08:55:13 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[ARMv6]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=533</guid>
		<description><![CDATA[Membrane matrix keypad using GPIO as Raspberry Pi input has been my goal since WiringPi deployed in the first place. To begin with, GPIO hacking was initially started with some important basics (see previous post). Without external system (other interfacing chip), the 3&#215;4 membrane keypad reserved all seven GPIO pins plus one pin used for [...]]]></description>
				<content:encoded><![CDATA[<p>Membrane matrix keypad using GPIO as <a href="http://www.raspberrypi.org" target="_blank">Raspberry Pi</a> input has been my goal since <em><a href="https://projects.drogon.net/raspberry-pi/wiringpi/" target="_blank">WiringPi</a></em> deployed in the first place. To begin with, GPIO hacking was initially started with some important basics (see <a href="./2013/03/raspberry-pi-gpio-input-button-basics-1/" target="_blank">previous post</a>). Without external system (other interfacing chip), the <a href="http://www.adafruit.com/products/419" title="Similar product from Adafruit: Membrane Matrix Keypad 3x4" target="_blank">3&#215;4 membrane keypa</a>d reserved all seven GPIO pins plus one pin used for LED indicating successful reading of pressed key.</p>
<p><time datetime="2014-02-09"><br />
<blockquote style="background-color:lightyellow;"><strong><em>Updated:</em></strong> for those who fail to build using <a href="https://github.com/WiringPi/WiringPi-Python" title="WiringPi-Python" target="_blank">deprecated WiringPi-Python</a>, check <a href="../../2013/03/raspberry-pi-gpio-input-button-basics-1/" title="Raspberry Pi GPIO Input Button Basics" target="_blank">this updated post</a> to know which commit that build without error. There is now also <a href="../../2014/02/any-m-x-n-matrix-keypad-raspberry-pi/" title="Any m-by-n Matrix Keypad for Raspberry Pi" target="_blank">a Python class for matrix keypad</a>.</p></blockquote>
<p></time></p>
<p>My idea of having the keypad is to make alternative input available under no keyboard presence nor shell access. List of things I can think of for instances, pressed key &#8220;0&#8243; will make the Raspberry Pi (RPi) dial GPRS to a specific ISP and act as router to the USB WiFi stick, pressed key &#8220;7&#8243; will convert it to a router that will bridge the ethernet to WiFi, etc. In short, those key readings will invoke subsequent scripts to run inside RPi.</p>
<p>The physical connection schematic drawings and code are gitified (visit <a href="https://github.com/bandono/matrixQPi/tree/v1.2" title="gitHub: matrixQPi v1.2" target="_blank">v1.2 of the project on gitHub</a>). A nice animated image on how the buttons connect pins forming a matrix can be found in <a href="http://www.hackyourmind.org/blog/rpi-hw-interfacing-the-raspberry-pi-with-matrix-keypad/" target="_blank">hackyourmind.org</a>.</p>
<div class="wp-caption aligncenter" style="width: 460px"><a href="http://www.flickr.com/photos/aqila_rifti/8541074196/" title="Raspberry #Pi membrane (matrix) keypad. Longer hours with the circuitry in fear of bricking it. The code took half day of work instead by aqila_rifti, on Flickr"><img src="http://farm9.staticflickr.com/8375/8541074196_a22dccbd2a.jpg" width="310" height="310" alt="Raspberry #Pi membrane (matrix) keypad. Longer hours with the circuitry in fear of bricking it. The code took half day of work instead"></a> <p class="wp-caption-text">Matrix keypad: alternative quick input for Raspberry Pi to start certain command</p></div>
<p>Some remarks over what the code does:<br />
<span id="more-533"></span></p>
<ul>
<li>It only read one pressed key at a time.</li>
<li>It uses no interrupt. To read input it must wait and scan (this waiting experience is by far negligible to human sense).</li>
<li>Debouncing doesn&#8217;t seem necessary as <em>WiringPi</em> already provided this by software (I suppose <a href="https://github.com/WiringPi/WiringPi/blob/master/examples/wfi.c" title="WiringPi: wfi.c" target="_blank">this timing method on their gitHub</a> deals with debounce).</li>
</ul>
<p>How it works? <a href="http://www.raspberrypi.org/phpBB3/viewtopic.php?t=30376&#038;p=291617" title="RPi Forum: Membrane Keypad Circuit Help" target="_blank">RPi forum thread</a> gives a general idea that applies in my case:</p>
<ol>
<li>Divide the 3&#215;4 matrix as columns and rows. 4 GPIO pins as rows are pulled-up with 10k resistors and initialized as input.</li>
<li>Other 3 GPIO pins as columns are initialized as output low.</li>
<li>First loop will scan for one pressed key being read as one of the rows pulled-low</li>
<li>After the loop breaks, all columns are set as input, then the row pin found in the loop is set as output-high</li>
<li>Second loop will scan for column being pulled-high by that row pin. Between both loops, it is assumed that the key press is still in effect. In reality, normal human act of pressing this key elapses long enough for the software to run the scans in two loops.</li>
<li>Bingo! The code reads row-column combination of the pressed key.</li>
</ol>
<p>Example of the code&#8217;s output by calling from shell:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>matrixQPi.py -i; <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000;">3</span>
<span style="color: #000000;">6</span>
<span style="color: #000000;">9</span>
<span style="color: #000000;">8</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>(In the above example <code>^C</code> will throw Python <code>KeyboardInterrupt</code> messages before  breaking the <code>bash</code> loop)</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2013/03/raspberry-pi-membrane-matrix-keypad-gpio-input-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi GPIO Input Button Basics</title>
		<link>https://lakm.us/logit/2013/03/raspberry-pi-gpio-input-button-basics-1/</link>
		<comments>https://lakm.us/logit/2013/03/raspberry-pi-gpio-input-button-basics-1/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 02:57:58 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[ARMv6]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[GPIO]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=500</guid>
		<description><![CDATA[When you start hacking Raspberry Pi&#8217;s GPIO, first thing to keep in mind is the +3.3V CMOS logic level voltage despite the 5V supply. Secondly, read references about current limiting resistors (eLinux Wiki has a section there). What to avoid then? Try not to physically short the GPIO pin to ground when it is programmed [...]]]></description>
				<content:encoded><![CDATA[<p>When you start hacking Raspberry Pi&#8217;s GPIO, first thing to keep in mind is the +3.3V CMOS logic level voltage despite the 5V supply. Secondly, read references about current limiting resistors (eLinux Wiki has <a href="http://elinux.org/RPi_Tutorial_EGHS:Switch_Input" title="RPi_Tutorial_EGHS:Switch_Input" target="_blank">a section there</a>). What to avoid then? Try not to <strong>physically</strong> short the GPIO pin to ground when it is <strong>programmed</strong> as the opposite output-high.</p>
<p>GPIO pin logic state (meaning voltage) are both programmable and driven by physical-connection. I choose <em><a href="https://projects.drogon.net/raspberry-pi/wiringpi/" title="WiringPi" target="_blank">wiringPi</a></em> for practical reasons: availability of its <a href="https://github.com/WiringPi/WiringPi-Python" title="WiringPi-Python" target="_blank">Python wrapper</a> and its simple syntax (glancing it at first sight). <strong>WiringPi</strong> has an option of using its own pin numbering to address it in the code instead of the original GPIO numbering (there are board revisions to watch for in some cases of usage, not mine). Every pin can be initialized as input or output.</p>
<p><time datetime="2014-02-08"><br />
<blockquote style="background-color:lightyellow;"><strong><em>Updated:</em></strong> <a href="https://github.com/WiringPi/WiringPi-Python" title="WiringPi-Python" target="_blank">Wiring-Pi Python</a> is deprecated and moving to <a href="https://github.com/WiringPi/WiringPi2-Python" title="WiringPi2-Python" target="_blank">2.x version</a> that supports I/O expander. However, you can still find this combination of commits that will work and build without error message:</p>
<p>- main module: <a href="https://github.com/WiringPi/WiringPi-Python/tree/9c77bde53fb5fa6283268b4a529e47048f8a379d">WiringPi-Python@9c77bde</a><br />
- submodule: <a href="https://github.com/WiringPi/WiringPi/tree/89bbe97856407979fa75c4c793fabf4db839a0ee">WiringPi@89bbe97</a></p>
<p>(Check how to build on my <a href="https://github.com/bandono/matrixQPi/tree/v2.0" title="matrixQP v2.0" target="_blank">README</a>)</p></blockquote>
<p></time></p>
<p>Using an <a href="http://overseas.sanwa-meter.co.jp/items/detail.php?id=85" title="Sanwa Multimeter: DIY KIT-8D" target="_blank">analog multitester</a>, here are behavioral findings:</p>
<ul>
<li>GPIO pin voltage swings to high logic after reboot (the meter&#8217;s needle is rocking for a second or so). It is in low voltage afterward until being programmed or physically pulled-up.</li>
<li>Two pins, wiringPi pin 8 and 9, remain in high logic voltage after reboot. They are SDA0 and SCL0 to be used as an I²C, however they can be used to read button as well. (<a href="http://elinux.org/RPi_Low-level_peripherals" title="RPi low-level peripherals" target="_blank">eLinux Wiki</a>: &#8220;there are 1.8 k pulls up resistors on the board for these pins&#8221;)</li>
<li>I did short the high logic to ground accidentally, it invoked reboot. (I don&#8217;t know how many times or how long of this will brick the Raspberry Pi)</li>
</ul>
<p>Prior to trying the push-button switch, I didn&#8217;t have proper circuitry and working with wires as probes, prone to accident that was. I found an advice to insulate the +5V pin voltage so I could worry less.</p>
<div class="wp-caption aligncenter" style="width: 460px"><br />
<a href="http://www.flickr.com/photos/aqila_rifti/8440986498/" title="Raspbery Pi: Getting Started with GPIO Hack by aqila_rifti, on Flickr"><img src="http://farm9.staticflickr.com/8230/8440986498_5acd920148.jpg" width="300" height="300" alt="Raspbery Pi: Getting Started with GPIO Hack"></a><p class="wp-caption-text">Insulate the +5V pin of Raspberry Pi</p></div>
<p>A 10k pull-up resistor and a button are enough to test the following. Go to interactive Python shell and run line by line until the button push is read as low logic (GPIO7 in this example):</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># python</span>
Python 2.7.3rc2 <span style="color: black;">&#40;</span>default, May  <span style="color: #ff4500;">6</span> <span style="color: #ff4500;">2012</span>, <span style="color: #ff4500;">20</span>:02:<span style="color: #ff4500;">25</span><span style="color: black;">&#41;</span> 
<span style="color: black;">&#91;</span>GCC 4.6.3<span style="color: black;">&#93;</span> on linux2
Type <span style="color: #483d8b;">&quot;help&quot;</span>, <span style="color: #483d8b;">&quot;copyright&quot;</span>, <span style="color: #483d8b;">&quot;credits&quot;</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #483d8b;">&quot;license&quot;</span> <span style="color: #ff7700;font-weight:bold;">for</span> more information.
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> wiringpi
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> INPUT=<span style="color: #ff4500;">0</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> OUTPUT=<span style="color: #ff4500;">1</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> HIGH=<span style="color: #ff4500;">1</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> LOW=<span style="color: #ff4500;">0</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> SETUP=wiringpi.<span style="color: black;">wiringPiSetup</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> SETUP
<span style="color: #ff4500;">0</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> wiringpi.<span style="color: black;">pinMode</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">7</span>,INPUT<span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> RESULT=wiringpi.<span style="color: black;">digitalRead</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> RESULT
<span style="color: #ff4500;">1</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> RESULT=wiringpi.<span style="color: black;">digitalRead</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> RESULT
<span style="color: #ff4500;">1</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> RESULT=wiringpi.<span style="color: black;">digitalRead</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> RESULT
<span style="color: #ff4500;">0</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span></pre></div></div>

<p>These basics convince me to go ahead with my goal of having a <a href="http://www.adafruit.com/products/419" title="Adafruit: Membrane Matrix Keypad 3x4" target="_blank">membrane (matrix) keypad</a> as input for Raspberry Pi to run some script (see <a href="../../../2013/03/raspberry-pi-membrane-matrix-keypad-gpio-input-2/" title="Raspberry Pi: Membrane (Matrix) Keypad as GPIO Input" target="_blank">next post</a>).</p>
<p>(Check also <a href="./2013/03/raspberry-pi-common-usb-problems/" title="Raspberry Pi Common USB Problems" target="_blank">RPi common USB problems post</a>)</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2013/03/raspberry-pi-gpio-input-button-basics-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
