<?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; BeagleBoard</title>
	<atom:link href="https://lakm.us/logit/tag/beagleboard/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>Duplicate/Restore ARM Linux Image to MMC/SD Card (BeagleBoard and DevKit ARM)</title>
		<link>https://lakm.us/logit/2013/03/duplicate-restore-arm-linux-image-mmc-sd-card-beagleboard-devkit-board/</link>
		<comments>https://lakm.us/logit/2013/03/duplicate-restore-arm-linux-image-mmc-sd-card-beagleboard-devkit-board/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 10:02:45 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[backup/restore]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[DevKit8500D]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[rootfs]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=530</guid>
		<description><![CDATA[By booting from MMC/SD card, you can bring up your BeagleBoard-xM or DevKit8500D (both are ARMv7). It is the only way for the xM (microSD card to be exact), while with DevKit, you have the option to flash it to the board for NAND-boot once you&#8217;re sure that it works with SD card. eLinux wiki [...]]]></description>
				<content:encoded><![CDATA[<p>By booting from MMC/SD card, you can bring up your <a href="http://beagleboard.org/hardware-xM" target="_blank">BeagleBoard-xM</a> or <a href="http://www.armkits.com/product/devkit8500d.asp" target="_blank">DevKit8500D</a> (both are <a href="http://en.wikipedia.org/wiki/ARM_Cortex-A8" target="_blank">ARMv7</a>). It is the only way for the xM (microSD card to be exact), while with DevKit, you have the option to flash it to the board for NAND-boot once you&#8217;re sure that it works with SD card. <a href="http://elinux.org" target="_blank">eLinux wiki</a> has some sections about the card setup e.g. <a href="http://elinux.org/BeagleBoardDebian" target="_blank">Debian setup</a>, how to <a href="http://elinux.org/BeagleBoard#U-Boot_booting" target="_blank">start from U-boot prompt</a>, etc.</p>
<p>In the Debian example, the wiki introduced <a href="http://elinux.org/BeagleBoardDebian#Debian_NetInstall" target="_blank">NetInstall</a>. Later I find out the <code>mk_mmc.sh</code> script shown there to be useful for (1) duplicating and (2) restoring working Linux backup to new or corrupted MMC/SD card. I break down that <a href="https://github.com/RobertCNelson/netinstall/blob/bd32dd39732ccf33bfec8895c809f0d4fa79c95c/mk_mmc.sh" title="mk_mmc.sh (tree bd32dd3973)" target="_blank">Robert C. Nelson&#8217;s <code>mk_mmc.sh</code> script at GitHub</a> to small routines for setting up the card.</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="typical-sd-card-partition-arm-linux-board.png" src="../../../../images/typical-sd-card-partition-arm-linux-board.png" title="Typical boot-rootfs partitions of SD card to boot ARM-Linux boards" width="334" height="131" /><p class="wp-caption-text">Typical boot-rootfs partitions of SD card to boot ARM-Linux boards</p></div>
<p>It&#8217;s an elegant script automating the process of preparing SD card for embedded Linux, but requires large downloading on the run (mostly root file system and then <a href="http://www.denx.de/wiki/U-Boot" title="Das U-Boot" target="_blank">U-Boot</a> binaries and loader config). Duplicating/restoring means we already have those and probably only need to do elementary process rather than full card preparation. Below are some processes that can be repeatedly used.</p>
<p><span id="more-530"></span><a id="Checking.Version" href="#Checking.Version" rel="bookmark" title="Checking Tool Versions"><br />
<h4>Checking Tool Versions</h4>
<p></a></p>
<p>The tools to work with are common in Linux distribution (I used Ubuntu) and require <code>root</code> privilege. The script checked for <code>fdisk</code> and <code>parted</code> installed. My versions are</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ fdisk <span style="color: #660033;">-v</span>
fdisk <span style="color: #7a0874; font-weight: bold;">&#40;</span>util-linux-ng 2.17.2<span style="color: #7a0874; font-weight: bold;">&#41;</span>
$ parted <span style="color: #660033;">-v</span>
parted <span style="color: #7a0874; font-weight: bold;">&#40;</span>GNU parted<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2.2</span></pre></div></div>

<p>Originally <code>mk_mmc.sh</code> will exit If &#8220;<code>GNU Fdisk</code>&#8221; found instead. Also for the above <code>parted</code> version, &#8220;<code>--align cylinder</code>&#8221; argument will be used.</p>
<p><a id="Creating.Partitions" href="#Creating.Partitions" rel="bookmark" title="Creating Two Partitions"><br />
<h4>Creating Two Partitions</h4>
<p></a></p>
<p>Setting up two partitions which are the boot image (<code>FAT 16</code>) and root file system (<code>ext4</code>). The SD card plugged in through USB card reader found as <code>/dev/sdb</code> in this example (<strong>we&#8217;re formatting be sure of this!</strong>). If you plug MMC card to laptop slot, it may be found as <code>/dev/mmcblk0</code>. </p>
<ol>
<li>Format card into a single disk</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ parted <span style="color: #660033;">--script</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb mklabel msdos
$ fdisk <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb</pre></div></div>

<li>Create the boot partition (allocating 64MB)</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ fdisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb <span style="color: #cc0000; font-style: italic;">&lt;&lt; END
n
p
1
1
+64M
t
e
p
w
END</span></pre></div></div>

<p>then make sure it&#8217;s done.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sync</span></pre></div></div>

<li>Flag it as <code>boot</code></li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ parted <span style="color: #660033;">--script</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #000000;">1</span> boot on</pre></div></div>

<li>Create the root file system by first determining space left after the first partition</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">END_BOOT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">LC_ALL</span>=C parted <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb unit mb print <span style="color: #c20cb9; font-weight: bold;">free</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> primary <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;M&quot;</span> -f1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$END_BOOT</span> 
<span style="color: #000000;">69.7</span>
$ <span style="color: #007800;">END_DEVICE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">LC_ALL</span>=C parted <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb unit mb print <span style="color: #c20cb9; font-weight: bold;">free</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Free <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;M&quot;</span> -f1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$END_DEVICE</span> 
<span style="color: #000000;">3951</span></pre></div></div>

<p>In this case 4GB SD card is used and the above calculation will stretch space left from 69.7 to 3951 of as <code>rootfs</code> partition.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ parted <span style="color: #660033;">--script</span> <span style="color: #660033;">--align</span> cylinder <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb mkpart primary ext4 <span style="color: #007800;">$END_BOOT</span> <span style="color: #007800;">$END_DEVICE</span></pre></div></div>

<li>Format <code>boot</code> and <code>rootfs</code> according to each file system type with those naming also. They&#8217;re already accessible as <code>/dev/sdb1</code> and <code>/dev/sdb2</code> (previously didn&#8217;t exist) or relevant <code>/dev/mmcblk0p(some index)</code>.</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mkfs.vfat <span style="color: #660033;">-F</span> <span style="color: #000000;">16</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #660033;">-n</span> boot
$ mkfs.ext4 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 <span style="color: #660033;">-L</span> rootfs</pre></div></div>

<li>Finally we have something like the output of <code>parted</code> below</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">LC_ALL</span>=C parted <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb unit mb print <span style="color: #c20cb9; font-weight: bold;">free</span> 
Model: HUAWEI MMC Storage <span style="color: #7a0874; font-weight: bold;">&#40;</span>scsi<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Disk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb: 4023MB
Sector <span style="color: #c20cb9; font-weight: bold;">size</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>logical<span style="color: #000000; font-weight: bold;">/</span>physical<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 512B<span style="color: #000000; font-weight: bold;">/</span>512B
Partition Table: msdos
&nbsp;
Number  Start   End     Size    Type     File system  Flags
 <span style="color: #000000;">1</span>      0.03MB  70.9MB  70.8MB  primary  fat16        boot, lba
        70.9MB  4023MB  3953MB           Free Space</pre></div></div>

<p><em>(yes I used Huawei modem as the microSD card reader)</em>
</ol>
<p><a id="Restoring.Linux" href="#Restoring.Linux" rel="bookmark" title="Restoring Linux"><br />
<h4>Restoring Linux</h4>
<p></a></p>
<p>For the <code>boot</code> partition content we can simply copy-paste the backup files, while for <code>rootfs</code> normally compressed file (preserving path information) is used for backup. Restore this by mounting <code>rootfs</code> and then unpacking the file (again <code>/dev/sdb2</code> in this case).</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: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> ext4 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pv armel-rootfs-201110131018.tar <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">--numeric-owner</span> <span style="color: #660033;">--preserve-permissions</span> <span style="color: #660033;">-xf</span> - <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs</pre></div></div>

<p>Below is an example of how to backup <code>rootfs</code> from the mounted SD card (<code>/media/rootfs</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: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs<span style="color: #666666; font-style: italic;"># tar --numeric-owner --preserve-permissions -cvf /home/arif/Documents/arm-linux/ubuntu/rootstock-rootfs/armel-rootfs-201202141421.tar ./*</span></pre></div></div>

<p>(Check <a href="../../../2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/" title="Running Ubuntu on DevKit8500D (Natty Kernel and Lucid RootFS)" target="_blank">my other post related to creating <code>rootfs</code></a>)</p>
<p><a id="Creating.Swap" href="#Creating.Swap" rel="bookmark" title="Creating Swap"><br />
<h4>Creating Swap</h4>
<p></a></p>
<p><code>mk_mmc.sh</code> also offers optional <code>swap</code> creation. It is a &#8220;file&#8221; inside <code>rootfs</code> partition created by</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: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs<span style="color: #000000; font-weight: bold;">/</span>SWAP.swap <span style="color: #007800;">bs</span>=1M <span style="color: #007800;">count</span>=<span style="color: #000000;">250</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ mkswap <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs<span style="color: #000000; font-weight: bold;">/</span>SWAP.swap</pre></div></div>

<p>(the above will create 262MB swap inside <code>rootfs</code> SD card currently mounted to <code>/media/rootfs</code> of the laptop)</p>
<p>It will be mounted as <code>swap</code> by the ARM-Linux board via <code>fstab</code> setting configured below.</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: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;/SWAP.swap  none  swap  sw  0 0&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

<p>Synchronize and safely remove the card</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: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">sync</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>host<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>rootfs</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2013/03/duplicate-restore-arm-linux-image-mmc-sd-card-beagleboard-devkit-board/feed/</wfw:commentRss>
		<slash:comments>0</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>Cross-Compiling for Ubuntu ARM by ffmpeg Example</title>
		<link>https://lakm.us/logit/2012/11/cross-compiling-ubuntu-arm-ffmpeg/</link>
		<comments>https://lakm.us/logit/2012/11/cross-compiling-ubuntu-arm-ffmpeg/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 10:02:03 +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[compile]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[make-install]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=409</guid>
		<description><![CDATA[This has been a delayed post since I only figure out how to solve configure error just now. It wasn&#8217;t really necessary to cross-compile last year because compiling ffmpeg directly on the ARM-board finished overnight (despite the low CPU). Anyway, in this post I&#8217;m still using the board to easily retrieve package dependencies from Ubuntu [...]]]></description>
				<content:encoded><![CDATA[<p>This has been a delayed post since I only figure out how to solve <code>configure</code> error just now. It wasn&#8217;t really necessary to cross-compile last year because compiling <code><a href="https://ffmpeg.org/" title="FFMPEG" target="_blank">ffmpeg</a></code> directly on the ARM-board finished overnight (despite the low CPU). Anyway, in this post I&#8217;m still using the board to easily retrieve package dependencies from Ubuntu ARM repository. Toolchain used is <code>arm-linux-gnueabi-gcc-</code>. The following steps will apply in general:</p>
<ol>
<li> download source file (that is <code>ffmpeg</code> in this example)</li>
<li>retrieve development library/build dependecies</li>
<li>place header files and dependency libraries into toolchain path</li>
<li><code>configure</code> with toolchain</li>
<li><code>make</code> and create <code>.deb</code> installer package with <code>checkinstall</code></li>
</ol>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="cross-compile-desktop-and-arm-board-illustration.png" src="../../../../images/cross-compile-desktop-and-arm-board-illustration.png" title="cross-compile: what&#039;s done on desktop &#038; what&#039;s done on ARM-board" width="350" height="207" /><p class="wp-caption-text">cross-compile: Illustration of what&#039;s done on ARM-board and what&#039;s  done on desktop</p></div>
<p>Prior to anything, install <a href="http://www.linaro.org/" title="Linaro" target="_blank">Linaro</a> toolchain by adding their repo first:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> add-apt-repository ppa:linaro-maintainers<span style="color: #000000; font-weight: bold;">/</span>toolchain
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gcc-arm-linux-gnueabi</pre></div></div>

<p>A complete guide on how to compile ffmpeg can be found in their <a href="https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid" title="Compile FFmpeg on Ubuntu Lucid Lynx 10.04 LTS" target="_blank">wiki</a>. It applies generally. So, I&#8217;ll just skip to following <code>configure</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>ubuntu-desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--cross-prefix</span>=arm-linux-gnueabi- <span style="color: #660033;">--enable-cross-compile</span> <span style="color: #660033;">--target-os</span>=linux <span style="color: #660033;">--arch</span>=arm  <span style="color: #660033;">--cpu</span>=cortex-a8 <span style="color: #660033;">--extra-cflags</span>=<span style="color: #ff0000;">'-march=armv7-a -mfpu=neon -mfloat-abi=softfp'</span> <span style="color: #660033;">--enable-libtheora</span></pre></div></div>

<p><span id="more-409"></span></p>
<p>As an example, the above configure requires <a href="http://www.theora.org/downloads/" title="Theora" target="_blank">Theora</a> libraries. <code><a href="http://packages.ubuntu.com/lucid/libtheora-dev" title="http://packages.ubuntu.com/oneiric/libtheora-dev" target="_blank">libtheora-dev</a></code> itself requires <code>libogg-dev</code>. Use <code>apt-get</code> on the board to get them from Ubuntu ARM repository. Get the <code>.deb</code> files from <code>/var/cache/apt/archives/</code> of the ARM-board to your desktop and extract them as <code>root</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: #000000; font-weight: bold;">@</span>ubuntu-desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-x</span> libogg-dev_1.2.2~dfsg-1ubuntu1_armel.deb <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>cross-compile
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ubuntu-desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-x</span> libtheora-dev_1.1.1+dfsg.1-<span style="color: #000000;">3</span>_armel.deb <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>cross-compile</pre></div></div>

<p>The above <code>/usr/local/cross-compile</code> is just a temporary directory. The toolchain needs header files and dependency libraries to be placed inside <code>/usr/arm-linux-gnueabi/include/</code> and <code>/usr/arm-linux-gnueabi/lib/</code> consecutively. In my case I created the following link for header&#8217;s <code>include</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: #000000; font-weight: bold;">@</span>ubuntu-desktop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <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>arm-linux-gnueabi<span style="color: #000000; font-weight: bold;">/</span>include
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ubuntu-desktop<span style="color: #7a0874; font-weight: bold;">&#93;</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>local<span style="color: #000000; font-weight: bold;">/</span>cross-compile<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>theora
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ubuntu-desktop<span style="color: #7a0874; font-weight: bold;">&#93;</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>local<span style="color: #000000; font-weight: bold;">/</span>cross-compile<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>ogg</pre></div></div>

<p>and copied these from <code>/usr/local/cross-compile/usr/lib</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">libogg.a
libogg.so
libtheora.a
libtheoradec.a
libtheoradec.la
libtheoradec.so
libtheoraenc.a
libtheoraenc.la
libtheoraenc.so
libtheora.la
libtheora.so</pre></div></div>

<p>After successful <code>configure</code>, run <code>make</code> (this will take some time), and then pack the whole working directory to the ARM-board. Instead of doing <code>make install</code> in the ARM-board, use <code>checkinstall</code> to install and create the <code>.deb</code> package. This way we can make use of <code>dpkg</code> to uninstall or re-install in the manner of package manager.</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: #000000; font-weight: bold;">@</span>beagleboard<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> checkinstall <span style="color: #660033;">--pkgname</span>=<span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">--pkgversion</span>=<span style="color: #ff0000;">&quot;5:<span style="color: #007800;">$(./version.sh)</span>&quot;</span> \
     <span style="color: #660033;">--backup</span>=no <span style="color: #660033;">--deldoc</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #660033;">--default</span></pre></div></div>

<p>Please mind that even if we put &#8220;<code>--install=no</code>&#8220;, the above <code>checkinstall</code> will overwrite all <code>ffmpeg</code> binaries in <code>/usr/local/bin/</code>. This is the reason why I move the process to the ARM-board: to keep other running version on my desktop stays as it is.</p>
<p>Check the test of streaming from our cross-compiled <code>ffmpeg</code> in previous <a href="./2012/11/simple-ffmpeg-udp-video-streaming-from-beagleboard-running-ubuntu" title="Simple FFMPEG UDP Video Streaming" target="_blank">post</a>.</p>
<h1>A Little History</h1>
<p>When first attempt to <code>configure</code> exited with <code>ERROR: libtheora not found</code>, I found the following test failed in the output log:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">$ arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">-</span>gcc <span style="color: #339933;">-</span>D_ISOC99_SOURCE <span style="color: #339933;">-</span>D_FILE_OFFSET_BITS<span style="color: #339933;">=</span><span style="color: #0000dd;">64</span> <span style="color: #339933;">-</span>D_LARGEFILE_SOURCE <span style="color: #339933;">-</span>D_POSIX_C_SOURCE<span style="color: #339933;">=</span><span style="color: #0000dd;">200112</span> <span style="color: #339933;">-</span>D_XOPEN_SOURCE<span style="color: #339933;">=</span><span style="color: #0000dd;">600</span> <span style="color: #339933;">-</span>march<span style="color: #339933;">=</span>armv7<span style="color: #339933;">-</span>a <span style="color: #339933;">-</span>mfpu<span style="color: #339933;">=</span>neon <span style="color: #339933;">-</span>mfloat<span style="color: #339933;">-</span>abi<span style="color: #339933;">=</span>softfp <span style="color: #339933;">-</span>mcpu<span style="color: #339933;">=</span>cortex<span style="color: #339933;">-</span>a8 <span style="color: #339933;">-</span>std<span style="color: #339933;">=</span>c99 <span style="color: #339933;">-</span>fomit<span style="color: #339933;">-</span>frame<span style="color: #339933;">-</span>pointer <span style="color: #339933;">-</span>marm <span style="color: #339933;">-</span>pthread <span style="color: #339933;">-</span>E <span style="color: #339933;">-</span>o <span style="color: #339933;">/</span>tmp<span style="color: #339933;">/</span>ffconf.<span style="color: #202020;">UdYctJgq</span>.<span style="color: #202020;">o</span> <span style="color: #339933;">/</span>tmp<span style="color: #339933;">/</span>ffconf.<span style="color: #202020;">mwXpf9Tl</span>.<span style="color: #202020;">c</span>
...
<span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>lib<span style="color: #339933;">/</span>gcc<span style="color: #339933;">/</span>arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">/</span>4.6.1<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>ld<span style="color: #339933;">:</span> cannot find <span style="color: #339933;">-</span>ltheoraenc
<span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>lib<span style="color: #339933;">/</span>gcc<span style="color: #339933;">/</span>arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">/</span>4.6.1<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>ld<span style="color: #339933;">:</span> cannot find <span style="color: #339933;">-</span>ltheoradec
<span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>lib<span style="color: #339933;">/</span>gcc<span style="color: #339933;">/</span>arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">/</span>4.6.1<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>arm<span style="color: #339933;">-</span>linux<span style="color: #339933;">-</span>gnueabi<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>ld<span style="color: #339933;">:</span> cannot find <span style="color: #339933;">-</span>logg</pre></div></div>

<p>What was inside the above temporary file (<code>/tmp/ffconf.mwXpf9Tl.c</code>):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;theora/theoraenc.h&gt;</span>
<span style="color: #993333;">int</span> x<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You can run that test to check whether all dependencies are met.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/11/cross-compiling-ubuntu-arm-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Simple ffmpeg UDP Video Streaming (from BeagleBoard running Ubuntu)</title>
		<link>https://lakm.us/logit/2012/11/simple-ffmpeg-udp-video-streaming-from-beagleboard-running-ubuntu/</link>
		<comments>https://lakm.us/logit/2012/11/simple-ffmpeg-udp-video-streaming-from-beagleboard-running-ubuntu/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 09:04:49 +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[ffmpeg]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[VLC]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=406</guid>
		<description><![CDATA[I really mean simple, this is a one command line UDP stream from the BeagleBoard (running Ubuntu ARM) to my desktop (IP address 192.168.1.19 in this example), the source video is an FLV file inside the ARM-board: $ ffmpeg -i UNIQLO_MIXPLAY.flv -v 0 -vcodec mpeg4 -f mpegts udp:192.168.1.19:1234 Although it&#8217;s a break-dance video, it plays [...]]]></description>
				<content:encoded><![CDATA[<p>I really mean simple, this is a one command line UDP stream from the BeagleBoard (running Ubuntu ARM) to my desktop (IP address <code>192.168.1.19</code> in this example), the source video is an FLV file inside the ARM-board:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> UNIQLO_MIXPLAY.flv <span style="color: #660033;">-v</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-vcodec</span> mpeg4 <span style="color: #660033;">-f</span> mpegts udp:192.168.1.19:<span style="color: #000000;">1234</span></pre></div></div>

<div class="wp-caption aligncenter" style="width: 460px"><img alt="ffmpeg-cross-compiled-flv-video-udp-streaming-test.jpg" src="../../../../images/ffmpeg-cross-compiled-flv-video-udp-streaming-test.jpg" title="ffmpeg streaming from BeagleBoard played by VLC on the desktop" width="420" height="365" /><p class="wp-caption-text">ffmpeg streaming from BeagleBoard played by VLC on the desktop</p></div>
<p>Although it&#8217;s a break-dance video, it plays uninterrupted, without any break. </p>
<p>Here is how my desktop see the stream with <a href="http://www.videolan.org/vlc/" title="VLC" target="_blank">VLC player</a>:</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="vlc-simple-udp-stream-test.png" src="../../../../images/vlc-simple-udp-stream-test.png" title="VLC setup (on the desktop) to play the UDP stream" width="354" height="100" /><p class="wp-caption-text">VLC setup (on the desktop) to play the UDP stream</p></div>
<p>With less documentation, a more complex setup with integration to <a href="http://www.wowza.com/" title="Wowza" target="_blank">Wowza Media Server</a> is available on my <a href="https://github.com/bandono/zoom-camera-board" title="zoom camera board" target="_blank">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/11/simple-ffmpeg-udp-video-streaming-from-beagleboard-running-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zabbix Proxy: distributed NMS monitoring via embedded Linux (Ubuntu on BeagleBoard)</title>
		<link>https://lakm.us/logit/2012/07/zabbix-proxy-distributed-nms-monitoring-embedded-linux-ubuntu-beagleboard/</link>
		<comments>https://lakm.us/logit/2012/07/zabbix-proxy-distributed-nms-monitoring-embedded-linux-ubuntu-beagleboard/#comments</comments>
		<pubDate>Thu, 19 Jul 2012 07:26:15 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[Zabbix]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=404</guid>
		<description><![CDATA[As already mentioned in previous post&#8217;s introduction, proof of concept on how Zabbix Proxy works under unreliable communication is what this next post about. The idea is to have these scenarios tested: independent SNMP data polling by individual NMS proxy (embedded system) intermittent connection between main/master NMS server with its proxy Of course we&#8217;ll do [...]]]></description>
				<content:encoded><![CDATA[<p>As already mentioned in <a href="./2012/07/compile-zabbix-proxy-ubuntu-arm-beagleboard/" title="Compile Zabbix Proxy in Ubuntu ARM (BeagleBoard)" target="_blank">previous post&#8217;s</a> introduction, proof of concept on how <a href="http://www.zabbix.com/documentation/1.8/manual/processes/zabbix_proxy" title="Zabbix Proxy" target="_blank">Zabbix Proxy</a> works under unreliable communication is what this next post about. The idea is to have these scenarios tested:</p>
<ol>
<li>independent SNMP data polling by individual NMS proxy (embedded system)</li>
<li>intermittent connection between main/master NMS server with its proxy</li>
</ol>
<p>Of course we&#8217;ll do them in implementation context of <a href="http://www.zabbix.com/documentation/1.8/manual/processes/zabbix_server" title="Zabbix Server" target="_blank">Zabbix Server</a> as main/master NMS server and our <a href="http://beagleboard.org/hardware-xM/" target="_blank">BeagleBoard xM</a> as its proxy.</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="zabbix-proxy-routine-log-abstract-illustration.jpg" src="../../../../images/zabbix-proxy-routine-log-abstract-illustration.jpg" title="Zabbix Proxy - distributed NMS over embedded Linux" width="380" height="293" /><p class="wp-caption-text">Zabbix Proxy - distributed NMS over embedded Linux</p></div>
<p>In the technical details, I already followed pretty much the same steps showed in <a href="http://www.zabbix.com/wiki/howto/install/debian/zabbix_proxy_on_debian_sqlite" target="_blank">installation wiki</a> (with the exception that I didn&#8217;t put the process into startup <code>init.d</code> script as I would start it manually as needed).</p>
<p>The first test is to make our Ubuntu ARM board accepts configuration done in Zabbix Server web-GUI, retrieves SNMP data to it, and sends collected data to server. Mode passive is chosen so that the server will be the one initiating contact with the board. After enabling a certain SNMP host, i.e. <code>host-aaa</code>, as monitored-by-proxy, the Zabbix Server log will show:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">15677</span>:<span style="color: #000000;">20120601</span>:<span style="color: #000000;">022022.960</span> Sending configuration data to proxy <span style="color: #ff0000;">'beaglexm1'</span>. Datalen <span style="color: #000000;">9205</span></pre></div></div>

<p>Our board, &#8216;<code>beaglexm1</code>&#8216;, will start to poll SNMP data from <code>host-xxx</code> to then store it in designated <code>sqlite</code> database.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">975</span>:<span style="color: #000000;">20120531</span>:<span style="color: #000000;">212024.098</span> proxy <span style="color: #666666; font-style: italic;">#8 started [poller #5]</span>
<span style="color: #000000;">984</span>:<span style="color: #000000;">20120531</span>:<span style="color: #000000;">212024.128</span> proxy <span style="color: #666666; font-style: italic;">#17 started [discoverer #1]</span>
<span style="color: #000000;">968</span>:<span style="color: #000000;">20120531</span>:<span style="color: #000000;">212025.423</span> Received configuration data from server. Datalen <span style="color: #000000;">9205</span>
<span style="color: #000000;">971</span>:<span style="color: #000000;">20120531</span>:<span style="color: #000000;">212030.388</span> Enabling SNMP host <span style="color: #7a0874; font-weight: bold;">&#91;</span>host-aaa<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>From time to time as configured, our board will also run housekeeping to keep our board database file in small size.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">1081</span>:<span style="color: #000000;">20120531</span>:<span style="color: #000000;">224513.922</span> Executing housekeeper
<span style="color: #000000;">1081</span>:<span style="color: #000000;">20120531</span>:<span style="color: #000000;">224514.505</span> Deleted <span style="color: #000000;">4885</span> records from <span style="color: #7a0874; font-weight: bold;">history</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0.453765</span> seconds<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Under normal connection, in main Zabbix Server we&#8217;ll start seeing the collected data from <code>host-aaa</code> the same way as when the SNMP data is polled by the server directly. To emulate disruption to the connectivity, I choose to use simple <code>iptables</code> drop packet. This time the server will no longer seeing new data.</p>
<p>After the drop block is released, the server we&#8217;ll start seeing new data as well as data from the period of intermittent connection. It will take some time before all of that being sent to the server.</p>
<p>In general that proves it. I collected 44 OID values from the <code>host-aaa</code> every 30 seconds and in this case BeagleBoard utilization was very low as this wasn&#8217;t a stress test to see its performance. </p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/07/zabbix-proxy-distributed-nms-monitoring-embedded-linux-ubuntu-beagleboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile Zabbix Proxy in Ubuntu ARM (BeagleBoard)</title>
		<link>https://lakm.us/logit/2012/07/compile-zabbix-proxy-ubuntu-arm-beagleboard/</link>
		<comments>https://lakm.us/logit/2012/07/compile-zabbix-proxy-ubuntu-arm-beagleboard/#comments</comments>
		<pubDate>Tue, 17 Jul 2012 08:28:57 +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[compile]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[make-install]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[workaround]]></category>
		<category><![CDATA[Zabbix]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=401</guid>
		<description><![CDATA[I needed to tackle practical limitation of SNMP monitoring under unreliable communication, a serious consideration was made for Zabbix Proxy. It was an option said to be ready for embedded hardware. I already had BeagleBoard xM Rev C running Ubuntu 11.10 Oneiric and needed to proof that it would port functionally to this Linux ARM [...]]]></description>
				<content:encoded><![CDATA[<p>I needed to tackle practical limitation of SNMP monitoring under unreliable communication, a serious consideration was made for <a href="http://www.zabbix.com/documentation/1.8/manual/processes/zabbix_proxy" title="Zabbix Proxy" target="_blank">Zabbix Proxy</a>. It was an option said to be <a href="http://www.zabbix.com/documentation/1.8/manual/proxies/proxy_vs_node" title="Zabbix: Proxy vs Node" target="_blank">ready for embedded hardware</a>. I already had BeagleBoard xM Rev C running <a href="./2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/" title="Ubuntu on Beagleboard xM" target="_blank">Ubuntu 11.10 Oneiric</a> and needed to proof that it would port functionally to this Linux ARM board. There existed <code>zabbix-proxy-mysql</code> in <a href="https://launchpad.net/ubuntu/oneiric/armel/zabbix-proxy-mysql/1:1.8.5-1ubuntu2" title="armel zabbix-proxy-mysql" target="_blank">Oneiric repository</a>, but <code><a href="http://www.sqlite.org/" title="SQLite" target="_blank">sqlite</a></code> seemed to be a better scale option for embedded deployment.</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="zabbix-proxy-abstract-illustration.png" src="../../../../images/zabbix-proxy-abstract-illustration.png" title="Zabbix Proxy Distributed NMS" width="330" height="253" /><p class="wp-caption-text">Zabbix Proxy Distributed NMS</p></div>
<p>An example set out for <a href="http://www.zabbix.com/wiki/howto/install/debian/zabbix_proxy_on_debian_sqlite" title="Wiki: Zabbix Proxy on Debian using sqlite" target="_blank">Zabbix Proxy on Debian</a> appears to be pretty straightforward to follow. With the ARM board already installed with <code>build-essential</code>, <code>snmp</code>, and <code>snmpd</code>, the following needs to be added:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libsnmp-dev libcurl4-openssl-dev fping curl sqlite libsqlite3-dev ntpdate</pre></div></div>

<p>then start the pre-compilation <code>configure</code> (in this case <a href="http://www.zabbix.com/rn1.8.7.php" title="Zabbix 1.8.7" target="_blank">Zabbix 1.8.7</a> is used):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> zabbix-1.8.7
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-proxy</span> <span style="color: #660033;">--enable-agent</span> <span style="color: #660033;">--with-sqlite3</span> <span style="color: #660033;">--with-net-snmp</span> <span style="color: #660033;">--with-libcurl</span></pre></div></div>

<p>It will go smooth. However, during <code>make</code> there are complains about undefined references to &#8216;<code>sqlite3_open</code>&#8216;, &#8216;<code>sqlite3_close</code>&#8216;, etc.:</p>
<p><span id="more-401"></span></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>libzbxdb.<span style="color: #202020;">a</span><span style="color: #009900;">&#40;</span>db.<span style="color: #202020;">o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> In <span style="color: #000000; font-weight: bold;">function</span> `zbx_db_connect<span style="color: #ff0000;">':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:331: undefined reference to `sqlite3_open'</span>
<span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">-</span>1.8.7<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>db.<span style="color: #202020;">c</span><span style="color: #339933;">:</span><span style="color: #0000dd;">343</span><span style="color: #339933;">:</span> undefined reference to `sqlite3_busy_timeout<span style="color: #ff0000;">'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:334: undefined reference to `sqlite3_errmsg'</span>
<span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">-</span>1.8.7<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>db.<span style="color: #202020;">c</span><span style="color: #339933;">:</span><span style="color: #0000dd;">335</span><span style="color: #339933;">:</span> undefined reference to `sqlite3_close<span style="color: #ff0000;">'
../../src/libs/zbxdb/libzbxdb.a(db.o): In function `zbx_db_init'</span><span style="color: #339933;">:</span>
<span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">-</span>1.8.7<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>db.<span style="color: #202020;">c</span><span style="color: #339933;">:</span><span style="color: #0000dd;">385</span><span style="color: #339933;">:</span> undefined reference to `sqlite3_open<span style="color: #ff0000;">'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:387: undefined reference to `sqlite3_errmsg'</span>
..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>libzbxdb.<span style="color: #202020;">a</span><span style="color: #009900;">&#40;</span>db.<span style="color: #202020;">o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> In <span style="color: #000000; font-weight: bold;">function</span> `zbx_db_close<span style="color: #ff0000;">':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:446: undefined reference to `sqlite3_close'</span>
..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>libzbxdb.<span style="color: #202020;">a</span><span style="color: #009900;">&#40;</span>db.<span style="color: #202020;">o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> In <span style="color: #000000; font-weight: bold;">function</span> `zbx_db_vexecute<span style="color: #ff0000;">':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:827: undefined reference to `sqlite3_exec'</span>
<span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">-</span>1.8.7<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>db.<span style="color: #202020;">c</span><span style="color: #339933;">:</span><span style="color: #0000dd;">852</span><span style="color: #339933;">:</span> undefined reference to `sqlite3_changes<span style="color: #ff0000;">'
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:833: undefined reference to `sqlite3_free'</span>
..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>libzbxdb.<span style="color: #202020;">a</span><span style="color: #009900;">&#40;</span>db.<span style="color: #202020;">o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> In <span style="color: #000000; font-weight: bold;">function</span> `SQ_DBfree_result<span style="color: #ff0000;">':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:1363: undefined reference to `sqlite3_free_table'</span>
..<span style="color: #339933;">/</span>..<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>libzbxdb.<span style="color: #202020;">a</span><span style="color: #009900;">&#40;</span>db.<span style="color: #202020;">o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> In <span style="color: #000000; font-weight: bold;">function</span> `zbx_db_vselect<span style="color: #ff0000;">':
/home/zabbix/zabbix-1.8.7/src/libs/zbxdb/db.c:1121: undefined reference to `sqlite3_get_table'</span>
<span style="color: #339933;">/</span>home<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">/</span>zabbix<span style="color: #339933;">-</span>1.8.7<span style="color: #339933;">/</span>src<span style="color: #339933;">/</span>libs<span style="color: #339933;">/</span>zbxdb<span style="color: #339933;">/</span>db.<span style="color: #202020;">c</span><span style="color: #339933;">:</span><span style="color: #0000dd;">1127</span><span style="color: #339933;">:</span> undefined reference to `sqlite3_free<span style="color: #ff0000;">'</span></pre></div></div>

<p>this is obviously from the database related code compilation. I run the <code>gcc</code> manually for the <code>db.c</code> file inside its directory by adding the flag &#8216;<code>-lsqlite3</code>&#8216; in the tail of &#8216;<code>../../src/libs/zbxdb/libzbxdb.a</code>&#8216; to make it work. Afterward by going to the initial directory first, running <code>make</code> again will then continue successfully.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> src<span style="color: #000000; font-weight: bold;">/</span>zabbix_proxy
$ <span style="color: #c20cb9; font-weight: bold;">gcc</span> -DZABBIX_DAEMON <span style="color: #660033;">-g</span> <span style="color: #660033;">-O2</span>     -L<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>arm-linux-gnueabi    -I<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>include -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>perl<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.12</span><span style="color: #000000; font-weight: bold;">/</span>CORE -I. -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include      -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include <span style="color: #660033;">-lsqlite3</span>  -L<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>arm-linux-gnueabi <span style="color: #660033;">-lcurl</span>  -L<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #660033;">-lnetsnmp</span> <span style="color: #660033;">-lcrypto</span>  -L<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #660033;">-lnetsnmp</span> <span style="color: #660033;">-lcrypto</span>   <span style="color: #660033;">-rdynamic</span>    <span style="color: #660033;">-o</span> zabbix_proxy zabbix_proxy-servercomms.o zabbix_proxy-events.o zabbix_proxy-zlog.o zabbix_proxy-proxy.o heart<span style="color: #000000; font-weight: bold;">/</span>libzbxheart.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>dbsyncer<span style="color: #000000; font-weight: bold;">/</span>libzbxdbsyncer.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>discoverer<span style="color: #000000; font-weight: bold;">/</span>libzbxdiscoverer.a housekeeper<span style="color: #000000; font-weight: bold;">/</span>libzbxhousekeeper.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>httppoller<span style="color: #000000; font-weight: bold;">/</span>libzbxhttppoller.a proxyconfig<span style="color: #000000; font-weight: bold;">/</span>libzbxproxyconfig.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>pinger<span style="color: #000000; font-weight: bold;">/</span>libzbxpinger.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>poller<span style="color: #000000; font-weight: bold;">/</span>libzbxpoller.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>trapper<span style="color: #000000; font-weight: bold;">/</span>libzbxtrapper.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>nodewatcher<span style="color: #000000; font-weight: bold;">/</span>libzbxnodewatcher.a datasender<span style="color: #000000; font-weight: bold;">/</span>libzbxdatasender.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>zabbix_server<span style="color: #000000; font-weight: bold;">/</span>selfmon<span style="color: #000000; font-weight: bold;">/</span>libzbxselfmon.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxsysinfo<span style="color: #000000; font-weight: bold;">/</span>libzbxserversysinfo.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxsysinfo<span style="color: #000000; font-weight: bold;">/</span>linux<span style="color: #000000; font-weight: bold;">/</span>libspecsysinfo.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxsysinfo<span style="color: #000000; font-weight: bold;">/</span>common<span style="color: #000000; font-weight: bold;">/</span>libcommonsysinfo.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxsysinfo<span style="color: #000000; font-weight: bold;">/</span>simple<span style="color: #000000; font-weight: bold;">/</span>libsimplesysinfo.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxlog<span style="color: #000000; font-weight: bold;">/</span>libzbxlog.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxdbcache<span style="color: #000000; font-weight: bold;">/</span>libzbxdbcache.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxmemory<span style="color: #000000; font-weight: bold;">/</span>libzbxmemory.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxalgo<span style="color: #000000; font-weight: bold;">/</span>libzbxalgo.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxnix<span style="color: #000000; font-weight: bold;">/</span>libzbxnix.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxsys<span style="color: #000000; font-weight: bold;">/</span>libzbxsys.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxconf<span style="color: #000000; font-weight: bold;">/</span>libzbxconf.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxcommon<span style="color: #000000; font-weight: bold;">/</span>libzbxcommon.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxcrypto<span style="color: #000000; font-weight: bold;">/</span>libzbxcrypto.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxcomms<span style="color: #000000; font-weight: bold;">/</span>libzbxcomms.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxcommshigh<span style="color: #000000; font-weight: bold;">/</span>libzbxcommshigh.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxjson<span style="color: #000000; font-weight: bold;">/</span>libzbxjson.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxexec<span style="color: #000000; font-weight: bold;">/</span>libzbxexec.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxself<span style="color: #000000; font-weight: bold;">/</span>libzbxself.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxserver<span style="color: #000000; font-weight: bold;">/</span>libzbxserver.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxicmpping<span style="color: #000000; font-weight: bold;">/</span>libzbxicmpping.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxdbhigh<span style="color: #000000; font-weight: bold;">/</span>libzbxdbhigh.a ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>zbxdb<span style="color: #000000; font-weight: bold;">/</span>libzbxdb.a <span style="color: #660033;">-lsqlite3</span> <span style="color: #660033;">-lcurl</span>  <span style="color: #660033;">-lnetsnmp</span>    <span style="color: #660033;">-lm</span>  <span style="color: #660033;">-lresolv</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/07/compile-zabbix-proxy-ubuntu-arm-beagleboard/feed/</wfw:commentRss>
		<slash:comments>0</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>
		<item>
		<title>Running Ubuntu on DevKit8500D (Natty Kernel and Lucid RootFS)</title>
		<link>https://lakm.us/logit/2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/</link>
		<comments>https://lakm.us/logit/2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:50:31 +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[DevKit8500D]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Lucid]]></category>
		<category><![CDATA[Natty]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[RootStock]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=264</guid>
		<description><![CDATA[BeagleBoard xM that comes with Texas Instruments’ DM3730 DaVinci™ processor has its Chinese sister from Embest, the DevKit8500D evaluation kit. This similarity and eLinux wiki (showing working previous DevKit8000) have made me confident that Ubuntu would also port to this board with no hassle. As always, that wasn&#8217;t the story. I tried preinstalled images available [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://beagleboard.org/hardware-xM">BeagleBoard xM</a> that comes with Texas Instruments’ DM3730 DaVinci™ processor has its Chinese sister from Embest, the <a href="http://www.armkits.com/product/devkit8500d.asp">DevKit8500D</a> evaluation kit. This similarity  and <a href="http://elinux.org/Devkit8000_Ubuntu">eLinux wiki</a> (showing working previous DevKit8000) have made me confident that Ubuntu would also port to this board with no hassle. As always, that wasn&#8217;t the story. I tried preinstalled images available on <a href="http://cdimage.ubuntu.com/releases">Ubuntu CD Image</a> and final combination that worked out of a series of trial-and-error was Natty kernel with Lucid rootfs.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="DevKit8500D TI OMAP3" src="../../../../images/devkit8500d.gif" title="DevKit8500D TI OMAP3 " width="300" height="224" /><p class="wp-caption-text">I bricked one of these DevKit8500D by overvoltaged it to 12V DC. Yes, It has no regulator.</p></div>
<p>
Various howto made net-boot or preinstalled images seem feasible, but trying them is another thing. The first attempt was to boot Ubuntu Lucid 10.04 LTS to have similar distribution as my laptop, but it would stop at boot with the message</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Error: unrecognized<span style="color: #000000; font-weight: bold;">/</span>unsupported machine ID <span style="color: #7a0874; font-weight: bold;">&#40;</span>r1 = 0x00000ae9<span style="color: #7a0874; font-weight: bold;">&#41;</span>.</pre></div></div>

<p>The above ID (2793 in decimal) isn&#8217;t found in Lucid released with linux 2.6.32-21. Ubuntu Natty 11.04 boot image didn&#8217;t complain because the ID already listed in <code>/usr/src/linux-source-2.6.38/arch/arm/tools/mach-types</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
 nemini                  MACH_NEMINI             NEMINI                  <span style="color: #000000;">2793</span>
...</pre></div></div>

<p>However, <a href="http://cdimage.ubuntu.com/releases/11.04/release/ubuntu-11.04-preinstalled-headless-armel+omap.img.gz">ubuntu-11.04-preinstalled-headless-armel+omap.img.gz</a> wouldn&#8217;t finish loading the linux kernel 2.6.38 somehow. Hence, I replaced the root file system using rootfs created using <a href="https://wiki.ubuntu.com/ARM/RootStock">RootStock</a> method. After successful boot, I installed <a href="https://launchpad.net/ubuntu/natty/+package/linux-image-2.6.38-8-omap">linux-image-2.6.38-8-omap_2.6.38-8.42_armel.deb</a> to have the rootfs kernel lib files updated (this would require <code>wireless-crda</code> dependency to be installed).</p>
<p><a id="LucidRooststock" href="#LucidRooststock" rel="bookmark" title="LucidRootstock"><br />
<h4>Creating Lucid RootStock &#038; Replacing Natty&#8217;s</h4>
<p></a></p>
<p>Using RootStock relies much on the host environment, in my case (version 0.1.99.3) the laptop has Lucid with 2.6.38 kernel (Natty), and it failed to create rootfs with option <code>--dist natty</code> by stopping at this QEMU error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">qemu: fatal: cp15 insn ee1d6f70
&nbsp;
<span style="color: #007800;">R00</span>=4009f960 <span style="color: #007800;">R01</span>=420822e8 <span style="color: #007800;">R02</span>=0d696914 <span style="color: #007800;">R03</span>=000086a8
<span style="color: #007800;">R04</span>=00008ef0 <span style="color: #007800;">R05</span>=00000000 <span style="color: #007800;">R06</span>=000097c9 <span style="color: #007800;">R07</span>=<span style="color: #000000;">42082308</span>
<span style="color: #007800;">R08</span>=00020040 <span style="color: #007800;">R09</span>=00000000 <span style="color: #007800;">R10</span>=4009f000 <span style="color: #007800;">R11</span>=00000000
<span style="color: #007800;">R12</span>=00008b88 <span style="color: #007800;">R13</span>=4007f7f8 <span style="color: #007800;">R14</span>=4008f450 <span style="color: #007800;">R15</span>=4008aea0
<span style="color: #007800;">PSR</span>=<span style="color: #000000;">20000030</span> <span style="color: #660033;">--C-</span> T usr32</pre></div></div>

<p>DevKit8500D also freezed on boot when too many seeds used in the rootfs. A minimal seeds of Lucid rootfs used is</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;">sudo</span> rootstock <span style="color: #660033;">--fqdn</span> omap <span style="color: #660033;">--login</span> ubuntu <span style="color: #660033;">--password</span> temppwd <span style="color: #660033;">--imagesize</span> 2G <span style="color: #660033;">--seed</span> <span style="color: #c20cb9; font-weight: bold;">wget</span>,<span style="color: #c20cb9; font-weight: bold;">nano</span>,linux-firmware,wireless-tools,usbutils <span style="color: #660033;">--dist</span> lucid <span style="color: #660033;">--serial</span> ttyO2 <span style="color: #660033;">--components</span> <span style="color: #ff0000;">&quot;main universe multiverse&quot;</span></pre></div></div>

<p>It will retrieve many packages from <a href="http://ports.ubuntu.com">http://ports.ubuntu.com</a> which takes long and produces i.e. <code>armel-rootfs-201110261541.tgz</code>.</p>
<p>A card at <code>/dev/sdb</code> with Natty boot images are obtained by</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gunzip</span> <span style="color: #660033;">-c</span> ubuntu-<span style="color: #000000;">11.10</span>-preinstalled-server-armel+omap.img.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">bs</span>=4M <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb</pre></div></div>

<p>The root file system will reside at <code>/dev/sdb2</code> while boot images are in <code>/dev/sdb1</code>. To replace this with Lucid rootfs, run following steps</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=lucid-arm.img <span style="color: #007800;">bs</span>=1MB <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">seek</span>=<span style="color: #000000;">1024</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> mkfs.ext3 <span style="color: #660033;">-F</span> lucid-arm.img
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> loop lucid-arm.img <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #660033;">-zxf</span> armel-rootfs-<span style="color: #000000; font-weight: bold;">&lt;</span>some rootstock generated <span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">&gt;</span>.tgz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=lucid-arm.img <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 <span style="color: #007800;">bs</span>=1MB <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">seek</span>=<span style="color: #000000;">1024</span></pre></td></tr></table></div>

<p>There are reasons for why-not-using the included <a href="http://www.angstrom-distribution.org/">Ångström Linux</a> (forked to <code>linux-2.6.32-devkit8500</code>) but this method of booting Ubuntu wasn&#8217;t straightforward after all. The on-board LAN (using Davicom DM9000AEP chip) doesn&#8217;t work and I need to use USB ethernet detected as Davicom DM9601 (a bit ridiculous?). <a href="http://easycap.co.uk/">Easycap</a> USB video capture also works with this kernel as it has been part of 2.6.38 <code>drivers/staging</code> compilation.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="DM9601 USB-LAN-Card" src="../../../../images/USB-LAN-Card.jpg" title="DM9601 USB-LAN-Card" class="aligncenter" width="200" height="145" /><p class="wp-caption-text">DM9601 USB LAN</p></div>
<p>Before coming up with this combo, I&#8217;ve tried:</p>
<ol>
<li>Ubuntu Lucid 10.04 CD Image: <a href="http://cdimage.ubuntu.com/ports/releases/lucid/release/ubuntu-10.04-server-armel+omap.img">ubuntu-10.04-server-armel+omap.img</a>
<li>Ubuntu Oneiric 11.10 CD Image: <a href="http://cdimage.ubuntu.com/releases/11.10/release/ubuntu-11.10-preinstalled-server-armel+omap.img.gz">ubuntu-11.10-preinstalled-server-armel+omap.img.gz</a></li>
<li>Robert C. Nelson&#8217; Oneiric: <a href="http://rcn-ee.net/deb/rootfs/oneiric/ubuntu-11.10-r0-minimal-armel.tar.xz">ubuntu-11.10-r0-minimal-armel.tar.xz</a> (as pointed out by the above eLinux page which has changed quite regularly since October 2011)</li>
</ol>
<p>But nothing seemed to work.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
