<?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>Project Gus</title>
	<atom:link href="http://projectgus.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://projectgus.com</link>
	<description>Might even work.</description>
	<lastBuildDate>Fri, 30 Jul 2010 22:56:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Sad State of Open Source in Android tablets</title>
		<link>http://projectgus.com/2010/07/open-source-in-android-tablets/</link>
		<comments>http://projectgus.com/2010/07/open-source-in-android-tablets/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 05:24:47 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Talky]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=366</guid>
		<description><![CDATA[This year a slew of companies have launched competing Android tablet devices. A lot of rhetoric has been spun about how Android&#8217;s open source ecosystem gives manufacturers and consumers an advantage.
Android is open source; it can be liberally extended to incorporate new cutting edge technologies as they emerge. The platform will continue to evolve as [...]]]></description>
			<content:encoded><![CDATA[<p>This year a slew of companies have launched competing Android tablet devices. A lot of rhetoric has been spun about how Android&#8217;s open source ecosystem gives manufacturers and consumers an advantage.</p>
<blockquote><p>Android is open source; it can be liberally extended to incorporate new cutting edge technologies as they emerge. The platform will continue to evolve as the developer community works together to build innovative mobile applications. (<a href="http://www.openhandsetalliance.com/android_overview.html">Open Handset Alliance</a>)</p></blockquote>
<p>Unfortunately, the current crop of Android tablets aren&#8217;t nurturing open source at all.</p>
<h2>Android Tablets</h2>
<p>With the exception of Barnes &amp; Noble&#8217;s Nook e-reader, a device that isn&#8217;t even really a tablet, <span style="text-decoration:line-through;">I couldn&#8217;t find a single</span> EDIT: <b>I found one</b> tablet manufacturer who was complying with the minimum of their legal open source requirements under GNU GPL. Let alone supporting community development.</p>
<table cellspacing="3" border-spacing="4px" border-width="2px" width="75%">
<tbody>
<tr>
<th padding="4px">Manufacturer</th>
<th padding="4px">Based In</th>
<th padding="4px">Tablets</th>
<th padding="4px">GPL Compliant</th>
<th padding="4px">Sources Available</th>
</tr>
</tbody>
<tbody>
<tr>
<td><a href="http://hiapad.com">Apad</a></td>
<td>China</td>
<td>1+</td>
<td>No</td>
<td><a href="http://hiapad.com/?p=878">No</td>
</tr>
<tr>
<td><a href="http://www.archos.com">Archos</a></td>
<td>France</td>
<td>2</td>
<td>Partial (see below)</td>
<td>Yes</td>
</tr>
<tr>
<td><a href="http://www.barnesandnoble.com/nook/">Barnes &amp; Noble</a></td>
<td>United States</td>
<td>1</td>
<td><a href="http://www.barnesandnoble.com/nook/legal/index.asp">Yes</a></td>
<td>Yes</td>
</tr>
<tr>
<td><a href="http://www.ekengroup.com/">Eken Group</a></td>
<td>China</td>
<td>4+</td>
<td><a href="http://lists.gpl-violations.org/pipermail/legal/2010-July/002159.html">No</a></td>
<td>Partial (see below)</td>
</tr>
<tr>
<td>Gome</td>
<td>China</td>
<td>1</td>
<td>No</td>
<td>Partial (see below)</td>
</tr>
<tr>
<td><a href="http://www.moonse.com.cn/">Moonse</a></td>
<td>China</td>
<td>1+</td>
<td>No</td>
<td>No</td>
</tr>
<tr>
<td><a href="http://pandigital.net/">Pandigital</a></td>
<td>United States</td>
<td>1</td>
<td><a href="http://lists.gpl-violations.org/pipermail/legal/2010-July/002182.html">No (may change)</a></td>
<td>?</td>
</tr>
<tr>
<td><a href="http://www.smartdevices.com.cn/">Smart Devices</a></td>
<td>China</td>
<td>5</td>
<td>No</td>
<td><a href="http://gitorious.org/mer-smartq">Community</a></td>
</tr>
</table>
<p><i>EDIT 31/7: In the comments, xauieous points out that while Archos have released GPL source for the ARM11/OMAP2 based &#8220;Archos 5 Internet Tablet&#8221; (aka Archos Generation 7), they are not complying with GPL for the ARM9 based &#8220;Archos 7 Home Tablet&#8221;. The contents of the &#8220;Generation 7&#8243; kernel tarball seem to bear this out. Xauieous claims Rockchip are holding out on the source for the Archos 9 Home Tablet, same as Apad.</i></p>
<p><i>Also, personal note to Archos: Please get a less confusing naming scheme!</i></p>
<p><i>EDIT 28/7: Courtesy Harald Welte @ VIA, there&#8217;s been a <a href="ftp://ftp.gpl-devices.org/pub/vendors/Wondermedia/WM8505/bsp_WM8505_2629.01_20100715_nogit.tar.bz2">source drop</a> of kernel source for WM8505-based tablets (Eken M001,M003,Gome FlyTouch, etc.) Some parts (video, SD/MMC drivers) are still binary only, Harald says he&#8217;s talking to VIA about it.</i></p>
<p><i>EDIT 26/7:  Zebul posted a comment and drew my attention back to Archos&#8217; GPL download section. I originally thought these were all just media player firmwares, but it turns out &#8220;Archos Generation 7&#8243; means the &#8220;Archos 5 Internet Tablet&#8221; and this tarball is a full GPL source release. Well done Archos! To their detriment, the binary firmware does not contain any obvious GPL mention &#8211; and this may mean they are still in technical breach of the GPL. The manual doesn&#8217;t mention anything either. But it&#8217;s still streets ahead of the others. Yay Archos!</i></p>
<p>(EDIT: I posted some details <a href="http://lists.gpl-violations.org/pipermail/legal/2010-July/002190.html">here</a>. Please leave a comment if I&#8217;ve missed any tablets, or any source releases.)</p>
<h2>What&#8217;s this GPL?</h2>
<p>The <a href="http://en.wikipedia.org/wiki/GNU_General_Public_License">GNU General Public License</a> is a &#8220;copyleft&#8221; software license. Manufacturers releasing products with GPL licensed code, like the Linux kernel that underpins Android, are required to make their changes available in source code form.</p>
<p>Android itself isn&#8217;t GPL. Its open source Apache license does not mandate that source code has to be made available. However, all Android systems include the Linux kernel at minimum, and may also include other GPL-licensed pieces of software that are not part of the base Android distribution.</p>
<p>GPL source releases for these kernels make it easier for developers to build alternative operating systems, Android or otherwise, to run on the tablet hardware. It also allows improvements and changes to flow back &#8220;upstream&#8221; to the original software authors.</p>
<h2>Why should consumers care?</h2>
<p>The average tablet buyer isn&#8217;t an open source developer. However, having healthy open source releases means future support for these devices is guaranteed. Currently, projects like <a href="http://en.wikipedia.org/wiki/CyanogenMod">CyanogenMod</a> make new improvements available to old Android phones whose manufacturers have already moved on. Similar community improvements could make new releases available on tablets, even though manufacturers are no longer supporting them.</p>
<p>Often, community Android releases are better than the original manufacturer&#8217;s. <a href="http://www.slatedroid.com/">Slatedroid</a> &amp; <a href="http://www.twitter.com/ecotox">ECOTOX</a> have been releasing customised Android versions for the Eken M001 tablet which are both faster and support more features than the OEM release. Having kernel source available can only serve to make these releases better. For the Nook e-reader, <a href="http://nookdevs.com/Application_Directory">community software releases</a> allow you to view more ebook formats on your Nook, and even add totally unexpected features like Pandora Internet Radio.</p>
<h2>Why should tablet manufacturers care?</h2>
<p>Most manufacturers seem to be stuck in the &#8220;vendor&#8221; mindset that their hardware should remain entirely under their control, and that anyone else working on it is a problem.</p>
<p>However, it seems like community development almost always adds value to the hardware by extending it and adding more features. Especially in the tablet arena where there are no carriers to insist on platform lockdown to support their business model, an open platform doesn&#8217;t seem like it carries any significant drawbacks.</p>
<p>Some companies, particularly the smaller Chinese ones, appear to be concerned about competitors ripping their software off into compatible hardware. From what we&#8217;ve seen with the Eken M001 though, it doesn&#8217;t seem like source availability &#8211; especially kernel source &#8211; would do much to change the situation.</p>
<p>Outside of e-readers, there aren&#8217;t any companies competing on custom software anyhow: for the most part the software is vanilla Android, and competition is on performance, specifications, and especially price. This seems to make an even bigger opportunity for a clever manufacturer to embrace community open-source development, and differentiate themselves from all the &#8220;me too&#8221; Android clones without incurring any actual R&#038;D cost.</p>
<h2>What about chipset manufacturers?</h2>
<p>A lot of kernel development for these devices is done by the original chipset manufacturers themselves. For example, it seems like VIA authored and compiled the kernels found in all devices based on the WM8505 chipset (including Eken&#8217;s tablets and some others..) It seems like the same story is true for Rockchip, who make the chipset used in the iRobot APad &amp; Moonse E-7001.</p>
<p>Chipset manufacturers aren&#8217;t required to release GPL source code to the public, provided they send sources alongside any GPL software that goes to the device manufacturer. VIA has so far chosen this path, stating all sources are released to device manufacturers (although Eken has claimed differently at least once.) In the case of RockChip, manufacturers claim RockChip isn&#8217;t even doing that much and are violating GPL themselves (<a href="http://hiapad.com/?p=878">see first comment</a>).</p>
<p>In addition, chipset manufacturers may sometimes author custom kernel modules or other components that are not GPL licensed at all. For example, Samsung have a <a href="http://lists.gpl-violations.org/pipermail/legal/2010-May/002015.html">video acceleration kernel module</a> that is included in the firmware for the SmartQ tablet range. These components are normally not open sourced at all.</p>
<p>I can think of three reasons which chipset manufacturers do not embrace open source. One is that it is simpler not to. Another is that they charge device manufacturers for access to their SDK, and preemptively releasing source takes away that revenue stream (although possibly at the expense of extra hardware sales.) The last is that they are concerned about protection of their intellectual property, although this seems unnecessary given that most of their trade secrets are captured in the hardware itself, which is in turn protected by patents.</p>
<h2>What about Google?</h2>
<p>Google is in an interesting position here. On the one hand, they have worked hard to make sure that above the kernel layer Android is not GPL licensed. This serves to calm worried manufacturers threatened by the idea of having to release source. It seems, sadly, like a necessary step in order for Android to receive the kind of market prominence that Google wants for it.</p>
<p>On the other hand, it seems hypocritical for Google to tout Android&#8217;s &#8220;open source&#8221; credentials when it seems so clear that most companies profiting from it are completely oblivious, maybe even antagonistic, to open source.</p>
<p>I think there may be things Google could do to encourage manufacturers to be more friendly (or at least legally compliant) with open source, without scaring them off. An idea that springs to mind, especially now Google seem to be out of the device business, is promotion &amp; accreditation of open source friendly manufacturers who receive extra kudos and promotion from Google in exchange for giving back to the community. Some kind of base level accreditation for companies who do not violate GPL, and additional incentives for companies who give back extra to the community.</p>
<h2>Where to from here?</h2>
<p>There are a lot more Android devices on the horizon, from a variety of manufacturers. It is my sincere hope that, especially following the growing buzz around &#8220;open source hardware&#8221;, at least one chipset or device manufacturer decides to make a break from the pack and announce &#8220;open source friendly products &amp; manufacturing&#8221; that includes supporting community development.</p>
<p>Until then, if you care about open source you may actually be better off buying an iPad than many of the devices listed above. At least Apple comply with GPL and contribute back to the open source projects that they benefit from!</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/07/open-source-in-android-tablets/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Debian on the Eken M001</title>
		<link>http://projectgus.com/2010/07/debian-on-the-eken-m001/</link>
		<comments>http://projectgus.com/2010/07/debian-on-the-eken-m001/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 13:05:09 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[eken m001 tablet]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=350</guid>
		<description><![CDATA[Steps to get Debian up and running on the Eken M001 Android tablet. Debian on the WM8505 netbooks has been around for a while, thanks to the efforts of #easypc's <i>abrasive</i>. I needed to tweak a couple of things before his release worked on the Eken M001.]]></description>
			<content:encoded><![CDATA[<p>(One more Eken post and I&#8217;m going to have to rename this blog to Project M001!)</p>
<p><i>EDIT: Everything here is somewhat out of date now. Jacob Stoner has released a Debian build  with X11 &#038; touchscreen support. <a href="http://38.99.171.104/~slatedr1/showthread.php/2783-Bounty-for-Working-Debian-with-Touchscreen-Driver-for-the-Eken-m001?p=24694&#038;viewfull=1#post24694">Initial post here</a>. <a href="http://www.jacobstoner.com/debian-m001.bz2">Initial download here</a>.</i></p>
<p><a href="/files/eken/images/img_2363.jpg"><img src="/files/eken/images/img_2363_thumb.jpg" alt="Debian Boots! I wish I had a keyboard!" /></a></p>
<p>Debian on the WM8505 netbooks has been around for a while, thanks to the efforts of #easypc&#8217;s <i>abrasive</i>. I needed to tweak a couple of things before his release worked on the Eken M001 tablet.</p>
<h2>Before you begin</h2>
<p>You probably want to start by plugging in either a USB keyboard or a <a href="/eken-m001-teardown-serial-consol">serial cable</a>. Otherwise, all Debian has to offer you is a blank login console.</p>
<h2>Howto</h2>
<p>Follow abrasive&#8217;s directions in the README <a href="http://bur.st/~abrasive/wm8505_linux/1.0/">here</a> to  set up the partitions on your SD card.</p>
<p>Before you boot the SD card, make the following 4 changes:</p>
<ol>
<li>In the FAT partition you made, replace script/scriptcmd with <a href="/files/eken/debian/scriptcmd">this scriptcmd file</a>.</li>
<li>Download the Eken official Android 1.6 upgrade <a href="http://www.slatedroid.com/vbulletin/downloads.php?do=file&#038;id=35">from here</a>, unzip it and copy the script/uzImage.bin file (kernel image) over script/uzImage.bin on the FAT partition you made.</li>
<li>In the ext2 partition, edit etc/inittab and replace this line:<br />
<code>#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100</code><br />
with this one:<br />
<code>T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100</code>
</li>
<li>Also in the ext2 partition, run <code>sudo mknod (mount-point-of-ext2-part)/dev/ttyS0 c 4 64</code>(or equivalent)</li>
</ol>
<p>(The last two steps are only strictly necessary if you want to use the serial console, but the first two are necessary all of the time.)</p>
<p>Then pop the card in and you should boot into Debian! The instructions on the <a href="http://bento-linux.org/wiki/vt8505/wm8505/debian">bento-linux Wiki</a> for X11 work as well, although I found I needed a window manager (like xfce4) installed before X11 would stay launched.</p>
<p><a href="/files/eken/images/img_2364.jpg"><img src="/files/eken/images/img_2364_thumb.jpg" alt="Default XFCE4 on my M001 tablet" /></a></p>
<p>EDIT: If you&#8217;re having trouble booting from SD, I just had an experience where uboot was refusing to load &#8217;scriptcmd&#8217; even though it was correct. I had to reformat the FAT partition and re-copy the files. Not sure what that was about, but might be worth trying if your Debian suddenly refuses to boot.</p>
<h2>Notes</h2>
<p>The new scriptcmd adds the kernel command line arg &#8220;console=ttyS0,115200n8&#8243; to the command line. Seems unnecessary, but I couldn&#8217;t get it to boot successfully at all without this addition.</p>
<p>If you don&#8217;t replace the netbook kernel with the one from Eken, you won&#8217;t get any graphics display. Although debian will still run fine through the serial port. I&#8217;m guessing the netbook kernel has the LCD buffer at a different address.</li>
<p>Eken boots android with mem=109M on the command line whereas abrasive has used mem=112M. I don&#8217;t know if the Android version is allocating extra space for framebuffer double buffering, or something else. I haven&#8217;t noticed any differences yet so I&#8217;m running with mem=109M.</p>
<p>I haven&#8217;t tried the <a href="http://bento-linux.org/wiki/vt8505/wm8505/debian">optional scriptcmd.install</a> to install Debian to the internal flash, yet.  I&#8217;m guessing you may need to repartition the mtd to get full use, as the Android partitioning scheme uses two partitions.</p>
<p>Pro tip: to see the insides of a scriptcmd file run &#8216;tail -c +73 scriptcmd&#8217;</p>
<p>Disk access when running from the SD card is sloooow (at least for slow SD cards like mine.) Don&#8217;t know if running from internal flash is any better.</p>
<p>I&#8217;m guessing that the framebuffer works normally in the Debian install because it isn&#8217;t using double-buffering, which is necessary for Android to work. I don&#8217;t know if &#8216;abrasive&#8217; had to do anything special to get the &#8216;fbcon&#8217; console module to work, I&#8217;m going to try and find out though!</p>
<p><i>EDIT: Jacob Stoner has come up with a small program to init the touchscreen, and a more recent version of evtouch that works for input. <a href="http://38.99.171.104/~slatedr1/showthread.php/2783-Bounty-for-Working-Debian-with-Touchscreen-Driver-for-the-Eken-m001?p=23923&#038;viewfull=1#post23923">info here</a>, <a href="http://www.jacobstoner.com/touchpad_init.zip">init program</a> &amp; <a href="http://www.jacobstoner.com/evtouch.tgz">recent evtouch</a>. He says he&#8217;s going to come out with an installable package (no serial/keyboard required) shortly.</i></p>
<p>I had a quick try at copying across the wm9715-api.ko &amp; wm9715-ts_800_480.ko touchscreen modules from the Eken firmware, and using them with the package xserver-xorg-input-evtouch to provide a touchscreen mouse. No luck, though. The &#8216;evtest&#8217; utility shows screen presses coming in, but no X/Y coordinates. A better approach might be to compile the <a href="http://opensource.wolfsonmicro.com/node/7">the Wolfson</a> OSS drivers against the 2.6.29 kernel headers.</p>
<p>
Finally,</p>
<h2>Want a quick laugh?</h2>
<p><code><br />
~# modinfo wm9715-api.ko<br />
filename:       wm9715-api.ko<br />
author:         VIA ShenZhen MCE SW Team<br />
license:        GPL<br />
description:    WM9715 api for the driver of touchscreen and battery<br />
</code><br />
GPL, huh? This is kind of &#8220;GPL&#8221; where noone releases any source code. Ho ho ho! Thanks VIA, Wondermedia &amp; Eken.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/07/debian-on-the-eken-m001/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Eken M001 Protection, Phone Home &amp; &#8220;Demo Purpose Only&#8221;</title>
		<link>http://projectgus.com/2010/07/eken-m001-phone-home/</link>
		<comments>http://projectgus.com/2010/07/eken-m001-phone-home/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 00:41:06 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Talky]]></category>
		<category><![CDATA[eken m001 tablet]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shanzhai]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=332</guid>
		<description><![CDATA[&#8220;Derek&#8221; posted up a comment yesterday:

I have a EKEN M001, which will not unlock the screen by pressing MENU.
I have tried reseting the EKEN M001 by pressing the Reset button on the back ofthe MID, but te screen stays unlocked.
The top of the screen says: “Demo Version” when the GUI appears, does this need a [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Derek&#8221; posted up a comment yesterday:</p>
<blockquote><p>
I have a EKEN M001, which will not unlock the screen by pressing MENU.</p>
<p>I have tried reseting the EKEN M001 by pressing the Reset button on the back ofthe MID, but te screen stays unlocked.</p>
<p>The top of the screen says: “Demo Version” when the GUI appears, does this need a Operating System update. If so, hpw can this be done.
</p></blockquote>
<h2>Short Answer</h2>
<p>I think your tablet has failed its internal licensing check. Try to return it to the retailer that you bought it from. If you now connect it to the internet, it will &#8220;phone home&#8221; to a company in Shenzhen, China.</p>
<p>EDIT: Before you give up try connecting to the internet for a while and leave it connected. It seems like sometimes &#8220;phoning home&#8221; will verify that it&#8217;s a legit install and then the message will go away.</p>
<h2>Long Answer</h2>
<p>This is a coincidence, because just yesterday I was looking at the decompiled Eken libraries <a href="http://www.slatedroid.com/vbulletin/showthread.php?988-Kernel-source-almost-available&#038;p=8615&#038;viewfull=1#post8615">posted to slatedroid</a> by &#8216;bushing&#8217;. Hidden in there is licensing code that verifies the Eken is running on genuine hardware. I think it works like this:</p>
<ul>
<li>The Eken has a serial number loaded into its CPU (a WMT system parameter in the SoC.)</li>
<li>The serial number maps to the hardware (MAC) address of the onboard wireless adapter.</li>
<li>At startup, the Eken loads the serial number and compares it with the serial number it calculates from the wireless adapter.</li>
<li>If they do not match, it locks and throws up &#8220;Demo Purpose Only&#8221;  (possibly &#8220;Demo version has expired&#8221; on the latest firmware.) It will also continually try to &#8220;phone home&#8221; with some details about the device (see below.)</li>
</ul>
<p>I think all of this is to prevent someone putting their firmware into another device, unlicensed. The code is obfuscated (intentionally hidden in the source) in the hope that a casual  <a href="http://en.wikipedia.org/wiki/Shanzhai">shanzhai</a> observer will miss it.</p>
<p>From looking around the internet, it looks like quite a few devices are turning up brand new with &#8220;Demo Purpose Only&#8221;. The only easy thing to do is to return it to the retailer that you bought it from.</p>
<p>It is possible some retailers are selling fake or refurbished units (maybe they swapped the WiFi unit or the CPU daughterboard out.) In other cases <a href="http://www4.dealextreme.com/forums/Forums.dx/Forum.39169~threadid.646548">like this</a>, it looks like units may be shipping from Eken with invalid serial numbers (poor quality control?) Finally, in cases <a href="http://www.slatedroid.com/vbulletin/showthread.php?1100-demo-purpose-only-...-no-marketplace-.....-appreciate-any-help">like this</a> it seems that temporary problems with the WiFi may trigger this behaviour for a while, then it fixes itself.</p>
<h2>Eken Phone Home</h2>
<p>I found it quite surprising that the unit tries to phone home if it thinks its license is invalid. It phones home with 3 details:</p>
<ul>
<li>A username &amp; password which is decoded from the file /data/wmtpref/custkey (in the firmware itself.)</li>
<li>The MAC address of the wireless adapter
</ul>
</p>
<p>&#8230; the very odd thing is that the unit does not phone home to Eken. It phones home to a company called <a href="http://www.aiteer.com/">Aiteer</a>, who are also based in Shenzhen but do not seem to have any published relationship with Eken. Aiteer&#8217;s web site doesn&#8217;t say anything about software development, but I can only guess that they did the firmware development for Eken and possibly related MID/tablet devices using the WM8505 chipset.</p>
<h2>Other Thoughts</h2>
<p>It&#8217;s odd that the firmware locks the user out and tries to phone home, because if the user is locked out then it&#8217;s unlikely that they&#8217;re going to be able to connect to the internet. Maybe I missed a detail in my reverse-engineering, and the lockout only kicks in every few minutes or something.</p>
<p>Although &#8220;phoning home&#8221; is pretty common, software phoning home without the knowledge or consent of the user is less common and is often regarded as unethical. I&#8217;m glad that in this case no personal information is being sent back, but clearly we&#8217;re at the mercy of the manufacturers in this regard. Unlike mainstream manufacturers, companies like Eken have no corporate presence outside of their factory in China &#8211; in other countries, the laws that protect consumers are effectively powerless. If you hypothetically did find out that an unscrupulous shanzhai was stealing your personal details, there is no real recourse you could take.</p>
<p>The license check code was obfuscated in the library (libui.so in this case) so that a casual observer would not see it. For example, nothing unusual showed up when I ran &#8217;strings&#8217; the other day. However, a tiny bit more reverse-engineering shows up a helper method calling base64_decode to decode each of the string constants related to the license check.</p>
<p>The code used to decode the username &amp; password from the customer key, as well as the code used to calculate the serial number, are both trivially simple and anyone with some C programming knowledge can decipher them from the decompiled dump in an hour or two. For this reason, I think that the manufacturers only put in this protection to avoid casual copying of their firmware into another product &#8211; anyone serious about ripping them off could spend a couple of hours and generate their own serial numbers, and disable the &#8220;phone home&#8221; feature, without needing to modify the binary code at all.</p>
<p>Because the serial number is tied to the MAC, I don&#8217;t think anyone will be able to replace the WiFi module at all &#8211; even though you own the product.</p>
<p>It bothers me a lot that Eken are going to lengths to protect the tiny amount of proprietary code in their product, while not doing anything to fulfill either the legal obligations or the spirit of the substantial open source parts of the product. It bothers me doubly so now that they&#8217;ve locked out the root serial console in the latest (1.7.4) firmware release. How do they think that this helps their product?</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/07/eken-m001-phone-home/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Structured EEPROM access with Arduino/AVRs</title>
		<link>http://projectgus.com/2010/07/eeprom-access-with-arduino/</link>
		<comments>http://projectgus.com/2010/07/eeprom-access-with-arduino/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 02:48:06 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=316</guid>
		<description><![CDATA[On an Arduino or other AVR, EEPROM access is a bit fiddly if you want to store different types of data. In this blog post, I&#8217;ll show you a quick trick to use when you have lots of structured data to store in EEPROM.
Alternatives
First, the existing alternatives:

Arduino has EEPROM, which is simple but it only [...]]]></description>
			<content:encoded><![CDATA[<p>On an Arduino or other AVR, EEPROM access is a bit fiddly if you want to store different types of data. In this blog post, I&#8217;ll show you a quick trick to use when you have lots of structured data to store in EEPROM.</p>
<h2>Alternatives</h2>
<p>First, the existing alternatives:</p>
<ul>
<li>Arduino has <a href="http://www.arduino.cc/en/Reference/EEPROM">EEPROM</a>, which is simple but it only reads/writes single bytes.</li>
<li>Arduino Playground has two <a href="http://www.arduino.cc/playground/Code/EEPROMWriteAnything">templated functions</a> that let you read/write anything. However, you need to know the offset of whatever you are accessing. Also, I find C++ templates a bit icky for this use case.</li>
<li>One level deeper, <a href="http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html">avr-libc</a> has a more complex API for other kinds of integers, and buffers. However, you still need to remember offsets &amp; sizes.</li>
<li>The <a href="http://tinkerlog.com/2007/06/16/using-progmem-and-eemem-with-avrs/">EEMEM</a> keyword works like PROGMEM to let you flag things as stored in the EEPROM. Which is nice, but you still need to pass size and offset whenever you read a value.</li>
</ul>
<p><br/></p>
<h2>Technique</h2>
<p>
This technique uses a single &#8217;struct&#8217; to represent the entire contents of your EEPROM, so you can then use macros to read and write fields.</p>
<p>You define a struct called __eeprom_data that describes your EEPROM:</p>
<pre class="brush: cpp; light: true;">
struct __eeprom_data {
  int first;
  int second[64];
  boolean third;
  char fourth[buf_len];
}
</pre>
</p>
<p>Then use macros eeprom_read &amp; eeprom_write to read and write each field:</p>
<pre class="brush: cpp; light: true;">
int x;
eeprom_write(-7, first);
eeprom_read(x, first);
</pre>
</p>
<p><br/></p>
<h2>Full Example</h2>
<pre class="brush: cpp; light: true;">

/*
 * Copy and paste this block of #include &amp; #defines into your code to use
 * this technique.
 *
 * (Don't worry too much about reading the macros, read through the
 * examples below instead.)
 */

#include &lt;avr/eeprom.h&gt;
#define eeprom_read_to(dst_p, eeprom_field, dst_size) eeprom_read_block(dst_p, (void *)offsetof(__eeprom_data, eeprom_field), MIN(dst_size, sizeof((__eeprom_data*)0)-&gt;eeprom_field))
#define eeprom_read(dst, eeprom_field) eeprom_read_to(&amp;dst, eeprom_field, sizeof(dst))
#define eeprom_write_from(src_p, eeprom_field, src_size) eeprom_write_block(src_p, (void *)offsetof(__eeprom_data, eeprom_field), MIN(src_size, sizeof((__eeprom_data*)0)-&gt;eeprom_field))
#define eeprom_write(src, eeprom_field) { typeof(src) x = src; eeprom_write_from(&amp;x, eeprom_field, sizeof(x)); }
#define MIN(x,y) ( x &gt; y ? y : x )

const int buflen = 32;

/*
 * __eeprom_data is the magic name that maps all of the data we are
 * storing in our EEPROM
 */
struct __eeprom_data {
  int first;
  int second;
  boolean third;
  char fourth[buflen];
  char fifth[buflen];
};

void setup()
{
   Serial.begin(57600);

   /*
    * Writing simple variables to the EEPROM becomes simple
    *
    * First argument is the value to write, second argument is which field
    * (in __eeprom_data) to write to.
    */
   int q = 132;
   eeprom_write(q, first);
   eeprom_write(5958, second);
   eeprom_write(false, third);
   eeprom_write(&quot;Hello from EEPROM!&quot;, fourth);

   /*
    * You can even write from a pointer address if need be
    *
    * First argument is the pointer to write from.
    * Second argument is the field (in __eeprom_data)
    * to write to.
    * Third argument is the buffer length
    */
    const char * buf = &quot;Another hello looks like this&quot;;
    eeprom_write_from(buf, fifth, strlen(buf)+1);

    int a, b;
    boolean c;
    char d[buflen], e[buflen];
    char *e_p = e;

    /*
     * Reading back is just as simple. First argument is the variable to read
     * back to, the second argument is the field (in __eeprom_data) to read
     * from.
     */
    eeprom_read(a, first);
    eeprom_read(b, second);
    eeprom_read(c, third);
    eeprom_read(d, fourth);

    /*
     * You can read back to a pointer address, if you need to.
     */
    eeprom_read_to(e_p, fifth, buflen);

    Serial.println(a);
    Serial.println(b);
    Serial.println(c ? &quot;TRUE&quot; : &quot;FALSE&quot;);
    Serial.println(d);
    Serial.println(e_p);

    /*
     * The eeprom_write macros do bounds checking,
     * so you can't overrun a buffer.
     *
     * In __eeprom_data, 'third' is a one-byte boolean, but
     * eeprom_write knows this so only the first char 'T' is written
     * to EEPROM
     */
    eeprom_write(&quot;This is a buffer overflow&quot;, third);

    /*
     * If you have an array, like char[], you can write &amp; read a single
     * array entry from a particular constant index
     *
     * Unfortunately, it only works for constant indexes not variables.
     * eeprom_write('X', fourth[x]) does not work with these macros.
     */
    eeprom_write('X', fourth[3]);
    eeprom_read(d, fourth);
    char x;
    eeprom_read(x, fourth[3]);
    Serial.println(d);
    Serial.println(x);
}

void loop() { }
</pre>
<p>(This is Arduino code, obviously if you&#8217;re using avr-libc directly then you can rewrite it for that.)
</p>
<h2> Downsides</h2>
<p>The downsides of this technique (as I see them) are:</p>
<ul>
<li>Uses macro magic (so a bit icky.)</li>
<li>Overkill if you only need to store one type of data in EEPROM, but useful if you have lots of different types.</li>
</ul>
<p><br/></p>
<h2>Initial Values</h2>
<p>When you start up, you need to know if the data in EEPROM is data that your program saved, or something else. There are a few different ways to deal with this. </p>
<h3>EEMEM</h3>
<p>EEMEM provides a way for you to set default values easily in your code:</p>
<pre class="brush: cpp; light: true;">
EEMEM struct __eeprom_data initial_data EEMEM = {
  1, // first
  2, // second
  false, // third
  &quot;Initial fourth&quot;, // fourth
   &quot;Initial fifth&quot; // fifth
};
</pre>
<p>Via avr-objcopy &amp; avrdude you can generate a .eep file and flash it to the AVR. This is nice, but it won&#8217;t work if you&#8217;re using the Arduino IDE because (as of version 0018) it doesn&#8217;t generate .eep files properly, and it also doesn&#8217;t support flashing them.</p>
<p>It&#8217;s a good option if you&#8217;re using your own Makefile, though.</p>
<h3>&#8220;Magic&#8221; number</h3>
<p>The other way is to check for and expect a &#8220;magic&#8221; value somewhere in the EEPROM data. Something like:</p>
<pre class="brush: cpp; light: true;">
// Change this any time the EEPROM content changes
const long magic_number = 0x5432;

struct __eeprom_data {
  long magic; // should be set to magic_number
  int first;
  int second;
}

void setup() {
  long magic;
  eeprom_read(magic, magic);
  if(magic != magic_number)
    initialise_eeprom();
}

void initialise_eeprom() {
  eeprom_write(0, first);
  eeprom_write(0, second);
  eeprom_write(magic_number, magic);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/07/eeprom-access-with-arduino/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Eken M001 teardown &amp; serial console</title>
		<link>http://projectgus.com/2010/06/eken-m001-teardown-serial-consol/</link>
		<comments>http://projectgus.com/2010/06/eken-m001-teardown-serial-consol/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 13:00:11 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eken m001 tablet]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=291</guid>
		<description><![CDATA[See here for my review of the M001.

This teardown shows the V006 revision of the board, a quick serial port install, and includes some console/dmesg output. The main difference between V005 and V006/V007 board revisions seems to be relocating the USB WiFi dongle to a better position.
EDIT: It took me a while to post this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projectgus.com/2010/06/eken-m001-android-tablet-review-pt-1/">See here for my review of the M001</a>.</p>
<p><a href="http://projectgus.com/files/eken/images/eken-fullsize-2.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-2.jpg" alt="Eken M001" /></a></p>
<p>This teardown shows the V006 revision of the board, a quick serial port install, and includes some console/dmesg output. The main difference between V005 and V006/V007 board revisions seems to be relocating the USB WiFi dongle to a better position.</p>
<p><i>EDIT: It took me a while to post this article, and Slatedroid is down this past week. So links to there will be broken (hopefully not for good.)</i></p>
<p>This isn&#8217;t the first teardown of the Eken M001, the first one was the &#8220;<a href="http://www.slatedroid.com/vbulletin/tear-apart/17-aimless-teardown.html">Aimless Teardown</a>&#8221; and there is also a <a href="http://www.youtube.com/watch?v=L12XFfI1BZ">disassembly howto video</a> by another community member.</p>
<h3>Warning</h3>
<p>I&#8217;ve had lots of hardware problems with my Eken since I took it apart. They may have been there before, but maybe not. YMMV, but be careful and remember you may not still have a warranty after the device has been opened, and especially after it&#8217;s been modified.</p>
<p>Specifically, I have two problems. There is a cold solder joint in one corner of the board (I&#8217;m currently warming it up before it will boot at all.) Also I get occasional failure of the LCD (totally black) on reassembly, which requires me to press on the front of the unit until it clicks back on.</p>
<h3>Getting In</h3>
<ol>
<li>Remove the two phillips screws on each side of the base:<br />
<a href="http://projectgus.com/files/eken/images/eken-fullsize-4.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-4.jpg" alt="Base of Eken" /></a>
</li>
<li>
<p>The only other thing holding the back on is a series of plastic clips around the outside of the unit. Working from the base (the first clip is half-way between the two screws), carefully insert a plastic spudger or a knife (worse, but what I used) and jiggle it around until each clip snaps open. Some clips may break, they&#8217;re not very strong.</p>
<p>Then work your way along towards the top of the unit:<br />
<a href="http://projectgus.com/files/eken/images/eken-fullsize-5.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-5.jpg" alt="Eken part open" /></a></p>
<p><a href="http://projectgus.com/files/eken/images/eken-fullsize-6.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-6.jpg" alt="Eken more open" /></a>
</p>
</li>
<li>Once all the clips have popped, remove the plastic back. Take care not to disturb the small speaker<br />
<a href="http://projectgus.com/files/eken/images/eken-fullsize-7.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-7.jpg" alt="Small speaker in the plastic back" /></a><br />
<a href="http://projectgus.com/files/eken/images/eken-fullsize-8.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-8.jpg" alt="Plastic back" /></a>
</li>
</ol>
<h3>Main Board</h3>
<p><a href="http://projectgus.com/files/eken/images/eken-fullsize-9.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-9.jpg" alt="Main board as installed" /></a><br />
(Click through for a high-res version.)</p>
<p>You can see:</p>
<ul>
<li>Battery and backlight connectors bottom-left</li>
<li>Internal USB soldered to pads bottom-right (leading up to the USB WiFi module, installed top left.)</li>
<li>LCD and touchscreen ribbon connectors on the left side.</li>
<li>Main CPU daughterboard in DIMM socket.</li>
<h3>CPU Board</h3>
<p>Here&#8217;s some shots of the CPU daughterboard:<br />
<a href="http://projectgus.com/files/eken/images/eken-fullsize-12.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-12.jpg" alt="CPU daughterboard front" /></a><br />
<a href="http://projectgus.com/files/eken/images/eken-fullsize-11.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-11.jpg" alt="CPU daughterboard back" /></a><br />
The board is hosting a VIA/Wondermedia WM8505 SoC. Datasheet shared <a href="http://tails92.sepwich.com/files/easypc/datasheets/DS_WM8505_071.pdf.gz">here</a> (courtesy Slatedroid, again.</p>
<h3>Serial Connector</h3>
<p>J17 on the back of the board is a RvTTL (3.3v) serial port. 115200 8N1. Pinout, left to right, is Vcc Tx Rx Gnd.</p>
<p>I didn&#8217;t take any photos of it before I soldered on my serial port, but here it is after:<br />
 <a href="http://projectgus.com/files/eken/images/eken-fullsize-14.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-14.jpg" alt="Eken M001 serial port" /></a>
</p>
<p>The only other interesting thing I saw on the back of the board was the 2Gb NAND flash:<br />
 <a href="http://projectgus.com/files/eken/images/eken-fullsize-13.jpg"><img src="http://projectgus.com/files/eken/images/eken-thumb-13.jpg" alt="2Gb NAND flash" /></a>
</p>
<h3>Boot logs</h3>
<p>Once you have the serial port connected, you can grab some log data easily (and you also get a root shell once startup completes.)</p>
<p>EDIT: As of firmware release 1.7.4, no more automatic root shell on serial console. It&#8217;s still a boot console, but for root you need to log in&#8230; Poor show, Eken.</p>
<p><a href="http://projectgus.com/files/eken/logs/eken_bootlog.txt">Standard kernel boot log, plus some /proc entries</a><br/><br />
<a href="http://projectgus.com/files/eken/logs/eken_upgradelog_factory.txt">Log of a factory upgrade via SD card</a>
</p>
<p>I meant to capture and post some of the &#8216;logcat&#8217; Android log output as well, from standard startup, but it doesn&#8217;t look like I kept any.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/06/eken-m001-teardown-serial-consol/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Notes on porting Android 2.x to Eken M001</title>
		<link>http://projectgus.com/2010/06/notes-on-porting-android-2-x-to-eken-m001/</link>
		<comments>http://projectgus.com/2010/06/notes-on-porting-android-2-x-to-eken-m001/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 12:54:41 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eken m001 tablet]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=268</guid>
		<description><![CDATA[Over the past couple of evenings I&#8217;ve been looking into porting Android 2.x (eclair or froyo) to the Eken M001. These are my notes from unsuccessful binary-only reverse engineering.
Short version
Although Android 2.1, and possibly 2.2, will run against Eken&#8217;s supplied 2.6.29 kernel, Eken have patched several of the &#8216;base&#8217; userspace binaries against the proprietary Wondermedia [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past couple of evenings I&#8217;ve been looking into porting Android 2.x (eclair or froyo) to the <a href="http://projectgus.com/2010/06/eken-m001-android-tablet-review-pt-1/">Eken M001</a>. These are my notes from unsuccessful binary-only reverse engineering.</p>
<h3>Short version</h3>
<p>Although Android 2.1, and possibly 2.2, will run against Eken&#8217;s supplied 2.6.29 kernel, Eken have patched several of the &#8216;base&#8217; userspace binaries against the proprietary Wondermedia SDK. Without accessing the SDK, or reverse engineering the SDK&#8217;s workings, it may not be possible to port Android 2.x to the Eken.</p>
<p>I worked this out trying to install the iPhone Android 2.2 port by munging it into the existing Eken binary firmware. I initially had a lot of success, because the <a href="http://www.gadgetsdna.com/how-to-install-android-2-2-froyo-on-iphone-3g/3501/">link I followed </a> was completely wrong, and I had the Android 1.6 iPhone build. After I got that booting to the home screen, someone on the slatedroid forums let me know it was the wrong version. Oops! I then found a genuine binary release of <a href="http://ifroyo.blogspot.com/">Froyo for iPhone</a> and tried the same tricks, without success.</p>
<p>In this post I&#8217;ll explain what I learned. I hope it&#8217;s of use to someone.</p>
<h3>Differences in firmware format</h3>
<p>One of the first things that you&#8217;ll notice is that Eken firmware looks different to &#8220;normal&#8221; Android disk images. Instead of a group of disk images, the main Android userspace data is contained in two tarballs &#8211; android_fs.tgz and data.tgz. android_fs.tgz contains the parts of the filesystem would normally be mounted from ramdisk.img and system.img, data.tgz contains the parts from userdata.img.</p>
<p>A u-boot script (scriptcmd) in the firmware package performs an initial flash of the bootloader and then directs the Eken to boot from a small ramdisk image on the SD card. Ramdisk init then runs update.sh to reflash the firmware onto the internal flash.</p>
<p>Other than the different firmware image layout, the firmware layout of a running Eken is similar to any other Android system.</p>
<h3>Using the Eken kernel</h3>
<p>There are no kernel sources, so the Eken-provided 2.6.29 kernel is the only one we have. Slatedroid user <i>bushing</i> has started working on an alternative kernel, <a href="http://github.com/bushing/android_wm8505">here</a>, but it is very early days (doesn&#8217;t boot, let alone support any of the Eken&#8217;s WM8505 hardware.)</p>
<p>I don&#8217;t this is the big problem for Android 2.x, though. 2.1 officially supports kernel 2.6.29, and it looks like the 2.2 userspace components might even run against the 2.6.29 kernel without any serious problems (although probably with reduced performance.)</p>
<h3>Getting info</h3>
<p>The serial port on the board gives you a linux kernel console, and then a root shell with busybox. Running &#8216;logcat&#8217; gives you the Android log as it runs. Run &#8216;logcat -d&#8217; if you don&#8217;t want to lose your root shell forever. Strace is also available.</p>
<h3>Munging the firmwares</h3>
<p>My dodgy technique for munging the firmwares together was, roughly:</p>
<ul>
<li>Copy the iPhone system.img contents over system/ in android_fs</li>
<li>Copy init and init.rc from iPhone ramdisk.img to the root of android_fs</li>
<li>Merge differences between the new init.rc and the old Eken one.</li>
<li>Flash &amp; Boot!</li>
</ul>
<h3>Dodgy framebuffer driver</h3>
<p>This method eventually leaves you with a flashing LCD display, showing 4 distorted copies of the screen you&#8217;re expecting. That&#8217;s what I got with 1.6 &amp; 2.2, and I think that&#8217;s where Slatedroid modder ECOTOX <a href="http://www.slatedroid.com/index.php?topic=36.msg5226#msg5226">got to as well</a>.</p>
<p>If the Eken kernel provided a properly supported framebuffer device, this wouldn&#8217;t happen. The framebuffer device looks correct (although unaccelerated):</p>
<p><code><br />
/ # fbset -s -fb /dev/graphics/fb0</p>
<p>mode "800x480-0"<br />
        # D: 0.033 MHz, H: 0.035 kHz, V: 0.066 Hz<br />
        geometry 800 480 800 480 32<br />
        timings 30000000 40 24 32 11 96 2<br />
        accel false<br />
        rgba 8/16,8/8,8/0,0/0<br />
endmode<br />
</code></p>
<p>&#8230; but that&#8217;s not enough. There&#8217;s some userspace magic required to make the display work properly. Normally this would be implemented in the driver itself, and standard ioctl calls would make the changes. In this case, Android&#8217;s /system/lib/libui.so has been patched and now links against libwmtapi.so, a proprietary Wondermedia WM8505 SDK library:</p>
<p><code><br />
:lib gus$ strings libui.so | grep wmt<br />
wmt_vpp_init<br />
wmt_vpp_set_direct_path<br />
wmt_vpp_exit<br />
wmt_mb_init<br />
wmt_mb_alloc<br />
wmt_mb_user2phys<br />
libwmtapi.so<br />
wmt_setsyspara<br />
wmt_getsyspara<br />
wmt_getsocinfo<br />
wmt_vpp_set_direct_path<br />
</code></p>
<p>&#8230; I have no idea what it&#8217;s doing, but when I copied the patched libui.so (and dependencies) onto my Android 1.6 iPhone system, the display immediately started working.</p>
<p>On Android 2.2, copying the library causes system_server to segfault because the library is no longer ABI compatible. There have been big changes, just look at the <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=include/ui;h=f61942998f1cb856f99f93885e4084f6609f15ab;hb=donut">1.6 ui headers</a> compared to the <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=include/ui;h=aff7aed8bce78826ce849a66ffe645d8a79ec9c4;hb=eclair">2.1 ui headers</a>. So there&#8217;s no way the patched libui will work without the source patches being merged and recompiled, at the minimum.</p>
<p>That&#8217;s not all either, there are actually quite a few Android libraries linked against WMT libraries, presumably with other patches:<br />
<code><br />
$ grep libwmt *<br />
Binary file libcamera.so matches<br />
Binary file libmediaplayerservice.so matches<br />
Binary file libopencore_player.so matches<br />
Binary file libui.so matches<br />
</code>
</p>
<h3>Where to from here?</h3>
<p>Speaking for myself, I&#8217;m done, unless Eken release their Android &amp; kernel sources. There&#8217;s no sense in working to improve a product when the company itself is blatantly abusing OSS and refusing to honour its obligations.</p>
<p>On the other hand, even if an Eken source release left out the Wondermedia SDK, it would be a great start.</p>
<p>In the absense of the source, it seems there would be two options for the intrepid coder. The first would be to reverse-engineer the WM8505 hardware and write an OSS version of the platform drivers. This would be a massive job, although there is a datasheet we don&#8217;t even have JTAG available for debugging.</p>
<p>Alternatively, some judicious use of objdump would probably show what calls are being made to libwmt. With that knowledge, it is possible to reverse engineer function declarations and create patches for the relevant sources in Android 1.6, then port those source patches to Android 2.x. (I posted steps that I would try to follow, <a href="http://www.slatedroid.com/index.php?topic=36.msg7441#msg7441">here</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/06/notes-on-porting-android-2-x-to-eken-m001/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Eken M001 Android tablet review (Pt 1)</title>
		<link>http://projectgus.com/2010/06/eken-m001-android-tablet-review-pt-1/</link>
		<comments>http://projectgus.com/2010/06/eken-m001-android-tablet-review-pt-1/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 13:17:05 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Talky]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eken m001 tablet]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=233</guid>
		<description><![CDATA[This is part one of an 3 part mini review of the Eken M001 tablet, from a tinkerer&#8217;s perspective.

Part One: Review of the M001 as a tablet.
Part Two: Teardown &#38; serial console.
Part Three: The M001 board as an embedded computer for robotics.(Robotics plan aborted due to poor build quality &#38; insufficient vendor support, see below.)



What [...]]]></description>
			<content:encoded><![CDATA[<p>This is part one of an 3 part mini review of the Eken M001 tablet, from a tinkerer&#8217;s perspective.</p>
<ul>
<li><strong>Part One</strong>: Review of the M001 as a tablet.</li>
<li><strong>Part Two</strong>: <a href="http://projectgus.com/2010/06/eken-m001-teardown-serial-consol/">Teardown &amp; serial console</a>.</li>
<li><span style="text-decoration: line-through"><strong>Part Three</strong>: The M001 board as an embedded computer for robotics</span>.<br/>(Robotics plan aborted due to poor build quality &amp; insufficient vendor support, see below.)</li>
</ul>
<p><br/>
</p>
<h2>What is it?</h2>
<p>It&#8217;s a <a href="http://www.dealextreme.com/details.dx/sku.39169">sub-$100 tablet computer</a> running Android, with a 7 inch touchscreen and 2Gb of onboard storage.</p>
<p><a href="/files/eken/images/eken-fullsize-2.jpg"><img src="/files/eken/images/eken-thumb-2.jpg" alt="Eken on my desk" /></a></p>
<p>There are a few other cheap models with the same chipset, like the <a href="http://www.dealextreme.com/details.dx/sku.39448">M003</a> (bigger 8&#8243; screen) and a <a href="http://www.dealextreme.com/details.dx/sku.39670">netbook form factor</a> model.</p>
<h2>Summary</h2>
<p>You get what you pay for.</p>
<h2>Longer Summary</h2>
<p>If you want an iPad, but don&#8217;t want to spend the cash. Don&#8217;t buy this. It&#8217;s not in the same league as devices like the iPad</p>
<p>If you want a &#8220;tablet device&#8221;, just not an iPad because you&#8217;re ideologically or tribally opposed to Apple, or you&#8217;re sure you need something that the iPad doesn&#8217;t do. Don&#8217;t buy this either. You&#8217;ll be underwhelmed, and eventually it&#8217;ll end up gathering dust on a shelf while you look to the next big <i>iPad killer</i>.</p>
<p>If you want a digital photo frame, a clumsy furless chumby, a mediocre tethered video player, or an ebook reader that works in the dark for limited periods. This might prove OK for your needs.</p>
<p>If you just want something to tinker with, then this is a good cheap gizmo to tinker with.</p>
<p><a href="/files/eken/images/eken-fullsize-1.jpg"><img src="/files/eken/images/eken-thumb-1.jpg" alt="Eken in the dark"/></a></p>
<h2>The Good</h2>
<p><strong>Price</strong>. $99 including shipping anywhere in the world. &#8216;Nuff said.</p>
<p><strong>LCD</strong>. It&#8217;s actually pretty good for a cheap LCD display, especially if you&#8217;re in low light.</p>
<p><strong>Performance</strong>. Pretty good in general, UI is responsive and snappy. Better than an iPhone 2G, similar to a 3GS. Some performance tasks (like video playback, depending on codec &amp; resolution) are a bit limited by the CPU, though.</p>
<p><strong>Community</strong>. A <a href="http://www.slatedroid.com/">small community</a> is forming around the M001. They have already come up with some software improvements. Unfortunately, they are limited by poor vendor support (see below.)</p>
<h2>The Bad</h2>
<p><strong>Touchscreen</strong>. It&#8217;s resistive, so it&#8217;s never going to be much good for finger presses. My unit has major problems with mis-touches (wrong buttons being pressed) and identifying the difference between a tap and a swipe. Using a stylus didn&#8217;t really help, either. I think this might be solvable in software though, with better debouncing in the touchscreen driver.</p>
<p><strong>Build quality</strong>. It isn&#8217;t going to fall apart immediately, but it&#8217;s not built to last. In particular, things like the LEDs are just cheap and nasty &#8211; one of the 3 indicator LEDs is enough to light up all 3 recesses, and the area around it.</p>
<p>In indoor lighting, it makes the LEDs really hard to read (only one is on in this shot!):<br />
<a href="/files/eken/images/eken-fullsize-3.jpg"><img src="/files/eken/images/eken-thumb-3.jpg" alt="LEDs" /></a></p>
<p>In darkness, the whole thing glows:<br />
<a href="/files/eken/images/eken-fullsize-15.jpg"><img src="/files/eken/images/eken-thumb-15.jpg" alt="Glowing M001" /></a></p>
<p><strong>Fake chrome around the LCD</strong>. What were they thinking? Looks good in promo shots, means you have a reflection of your face any time you use the device in bright light. Really bad usability choice.</p>
<p><strong>Battery Life</strong>. Seems like 2-3 hours is the norm, and the battery runs down at almost the same rate when the device is idle compared to when it is in use. Probably a driver problem, but whether it can/will be fixed is up in the air.</p>
<p><strong>Accelerometer</strong>. Way too sensitive, the tablet flips orientation at any chance &#8211; including just when laid down on a table. Another driver sensitivity issue, I&#8217;m guessing.</p>
<p><strong>Android 1.6</strong>. Lack of 3D acceleration, and only 128Mb of RAM, give the general opinion that Android 1.6 will be the last version that runs well on this device. That said, noone has actually run 2.x on it yet.</p>
<p><strong>Bad vendor support</strong>. Eken haven&#8217;t released any of the GPL sources that they&#8217;re required to release. Not only is this in violation of the license, it prevents community members from working together to improve the software and the device performance. If I had to pick one thing that limits the potential for the M001, this would be it.</p>
<p>I think in this market a vendor who really nurtured open source development, and swiftly incorporated improvements back into the official software updates, would find a real competitive advantage &#8211; the product would still be cheap, but the software and driver layers would be less buggy and restrictive.</p>
<h2>Conclusion</h2>
<p>I didn&#8217;t buy this as a tablet (I bought it for a robot platform), so maybe I&#8217;m not the best person to review it as a tablet. However, I can&#8217;t see myself ever reaching for the M001 to perform anything but the simplest of tasks &#8211; watching a video I&#8217;d already loaded on it, for example.</p>
<p>My prediction is that in 3 months, pending some amazing community software developments, many of the models sold to date will be gathering dust in a corner.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/06/eken-m001-android-tablet-review-pt-1/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Apple takes all</title>
		<link>http://projectgus.com/2010/04/apple-takes-all/</link>
		<comments>http://projectgus.com/2010/04/apple-takes-all/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 12:12:13 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Talky]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[folk festivals]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[monoculture]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=196</guid>
		<description><![CDATA[I&#8217;m a bit late to the party on this one. I&#8217;ve read all of the big ranty iPhone and iPad arguments. I&#8217;ve worried a little about the monoculture that the iPhone represents. I decided these were mostly ivory tower arguments. Meaningful for geeks and technorati, but not for anyone much else.
I changed my mind this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a bit late to the party on this one. I&#8217;ve read all of the big ranty iPhone and iPad arguments. I&#8217;ve worried a little about the monoculture that the iPhone represents. I decided these were mostly ivory tower arguments. Meaningful for geeks and technorati, but not for anyone much else.</p>
<p>I changed my mind this weekend.</p>
<p><a href="http://www.flickr.com/photos/angusgr/2357800946/" title="The Dukhs (3 of 13) by angusgr, on Flickr"><img src="http://farm3.static.flickr.com/2020/2357800946_118f575600_m.jpg" width="161" height="240" alt="The Dukhs (3 of 13)" /></a></p>
<p>This weekend I attended the National Folk Festival here  in Canberra. Folk Festivals are a celebration of traditional folk music and folk arts. With a smattering of other musical traditions and innovations, the focus is on traditional musical instruments played in traditional folk styles.</p>
<p>As far as I can see, it&#8217;s about as far from Silicon Valley as you can get without winding up in Deliverance.</p>
<p><a href="http://projectgus.com/wp-content/uploads/2010/04/IMG_1770.jpg"><img src="http://projectgus.com/wp-content/uploads/2010/04/IMG_1770-259x300.jpg" alt="iPhone app programme over dead tree programme" title="... just got real" width="259" height="300" class="alignnone size-medium wp-image-200" /></a></p>
<p>This year, National Folk Festival has an iPhone app.</p>
<h3>History of the NFF Programme</h3>
<table cellspacing="3">
<tbody>
<tr>
<th>1967-</th>
<td>printed on paper</td>
</tr>
<tr>
<th>2000</th>
<td>also available as HTML</td>
</tr>
<tr>
<th>2003-</th>
<td>also available as PDF</td>
<tr>
<th>2010</th>
<td>also available as iPhone app</td>
</tr>
</tbody>
</table>
<p>This is a pretty momentous innovation.</p>
<p>Don&#8217;t get me wrong, it really is an innovation. At a festival where a dozen performers are playing at any given time, finding out what&#8217;s on is hard. Being able to see it quickly and easily on your mobile phone is extremely useful.</p>
<p>I&#8217;m worried because, as in all things, it&#8217;s an iPhone App. If you were a Mac or Linux user around 1999, you were probably familiar with web sites that required &#8220;Windows 95 &amp; Internet Explorer 5 or Better&#8221;. They didn&#8217;t work on your computer, or they only half worked.</p>
<p>We now have the same situation, ironically rearranged. If you have any other mobile phone, you are a second class online citizen. Everywhere, up to and including <i>folk festivals</i>.</p>
<p>Yes, you can probably read the PDFs on the web site. No, that&#8217;s not going to be very good. The iPhone app, on the other hand, is great.</p>
<p><a href="http://www.flickr.com/photos/angusgr/2357820418/" title="The Dancehall Racketeers (4 of 6) by angusgr, on Flickr"><img src="http://farm3.static.flickr.com/2050/2357820418_c7db58f8a9_m.jpg" width="161" height="240" alt="The Dancehall Racketeers (4 of 6)" /></a></p>
<p>Is there an alternative approach? Maybe. The <a href="http://folkfestival.asn.au" target="_blank">NFF site</a> is powered by WordPress. &#8220;Mobile site&#8221; plugins exist that could format the programme for various mobile browsing devices. With some CSS wizards at the helm, I&#8217;m sure it could be quite nice.</p>
<p>Would that experience be as good as the iPhone app? I doubt it. The iPhone app that Bonobo Labs have made is really slick. On the iPhone, I think it could be recreated as a web site for Mobile Safari. However, I don&#8217;t think it could reach that standard for every single mobile device.  The standards and the frameworks aren&#8217;t really there, and the browsers aren&#8217;t all up to it.</p>
<p>Making something that at least works on other phones is, however, very possible.</p>
<p><a href="http://www.flickr.com/photos/angusgr/2356973399/" title="Counterfeit Gypsies Palladium (3 of 6) by angusgr, on Flickr"><img src="http://farm3.static.flickr.com/2111/2356973399_29bb74ffcc_m.jpg" width="196" height="240" alt="Counterfeit Gypsies Palladium (3 of 6)" /></a></p>
<p>So what&#8217;s the point to this rant, then? Nothing really, except that I think it&#8217;s worth worrying about. In 2000 I was proud that I wasn&#8217;t stuck with Internet Explorer 5 &#8220;or better&#8221;. The alternatives were innovative and they helped dig the web out of a monoculture of ActiveX controls and bad proprietary HTML.</p>
<p>In 2010 I have an iPhone. I&#8217;m guilty about liking this monoculture so much. How are competitors going to innovate, short of providing a phone with a full Apple App Store compatibility layer? Is this really today&#8217;s IE 5? </p>
<p>(Photos taken by me at the <a href="http://www.flickr.com/photos/angusgr/sets/72157604224183620/">2008 festival</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/04/apple-takes-all/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenWRT 8.09 &amp; usb-storage</title>
		<link>http://projectgus.com/2010/03/openwrt-8-09-usb-storage/</link>
		<comments>http://projectgus.com/2010/03/openwrt-8-09-usb-storage/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 08:22:05 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=181</guid>
		<description><![CDATA[This is just a quick note on some experiences using an external USB drive with OpenWRT 8.09 on an Asus WL-500gP.
Mount options not honoured
It seems that mount options set in /etc/fstab aren&#8217;t honoured properly. I&#8217;ve filed a bug report here with a fix. If you have a running OpenWRT installation, you can grab the /sbin/usb-storage [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick note on some experiences using an external USB drive with OpenWRT 8.09 on an Asus WL-500gP.</p>
<h2>Mount options not honoured</h2>
<p>It seems that mount options set in /etc/fstab aren&#8217;t honoured properly. I&#8217;ve filed a bug report <a href="https://dev.openwrt.org/ticket/6955" target="_blank">here</a> with a fix. If you have a running OpenWRT installation, you can grab the /sbin/usb-storage replacement from there and copy it onto your router.</p>
<p>A particular badness of this bug is if you&#8217;re relying noatime/nodiratime to stop your disk spinning up, or your USB stick wearing out(!)</p>
<h2>USB startup timing</h2>
<p>This isn&#8217;t a bug in OpenWRT, just an annoyance.</p>
<p>On the Asus WL-500gP (at least), USB devices don&#8217;t come online until 10-20 seconds after startup. This means that USB disks don&#8217;t mount until some time during the boot process.</p>
<p>This causes a problem if you have any init scripts that rely on an external disk (for example, if you&#8217;ve added <a href="http://ipkg.nslu2-linux.org/feeds/optware/openwrt-brcm24/cross/unstable/" target="_blank">Optware</a> packages and symlinked in some Optware init scripts.)</p>
<p>The (half-assed) solution I have come up with is to put in an init script that waits for usb-storage to come online, and then sleeps while the disks are mounted. Make sure this script runs before any other init scripts that require the external disk.</p>
<ol>
<li>Download the script from <a href="http://projectgus.com/files/openwrt/usb-storage">here</a></li>
<li>Copy the script to /etc/init.d on the router.</li>
<li>Enable it with <i>/etc/init.d/usb-storage enable</i></li>
<li>You will now have /etc/rc.d/S50usb-storage. Make sure any other init scripts that rely on external disks come after &#8216;50&#8242;</li>
</ol>
<p>There are a variety of other hacks to get all this stuff working, this is just my take on it. It looks like external storage has been dramatically overhauled in the upcoming OpenWRT release, so hopefully it will no longer be an issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/03/openwrt-8-09-usb-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless client bridging with OpenWRT</title>
		<link>http://projectgus.com/2010/03/wireless-client-bridging-with-openwrt/</link>
		<comments>http://projectgus.com/2010/03/wireless-client-bridging-with-openwrt/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 11:44:44 +0000</pubDate>
		<dc:creator>angus</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://projectgus.com/?p=122</guid>
		<description><![CDATA[Renting sucks when you&#8217;re a nerd. When you move, you have to re-network all your bits and pieces, without the benefits of laying cable. Wireless is great, but not every network device has it. I have a VoIP phone and an XBMC XBox, each without wireless and each in a separate room.
I need a way [...]]]></description>
			<content:encoded><![CDATA[<p>Renting sucks when you&#8217;re a nerd. When you move, you have to re-network all your bits and pieces, without the benefits of laying cable. Wireless is great, but not every network device has it. I have a VoIP phone and an XBMC XBox, each without wireless and each in a separate room.</p>
<p>I need a way to connect the phone and the Xbox to my existing wireless access point.</p>
<p>Here&#8217;s a rough diagram of my network:<br/><div id="attachment_127" class="wp-caption alignnone" style="width: 487px"><a href="http://projectgus.com/wp-content/uploads/2010/03/Wireless-Blog-Diagram.png"><img src="http://projectgus.com/wp-content/uploads/2010/03/Wireless-Blog-Diagram.png" alt="Wired &amp; Unwired Diagram" title="Network Diagram" width="477" height="327" class="size-full wp-image-127" /></a><p class="wp-caption-text">Rough diagram of my network</p></div></p>
<h2>Options</h2>
<p>I want a flat network, single broadcast domain, for all of the (wired and unwired) devices in the diagram above.</p>
<p>I already have two Linux-compatible wireless routers, an Asus WL-500G and a Fonera. Both running OpenWRT.</p>
<p>If my routers had Broadcom wireless chipsets then this task would be easy. Thanks to driver support, OpenWRT can automatically bridge network segments through a wireless client (at least on 2.4 kernels, not sure about 2.6.) Neither of my routers have Broadcom. The Asus used to have it, but I swapped in an Atheros card. Oops.</p>
<p>WDS is a possibility, using each router as a repeater station. However, each repeater costs half the available bandwidth. I also can&#8217;t get WDS+WPA to work with my access point. YMMV.</p>
<p>You can set up separate networks, one for each segment, and the routers can route(!) between them using iptables. I&#8217;ve tried this and I don&#8217;t like it. It&#8217;s much easier when you have one single network with a single broadcast domain: simple DHCP, simple NetBIOS lookups, no routing tables to maintain, etc.</p>
<p>The final option, and the one I settled on, is using ARP-NAT.</p>
<h2>What is ARPNAT?</h2>
<p>ARPNAT is a clever hack. It&#8217;s the same idea as <a href="http://en.wikipedia.org/wiki/Network_address_translation" target="_blank">NAT</a> for IP networks, except it works one layer deeper. Instead of translating IP network addresses, the router translates between the MAC hardware addresses on each side of it.</p>
<p>If something on the wired side of the router makes an ARP request for the MAC address of an IP on the wireless side, then the router forwards the request as if it came from the router. When the response comes back, it mangles that too. Instead of passing back the real MAC (which lives on the wireless network), the router gives its own wired MAC address. Then, when it receives frames for IP addresses on the wireless network, it forwards them through. It does this to both sides of the bridge.</p>
<p>Here&#8217;s an example, taken from my network:</p>
<ol>
<li>XBMC Xbox asks &#8220;What is the MAC address of 10.0.0.1? Tell me: 10.0.0.5.&#8221; This is a broadcast ARP request over the wired ethernet.</li>
<li>Asus router sees the ARP request, and forwards the broadcast onto the wireless network, as &#8220;What is the MAC address of 10.0.0.1? Tell <i>me: 10.0.0.4</i>.&#8221;</li>
<li>Access point (at 10.0.0.1) gets the ARP request from the wireless, and replies with its MAC address: AA:AA:AA:AA:AA:AA.</li>
<li>Asus router gets the ARP response, sent to 10.0.0.4. It mangles it and forwards it back to the Xbox as &#8220;10.0.0.1 is at BB:BB:BB:BB:BB:BB&#8221;, where BB:BB:BB:BB:BB:BB is the wired address of the Asus itself.</li>
<li>Now, any time the Xbox wants to talk to 10.0.0.1, it will talk to BB:BB:BB:BB:BB:BB, and the Asus will forward that frame onto the wireless network, to the real destination AA:AA:AA:AA:AA:AA.</li>
</ol>
<p>On Linux, this is done using a patched version of the ethernet filtering program <a href="http://ebtables.sourceforge.net/" target="_blank">ebtables</a>.</p>
<h2>How to do it?</h2>
<p>Out of the box, OpenWRT does not support either ebtables or ARPNAT. The developers have expressed opinions that ARPNAT is a hack, and ebtables is too slow (see <a href="https://forum.openwrt.org/viewtopic.php?id=21805" target="_blank">here</a> &amp; <a href="https://dev.openwrt.org/ticket/3875" target="_blank">here</a>.) We&#8217;ll get to that issue, later.</p>
<p>However, there are some forum posts that show how to do it. In <a href="https://forum.openwrt.org/viewtopic.php?pid=98452#p98452" target="_blank">this post</a>, a developer of the OpenWRT fork <a href="http://www.gargoyle-router.com/" target="_blank">Gargoyle</a> links to their patch for ARPNAT. So, one option is to just use Gargoyle. Gargoyle apparently has a very nice web interface, and is good for intermediate users. I prefer flat config files, so I&#8217;m going to stick with OpenWRT.</p>
<h2>Building OpenWRT with ARPNAT Support</h2>
<p>If you&#8217;ve never compiled OpenWRT before, start <a href="http://wiki.openwrt.org/doc/howto/build" target="_blank">here</a>. Alternatively, I have some prebuilt 8.09.2 images for Atheros devices (like the Fonera), <a href="http://projectgus.com/files/openwrt/arpnat/images/">here</a>.</p>
<p>To build, you&#8217;ll need two patches. One is from Gargoyle. The other is a small bugfix to allow a DHCP client to run on the router. The patches can be found <a href="http://projectgus.com/files/openwrt/arpnat/patches/">here</a>. These patches are against the 8.09 branch of OpenWRT SVN, I don&#8217;t think either will apply to the trunk.</p>
<p>EDIT: I&#8217;ve just posted a slightly different patch, 04-arpnat-brcm47xx.patch, for brcm47xxx devices like the Asus WL-500g. It&#8217;s different because these devices have an older kernel version in 8.09, and also because the arpnat kernel module doesn&#8217;t seem to load the first time around. Also, on this architecture DHCP responses don&#8217;t seem to pass back correctly to devices on the other side of the bridge (while on my Atheros-based Fonera they are passed back.) I&#8217;m just using a static IP on those devices, for now. Things will also work fine if the DHCP server is on the bridge router, itself.</p>
<p>You&#8217;ll need to enable &#8216;ebtables&#8217; in your configuration (ie when you make menuconfig.) You&#8217;ll probably want wpa-supplicant as well. The .config that I used for the Fonera can be found at the link above, as well.</p>
<p>Once up and running, /etc/config/wireless only needs one tweak. Here&#8217;s mine:</p>
<pre class="brush: plain; light: true;">
config wifi-device  wifi0
	option type     atheros
	option channel  auto

config wifi-iface
	option device	wifi0
	option network	lan
	option mode	sta
	option client_bridge 1
	option ssid	&lt;your ssid here&gt;
	option encryption psk
	option key &lt;your key here&gt;
</pre>
<p>The only difference is &#8220;<b>option client_bridge 1</b>&#8220;, which indicates that you want ARPNAT enabled.
</p>
<p>/etc/config/network is simple, too. Here&#8217;s the bridge section of mine:</p>
<pre class="brush: plain; light: true;">
config interface lan
	option ifname	eth0
	option type 	bridge
	option macaddr  CC:CC:CC:CC:CC:CC
	option proto	dhcp
</pre>
<p>The only difference here is <b>option macaddr</b>. You will need this only if you want to assign the router&#8217;s IP address dynamically via DHCP. If you do this, &#8220;option macaddr&#8221; must be set to the MAC address of the interface where the DHCP server lives (ie wired side or wireless side.) The DHCP request will only go out on a single interface, so you need to make sure it is the correct one.
</p>
<p>If you don&#8217;t need DHCP then you don&#8217;t need to manually assign any MAC address. &#8220;option macaddr&#8221; can be totally removed.</p>
<p>That&#8217;s it! When the router boots up, it will connect to the wireless network, and any devices on the wired side will automatically be bridged onto the wireless (and vice-versa.) To them, it just looks like one big seamless network.</p>
<p>Bear in mind that not all routers support failsafe mode (Fonera for one), so if these values are wrong then you may end up locked out of your router, especially if you run the router with a DHCP-assigned address. If you&#8217;re not certain, I recommend running with a static IP first, so you can always plug in a network cable and still connect to the router.</p>
<p>Thanks again to Eric Bishop and the Gargoyle project, because it&#8217;s really his patch (building on other people&#8217;s work for ARPNAT) that makes all this possible.</p>
<h2>Problems with ARPNAT</h2>
<p>The OpenWRT developers will not consider ARPNAT, or even include ebtables, in the default package set of OpenWRT. They say this is because of performance impact. Every ethernet frame that hits the router needs to be inspected in software, so it&#8217;s understandable that there will be a cost.</p>
<p>Some cost is OK by me, in exchange for convenience. So I did some tests:</p>
<p>The test methodology was to ping flood the Fonera from a PC:</p>
<div id="attachment_160" class="wp-caption alignnone" style="width: 550px"><a href="http://projectgus.com/wp-content/uploads/2010/03/ebtables_arpnat_performance.png"><img src="http://projectgus.com/wp-content/uploads/2010/03/ebtables_arpnat_performance.png" alt="" title="ebtables_arpnat_performance" width="540" height="320" class="size-full wp-image-160" /></a><p class="wp-caption-text">Performance of ebtables &#038; ARPNAT (longer is better)</p></div>
<ul>
<li>&#8220;Ethernet, no ebtables&#8221; is a vanilla Openwrt 8.09.2 install</li>
<li>&#8220;Ethernet, ebtables installed&#8221; is with patches and ebtables installed, but no ARPNAT enabled.</li>
<li>&#8220;Ethernet, ARPNAT enabled&#8221; is with ARPNAT turned on, but no traversal (the pings still go just to the router.)</li>
<li>&#8220;Direct WiFi&#8221; is pinging the router directly over the wireless network. It&#8217;s slower, but only because WiFi is slower than ethernet.</li>
<li>&#8220;WiFi via ARPNAT&#8221; is pinging a client on the wireless side, from a client on the wired side. So the ping is going through ARPNAT translation on the router.</li>
</ul>
<p>Under all of these tests the CPU on the router was pegged at >95%.</p>
<p>The results seem to show that ebtables &#038; ARPNAT <b>do not</b> drastically affect the performance of the Fonera. Turning on ARPNAT causes direct traffic to the router to be about 17% more costly. Actually bridging packets through ARPNET on the router is only 32% more costly than directly accessing the router itself.</p>
<p>I&#8217;m surprised these figures aren&#8217;t worse, given the doom &amp; gloom spouted by the OpenWRT devs. It&#8217;s possible there&#8217;s another circumstance under which ARPNAT falls over, or possibly it performs worse on certain architectures. I&#8217;ll post back if I learn anything interesting.</p>
<p>EDIT: One more discovery, obvious in retrospect, is that IPv6 won&#8217;t get ARPNATted by this config. If you have any devices that use IPv6 (like iTunes talking to an Apple Airport Express), you&#8217;ll either need to disable IPv6 or tweak the ebtables scripts somehow to translate IPv6 as well. I opted for disabling IPv6.</p>
]]></content:encoded>
			<wfw:commentRss>http://projectgus.com/2010/03/wireless-client-bridging-with-openwrt/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
