<?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; USB</title>
	<atom:link href="https://lakm.us/logit/tag/usb/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>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>USB WiFi Stick on Beagleboard xM Using wpa_supplicant</title>
		<link>https://lakm.us/logit/2012/03/usb-wifi-stick-beagleboard-xm-wpa_supplicant/</link>
		<comments>https://lakm.us/logit/2012/03/usb-wifi-stick-beagleboard-xm-wpa_supplicant/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 04:28:48 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[General Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[device driver]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=366</guid>
		<description><![CDATA[One of the most popular USB WiFi sticks in Indonesian market is TP Link which is actually a Ralink wireless adapter (looking at its vendor ID code). Attaching it using wpa_supplicant without explicit driver assignment will return the following error lines ioctl&#91;SIOCSIWENCODEEXT&#93;: Invalid argument ioctl&#91;SIOCSIWENCODEEXT&#93;: Invalid argument Within minutes it will also crash the system [...]]]></description>
				<content:encoded><![CDATA[<p>One of the most popular USB WiFi sticks in Indonesian market is <a href="http://www.tp-link.com/en/products/details/?model=TL-WN321G" title="TL-WN321G" target="_blank">TP Link</a> which is actually a Ralink wireless adapter (looking at its vendor ID code). Attaching it using <code>wpa_supplicant</code> without explicit driver assignment will return the following error lines</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ioctl<span style="color: #7a0874; font-weight: bold;">&#91;</span>SIOCSIWENCODEEXT<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Invalid argument
ioctl<span style="color: #7a0874; font-weight: bold;">&#91;</span>SIOCSIWENCODEEXT<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Invalid argument</pre></div></div>

<div class="wp-caption aligncenter" style="width: 460px"><img alt="TL-WN321G-01.jpg" src="../../../../images/TL-WN321G-01.jpg" title="TP Link TL-WN321G USB WiFi Stick" width="450" height="270" /><p class="wp-caption-text">TP Link TL-WN321G USB WiFi Stick</p></div>
<p>Within minutes it will also crash the system with messages similar to:</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;">5645.279693</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> SysRq : HELP : loglevel<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> reBoot Crash terminate-all-tasks<span style="color: #7a0874; font-weight: bold;">&#40;</span>E<span style="color: #7a0874; font-weight: bold;">&#41;</span> memory-full-oom-kill<span style="color: #7a0874; font-weight: bold;">&#40;</span>F<span style="color: #7a0874; font-weight: bold;">&#41;</span> kill-all-tasks<span style="color: #7a0874; font-weight: bold;">&#40;</span>I<span style="color: #7a0874; font-weight: bold;">&#41;</span> thaw-filesystems<span style="color: #7a0874; font-weight: bold;">&#40;</span>J<span style="color: #7a0874; font-weight: bold;">&#41;</span> saK show-backtrace-all-active-cpus<span style="color: #7a0874; font-weight: bold;">&#40;</span>L<span style="color: #7a0874; font-weight: bold;">&#41;</span> show-memory-usage<span style="color: #7a0874; font-weight: bold;">&#40;</span>M<span style="color: #7a0874; font-weight: bold;">&#41;</span> nice-all-RT-tasks<span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span> powerOff show-registers<span style="color: #7a0874; font-weight: bold;">&#40;</span>P<span style="color: #7a0874; font-weight: bold;">&#41;</span> show-all-timers<span style="color: #7a0874; font-weight: bold;">&#40;</span>Q<span style="color: #7a0874; font-weight: bold;">&#41;</span> unRaw Sync show-task-states<span style="color: #7a0874; font-weight: bold;">&#40;</span>T<span style="color: #7a0874; font-weight: bold;">&#41;</span> Unmount ETM buffer dump show-blocked- tasks<span style="color: #7a0874; font-weight: bold;">&#40;</span>W<span style="color: #7a0874; font-weight: bold;">&#41;</span> dump-ftrace-buffer<span style="color: #7a0874; font-weight: bold;">&#40;</span>Z<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>The correct way to attach is</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wpa_supplicant <span style="color: #660033;">-B</span> <span style="color: #660033;">-Dnl80211</span> <span style="color: #660033;">-iwlan0</span> -c<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>wpa_supplicant.conf</pre></div></div>

<p>The config file content is just like what the <a href="https://help.ubuntu.com/community/WifiDocs/Adhoc#Encryption" title="https://help.ubuntu.com/community/WifiDocs/Adhoc#Encryption" target="_blank">community help</a> suggested. The stick with vendor &#038; product ID of <code>148f:2573</code> has been part of the <code>nl80211</code> development at <a href="http://linuxwireless.org/en/developers/Documentation/nl80211" title="http://linuxwireless.org/en/developers/Documentation/nl80211" target="_blank">Linux Wireless</a>.</p>
<p><code>wpa_supplicant</code> version is <code>v0.7.3</code>. Ubuntu version is 11.10 as described further in <a href="./2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/" title="Ubuntu on Beagleboard xM with Easycap Video Capture (Compiling Driver)" target="_blank">previous post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/03/usb-wifi-stick-beagleboard-xm-wpa_supplicant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile USB Serial Modem Using option.c (Ubuntu on Beagleboard xM)</title>
		<link>https://lakm.us/logit/2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/</link>
		<comments>https://lakm.us/logit/2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 08:54:18 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[General Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=341</guid>
		<description><![CDATA[Despite possibility to use (1) $ modprobe -v usbserial vendor=0x05c6 product=0x0015 or (2) usb-modeswitch, (3) Matthias Urlichs initially wrote option.c driver as a way to insert USB modem as kernel module. This driver exists because the &#8220;normal&#8221; serial driver doesn&#8217;t work too well with GSM modems. Issues: - data loss &#8212; one single Receive URB [...]]]></description>
				<content:encoded><![CDATA[<p>Despite possibility to use (1)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ modprobe <span style="color: #660033;">-v</span> usbserial <span style="color: #007800;">vendor</span>=0x05c6 <span style="color: #007800;">product</span>=0x0015</pre></div></div>

<p>or (2) <code>usb-modeswitch</code>, (3) <a href="http://matthias.urlichs.de/">Matthias Urlichs</a> initially wrote <code>option.c</code> driver as a way to insert USB modem as kernel module.</p>
<blockquote><p>This driver exists because the &#8220;normal&#8221; serial driver doesn&#8217;t work too well<br />
with GSM modems. Issues:<br />
- data loss &#8212; one single Receive URB is not nearly enough<br />
- nonstandard flow (Option devices) control<br />
- controlling the baud rate doesn&#8217;t make sense</p></blockquote>
<p>Most modems will be successfully attached with this driver, appearing in one of the typical <code>/dev/ttyUSB0</code> to <code>/dev/ttyUSB2</code>. The product ID <code>0x0015</code> for GSM modem compiled here is a Qualcomm (vendor ID 0x05c6) OEM modem I received from <a href="http://www.armkits.com/product/devkit8500d.asp">Embest DevKit8500D</a> order. There are more than one form factor when searching for its images on Google. Closest one we have in Indonesia is ADVAN DT8-HT bundled in <a href="http://www.telkomsel.com/telkomselflash">Telkomsel Flash</a>.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="qualcomm-05c6-0015-telkomsel-advan.jpg" src="../../../../images/qualcomm-05c6-0015-telkomsel-advan.jpg" title="qualcomm-05c6-0015-telkomsel-advan.jpg" class="aligncenter" width="250" height="172" /><p class="wp-caption-text">Qualcomm 05c6:0015 from Indonesian operator</p></div>
<p>I&#8217;m compiling it for the <a href="http://beagleboard.org/hardware-xM">Beagleboard xM</a> Rev C running Ubuntu Oneiric (installed in <a href="../2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver">this post</a>). A quick look gives:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation <span style="color: #000000;">2.0</span> root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation <span style="color: #000000;">2.0</span> root hub
Bus 001 Device 002: ID 0424:<span style="color: #000000;">9514</span> Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 05c6:0015 Qualcomm, Inc.</pre></div></div>

<p>The above <code>0x0015</code> product ID doesn&#8217;t exist inside <code>option.c</code> of linux <a href="https://launchpad.net/ubuntu/+source/linux/3.0.0-12.20">kernel 3.0.0-12 source</a>. Adding this to series of existing Qualcomm modems gives:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>635
636
637
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">	<span style="color: #7a0874; font-weight: bold;">&#123;</span> USB_DEVICE<span style="color: #7a0874; font-weight: bold;">&#40;</span>QUALCOMM_VENDOR_ID, 0x6000<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #000000; font-weight: bold;">/*</span> ZTE AC8700 <span style="color: #000000; font-weight: bold;">*/</span>
	<span style="color: #7a0874; font-weight: bold;">&#123;</span> USB_DEVICE<span style="color: #7a0874; font-weight: bold;">&#40;</span>QUALCOMM_VENDOR_ID, 0x6613<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #000000; font-weight: bold;">/*</span> Onda H600<span style="color: #000000; font-weight: bold;">/</span>ZTE MF330 <span style="color: #000000; font-weight: bold;">*/</span>
	<span style="color: #7a0874; font-weight: bold;">&#123;</span> USB_DEVICE<span style="color: #7a0874; font-weight: bold;">&#40;</span>QUALCOMM_VENDOR_ID, 0x0015<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #000000; font-weight: bold;">/*</span> Qualcomm no brand <span style="color: #000000; font-weight: bold;">*/</span></pre></td></tr></table></div>

<p>The <code>include</code> also needs <code>usb-wwan.h</code> from that kernel source. Copy them both under  <code>/usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/</code>. For other <code>include</code> files, install:</p>
<ol>
<li><a href="http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/linux-headers-3.0.0-12_3.0.0-12.20_all.deb">linux-headers-3.0.0-12_3.0.0-12.20_all.deb</a></li>
<li><a href="https://launchpad.net/ubuntu/oneiric/armel/linux-image-3.0.0-12-omap/3.0.0-12.20">linux-image-3.0.0-12-omap_3.0.0-12.20_armel.deb</a></li>
</ol>
<p>and create this link as <code>root</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</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>linux-headers-3.0.0-<span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">/</span>arch<span style="color: #000000; font-weight: bold;">/</span>arm<span style="color: #000000; font-weight: bold;">/</span>mach-versatile<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mach mach</pre></td></tr></table></div>

<p>After removing the old one (pointed to <code>build -> /build/buildd/linux-3.0</code>), create a link inside <code>/lib/modules/3.0.6-x3</code> named <code>build</code> pointing to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">build -<span style="color: #000000; font-weight: bold;">&gt;</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>linux-headers-3.0.6-x3</pre></div></div>

<p>Modify the original <code>Makefile</code> to contain only rule for <code>option.o</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">obj-m			+= option.o</pre></div></div>

<p>and then build the driver</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: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">M</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>serial<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>: Entering directory <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>linux-headers-3.0.6-x3<span style="color: #ff0000;">'
  LD      /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/built-in.o
  CC [M]  /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/option.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/option.mod.o
  LD [M]  /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/option.ko
make: Leaving directory `/usr/src/linux-headers-3.0.6-x3`</span></pre></div></div>

<p>Copy the build and deploy</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>serial<span style="color: #000000; font-weight: bold;">/</span>option.ko <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>serial<span style="color: #000000; font-weight: bold;">/</span>
$ depmod <span style="color: #660033;">-a</span></pre></div></div>

<p>Now <code>syslog</code> will show the following lines if the modem is inserted:</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;">4790.229888</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter now attached to ttyUSB0
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.237121</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> option <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>:<span style="color: #000000;">1.0</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter detected
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.238250</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter now attached to ttyUSB1
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.240142</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> option <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>:<span style="color: #000000;">1.1</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter detected
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.241210</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter now attached to ttyUSB2
mtp-probe: checking bus <span style="color: #000000;">1</span>, device <span style="color: #000000;">9</span>: <span style="color: #ff0000;">&quot;/sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-2/1-2.5&quot;</span>
mtp-probe: bus: <span style="color: #000000;">1</span>, device: <span style="color: #000000;">9</span> was not an MTP device
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4791.227294</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> scsi <span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>: Direct-Access     Qualcomm MMC Storage      <span style="color: #000000;">2.31</span> PQ: <span style="color: #000000;">0</span> ANSI: <span style="color: #000000;">2</span>
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4791.232238</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> sd <span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>: Attached scsi generic sg0 <span style="color: #7a0874; font-weight: bold;">type</span> <span style="color: #000000;">0</span>
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4791.246887</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> sd <span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>sda<span style="color: #7a0874; font-weight: bold;">&#93;</span> Attached SCSI removable disk</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu on Beagleboard xM with Easycap Video Capture (Compiling Driver)</title>
		<link>https://lakm.us/logit/2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/</link>
		<comments>https://lakm.us/logit/2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 12:25:58 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[video capture]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=233</guid>
		<description><![CDATA[Attempt to run Ubuntu in BeagleBoard xM rev C board has taken me to try various options of kernel and release. The goal was to have both Ubuntu and widely-available Easycap as video input via the USB of this compact TI OMAP board. Porting Ubuntu would spare us some flexibility to try different alternatives of [...]]]></description>
				<content:encoded><![CDATA[<p>Attempt to run Ubuntu in <a href="http://beagleboard.org/hardware-xM">BeagleBoard xM</a> rev C board has taken me to try various options of kernel and release. The goal was to have both Ubuntu and widely-available <a href="http://easycap.co.uk/">Easycap</a> as video input via the USB of this compact TI OMAP board. Porting Ubuntu would spare us some flexibility to try different alternatives of video processing and networking options for the stream. The easiest way initially was to run Ubuntu preinstalled image. I had two popular options immediately: 1) Ubuntu Port CD Image release 2) Robert C. Nelson custom image (rootfs). I started with the later first to see the board running at once. The latest found in <a href="http://rcn-ee.net/deb/rootfs/">http://rcn-ee.net/deb/rootfs/</a> was ubuntu-11.10-r0-minimal-armel.tar.xz which gave me Ubuntu 11.10 Oneiric with custom linux 3.0.3-x2 kernel.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="Easycap USB Video-Audio Capture.jpg" src="../../../../images/easycap.jpg" title="Easycap USB Video-Audio Capture" class="aligncenter" width="138" height="127" /><p class="wp-caption-text">Easycap USB Video-Audio Capture</p></div>
<p>It turned out that this custom kernel hadn&#8217;t been compiled with<del datetime="2013-03-25T02:25:52+00:00">out</del> Easycap. We can compare that to my laptop running linux 2.6.38-10 where it was part of its kernel compilation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>ubuntu-laptop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</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>linux-headers-2.6.38-<span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span>.config <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> easy
<span style="color: #007800;">CONFIG_EASYCAP</span>=m</pre></div></div>

<p>Compiling the whole thing using <code>make menuconfig</code> to change <code>.config</code> file and so on seemed too much. A more partial approach was to touch only relevant <code>Makefile</code> involved in building the driver. First we needed the kernel header files provided as <a href="http://rcn-ee.net/deb/oneiric/v3.0.6-x3/linux-headers-3.0.6-x3_1.0oneiric_armel.deb">linux-headers-3.0.6-x3_1.0oneiric_armel.deb</a> and then source files for Easycap. As this was custom kernel, by guessing I found that it was closest to official linux 3.0.0-12.20 at <a href="https://launchpad.net/ubuntu/+source/linux/3.0.0-12.20">launchpad</a>, hence easycap source files were copied from it (the custom kernel might&#8217;ve been forked from this release as some random header files comparison to <code>linux-headers-3.0.0-12-omap_3.0.0-12.20_armel</code> returned no difference).</p>
<p>FYI Easycap linux driver is no longer developed separately as a SourceForge project, it has been part of <code>drivers/staging</code> in recent kernel releases (where you get <code>dmesg</code> like &#8220;<em>module is from the staging directory, the quality is unknown, you have been warned</em>&#8221; when inserting it). In the source we&#8217;ll find <code>/linux-3.0/drivers/staging/easycap/</code> to be copied into <code>/usr/src/linux-headers-3.0.6-x3/drivers/staging/easycap/</code> on the board.</p>
<p>After removing the old one (pointed to  <code>build -> /build/buildd/linux-3.0</code>), I created a link inside <code>/lib/modules/3.0.6-x3</code> named <code>build</code> pointing to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">build -<span style="color: #000000; font-weight: bold;">&gt;</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>linux-headers-3.0.6-x3</pre></div></div>

<p>then copied the <code>Makefile</code> from my laptop to replace original Easycap source with this content of rules:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">obj-m	+= easycap.o
&nbsp;
easycap-y	:= easycap_main.o easycap_low.o easycap_sound.o
easycap-y	+= easycap_ioctl.o easycap_settings.o
easycap-y	+= easycap_testcard.o
&nbsp;
ccflags-y := <span style="color: #660033;">-Wall</span>
<span style="color: #666666; font-style: italic;"># Impose all or none of the following:</span>
ccflags-y += -DEASYCAP_IS_VIDEODEV_CLIENT
ccflags-y += -DEASYCAP_NEEDS_V4L2_DEVICE_H
ccflags-y += -DEASYCAP_NEEDS_V4L2_FOPS
ccflags-y += -DEASYCAP_NEEDS_UNLOCKED_IOCTL</pre></div></div>

<p>Compiling should work afterward:</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: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">M</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>
  LD      <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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>built-in.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_main.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_low.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_sound.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_ioctl.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_settings.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_testcard.o
  LD <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap.o
  Building modules, stage 2.
  MODPOST <span style="color: #000000;">1</span> modules
  CC      <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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap.mod.o
  LD <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</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>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap.ko
<span style="color: #c20cb9; font-weight: bold;">make</span>: Leaving directory <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>linux-headers-3.0.6-x3<span style="color: #ff0000;">'</span></pre></div></div>

<p>I tried to <code>insmod</code> the <code>easycap.ko</code> built, but dmesg showed some error and no <code>/dev/video0</code> created. There must be some other drivers that must be loaded first which I didn&#8217;t know in what sequence (i.e. <code>v4l2-common</code> etc.), hence I decided to just copy that under the <code>/lib/modules/3.0.6-x3/kernel/drivers/staging/easycap</code>, <code>depmod -a</code>, <del datetime="2012-01-10T04:33:20+00:00">and reboot</del>.</p>
<p>If you plug the Easycap while inspecting the <code>syslog</code> tail, there won&#8217;t be similar message as found in kernel 2.6.38-10. Instead, you&#8217;ll see:</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;">1377.696838</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.3</span>: new high speed USB device number <span style="color: #000000;">6</span> using ehci-omap
mtp-probe: checking bus <span style="color: #000000;">1</span>, device <span style="color: #000000;">6</span>: <span style="color: #ff0000;">&quot;/sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-2/1-2.3&quot;</span>
mtp-probe: bus: <span style="color: #000000;">1</span>, device: <span style="color: #000000;">6</span> was not an MTP device
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1378.052459</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Linux video capture interface: v2.00
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1378.169006</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Easycap version: 0.9.01
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1378.198944</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usbcore: registered new interface driver snd-usb-audio
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.043853</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_standard: selected standard: PAL_BGHIN
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.151245</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    640x480,UYVY<span style="color: #7a0874; font-weight: bold;">&#40;</span>0x59565955<span style="color: #7a0874; font-weight: bold;">&#41;</span>,<span style="color: #000000;">1</span>=field,<span style="color: #000000;">0</span><span style="color: #007800;">x00</span>=std mask
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.151306</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    V4L2_FIELD_NONE
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.151336</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.181488</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_brightness: adjusting brightness to  0x7F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.184478</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_contrast: adjusting contrast to  0x3F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.212768</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_saturation: adjusting saturation to  0x2F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.214599</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_hue: adjusting hue to  0x00
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.219207</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0easycap_usb_probe: registered with videodev: <span style="color: #000000;">0</span>=minor
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.219238</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0easycap_usb_probe: ends successfully <span style="color: #000000; font-weight: bold;">for</span> interface <span style="color: #000000;">0</span>
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.219543</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usbcore: registered new interface driver easycap
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.314453</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap:: easycap_open: ==========<span style="color: #007800;">OPEN</span>=========
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.031188</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_standard: selected standard: PAL_BGHIN
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.228759</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    640x480,UYVY<span style="color: #7a0874; font-weight: bold;">&#40;</span>0x59565955<span style="color: #7a0874; font-weight: bold;">&#41;</span>,<span style="color: #000000;">1</span>=field,<span style="color: #000000;">0</span><span style="color: #007800;">x00</span>=std mask
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.228790</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    V4L2_FIELD_NONE
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.228851</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.233489</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_brightness: adjusting brightness to  0x7F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.235198</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_contrast: adjusting contrast to  0x3F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.237884</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_saturation: adjusting saturation to  0x2F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.239501</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_hue: adjusting hue to  0x00</pre></div></div>

<p>Later I find out that newer image is available on the Robert&#8217;s site, but not sure which linux source I should use for the Easycap if I were to to use it. Anyway, before deciding to just go with this one I&#8217;ve tried various kernels. Here are list of images and their kernel versions (I wasn&#8217;t quite sure which one was running smoothly and which wasn&#8217;t):</p>
<ol>
<li>linux-2.6.35.9-l9 Ubuntu 10.04 Lucid: ubuntu-10.04.1-r4-minimal-armel.tar</li>
<li>linux-3.1.4-x6 Ubuntu 11.10 Oneiric: ubuntu-11.10-r2-minimal-armel.tar.xz</li>
<li>linux-3.1.4-x6 Ubuntu 11.04 Natty: ubuntu-11.04-r7-minimal-armel.tar.xz</li>
<li>linux-2.6.38.2-d9 Ubuntu 10.10 Maverick: ubuntu-10.10-r6-minimal-armel.tar.xz</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
