<?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>Tinyhack.com</title>
	<atom:link href="http://tinyhack.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tinyhack.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Tue, 22 Jan 2013 05:03:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Adding Bluetooth Serial Port to Asus RT-N16</title>
		<link>http://tinyhack.com/2013/01/22/adding-bluetooth-serial-port-to-asus-rt-n16/</link>
		<comments>http://tinyhack.com/2013/01/22/adding-bluetooth-serial-port-to-asus-rt-n16/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 05:03:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=194</guid>
		<description><![CDATA[I am running DebWrt on my Asus RT-N16 and it works well. The only problem that I have is: in case I misconfigure something and the device is inaccessible via network, I need to open the case then connect a &#8230; <a href="http://tinyhack.com/2013/01/22/adding-bluetooth-serial-port-to-asus-rt-n16/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I am running <a href="http://www.debwrt.net/">DebWrt</a> on my Asus RT-N16 and it works well. The only problem that I have is: in case I misconfigure something and the device is inaccessible via network, I need to open the case then connect a serial port to fix it. Because the configuration is in USB, I don&#8217;t have to open the case  very of, in most cases, I can unplug the USB disk, mount it in my Linux machine, try to fix the configuration,  plug the USB again, restart the router, and hope that my fix works.  Either way, both is such a hassle.</p>
<p>I could have added a serial port just like <a href="http://tinyhack.com/2010/04/04/d-link-dir-300-serial-port-and-sd-mod/">my DIR-300 mod</a>, but I think it&#8217;s the bestsolution. Because I still need to bring down my router, find my serial cable, plug it in and connect to it. I wish that the device has a bluetooth capability, so I can connect to it (via bluetooth serial port profile), fix any problem that it has, and I don&#8217;t need to move or plug anything, and hopefully I don&#8217;t even need to restart the router and wait for it to boot.</p>
<p>So I bought a 7.32 USD <a href="http://www.aliexpress.com/item/HC-07-Wireless-Serial-4-Pin-Bluetooth-RF-Transceiver-Module-RS232-TTL-New-for-Arduino-Free/626088521.html">bluetooth module from Aliexpress</a> and installed it on my RT-N16. Some of you may think that it is a bad idea, because bluetooth interferes (somewhat) with WIFI, but I don&#8217;t plan to keep constant connection via bluetooth, and when I do make the connection, the data that I am transferring is very small (may be just several kilobytes per minutes). So far in my testing, when connected via bluetooth, I didn&#8217;t notice any speed difference in WIFI transfer speed (even when transferring large files via WIFI) and typing furiously from my bluetooth terminal. Asus RTN16 only supports 2.4 GHz, but If your router supports 5GHz, I think you should use that band to eliminate any possible interference.</p>
<p>Asus RT-N16 has a serial header ready to be connected (it even has labels on it, GND, RX, TX, VCC):</p>
<p><a href="http://www.flickr.com/photos/yohanes/8400651780/" title="IMG_4476 by Yohanes &amp; Risna, on Flickr"><img src="http://farm9.staticflickr.com/8508/8400651780_114e23a101.jpg" width="500" height="333" alt="IMG_4476"></a></p>
<p>But before plugging in the module, I need to set the speed of the bluetooth serial module to 115200, because the default speed is 9600. To setup the bluetooth serial module, we need to connect it to a computer via serial port (I am using Bus Pirate for this). </p>
<p>My version of Bluetooth module is H-C07, and for this version, the device doesn&#8217;t use \r or \n to terminate command, it just use time (a complete commands must be received within few hundreds millisecond). Typing very-very quickly in your terminal wont work, so just copy and paste the command from your text editor. The command needed to set the bluetooth module to 115200 is &#8220;AT+BAUD8&#8243;. These bluetooth modules usually doesn&#8217;t come with documentation, so you need to look on the internet for your specific version.</p>
<p><a href="http://www.flickr.com/photos/yohanes/8003448918/" title="Bluetooth by Yohanes &amp; Risna, on Flickr"><img src="http://farm9.staticflickr.com/8310/8003448918_3b8801474a.jpg" width="500" height="333" alt="Bluetooth"></a></p>
<p>One of the nice thing about bluetooth is: it is accessible from non pc devices. After connecting the cables, I can connect to my router using <a href="https://play.google.com/store/apps/details?id=mobi.dzs.android.BluetoothSPP">Android Bluetooth SPP</a></p>
<p><a href="http://www.flickr.com/photos/yohanes/8399569553/" title="Using Bluetooth SPP as console on Android by Yohanes &amp; Risna, on Flickr"><img src="http://farm9.staticflickr.com/8098/8399569553_c1bb147912.jpg" width="500" height="333" alt="Using Bluetooth SPP as console on Android"></a></p>
<p>One thing to note: the bluetooth module needs time to initialize, so it is not useful for accessing the boot loader. To restart the router, I need to plug and unplug the power cable. So the bluetooth module will lose its connection when I restart the device. By the time the bluetooth module is ready, the boot loader has already passed and you will be in the middle of Linux booting. </p>
<p>If you really want to use the bluetooth module to access the boot loader, you will either need separate power source for the bluetooth module, or make a special reset button for the router (that doesn&#8217;t involve unplugging and plugging the device, and doesn&#8217;t cut power to the bluetooth module).</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2013/01/22/adding-bluetooth-serial-port-to-asus-rt-n16/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>LocalBar: Install signed BAR files directly from PlayBook</title>
		<link>http://tinyhack.com/2011/11/05/localbar-install-signed-bar-files-directly-from-playbook/</link>
		<comments>http://tinyhack.com/2011/11/05/localbar-install-signed-bar-files-directly-from-playbook/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 10:09:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=191</guid>
		<description><![CDATA[I&#8217;ve reverse engineered the protocol used by blackberry-deploy to install apps file (BAR file) into the playbook. Then I made an app to Install signed BAR files directly from the playbook itself. You can find my work here: http://yohan.es/playbook/localbar/ I &#8230; <a href="http://tinyhack.com/2011/11/05/localbar-install-signed-bar-files-directly-from-playbook/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve reverse engineered the protocol used by blackberry-deploy to install apps file (BAR file) into the playbook. Then I made an app to Install signed BAR files directly from the playbook itself. You can find my work here:</p>
<p><a href="http://yohan.es/playbook/localbar/">http://yohan.es/playbook/localbar/</a></p>
<ul>
<li>I am using https://localhost method. To put it simply: it works like other desktop installers that connect via network or USB, it sends commands to an HTTP service in the playbook. The only difference is that it works through the playbook itself.</li>
<li>It is possible that in the future RIM may block requests from localhost</li>
<li>I don&#8217;t have time to develop nice GUI for this, so I just use the basic GUI API that is accessible using NDK. For example: in the NDK there is a &#8220;login dialog&#8221; but no &#8220;password dialog&#8221;, so for the password dialog I use the &#8220;login dialog&#8221; that shows the &#8220;user&#8221; field (which I don&#8217;t need).</li>
<li>This works on OS 1.0.7 and on 2.0 (developer beta)</li>
<li>With this you can sort of OTA install through the playbook. From your PlayBook Just go to a website that has some bar files (for example this forum) , download it using the built in playbook browser, then run LocalBar to install the downloaded bar files.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2011/11/05/localbar-install-signed-bar-files-directly-from-playbook/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>EZ430-Chronos OTP</title>
		<link>http://tinyhack.com/2011/03/02/ez430-chronos-otp/</link>
		<comments>http://tinyhack.com/2011/03/02/ez430-chronos-otp/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 17:29:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=185</guid>
		<description><![CDATA[After wanting the EZ430 Chronos watch for a long time, I finally ordered one on Febuary 20th from TI eStore, and I got the watch on February 24th (Tax Free). So this is another stuff in my long list of &#8230; <a href="http://tinyhack.com/2011/03/02/ez430-chronos-otp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After wanting the <a href="http://processors.wiki.ti.com/index.php/EZ430-Chronos">EZ430 Chronos watch</a> for a long time, I finally ordered one on Febuary 20th from TI eStore, and I got the watch on February 24th (Tax Free). So this is another stuff in my long list of &#8220;things to hack&#8221;.</p>
<p>I had a good idea to use my Ez430 Chronos as OTP generator for Google 2 factor authentication. Before my long weekend, I did my research on Thursday (24 February) and that time no one had implemented it. So I wrote a small modification to <a href="http://github.com/poelzi/OpenChronos/">OpenChronos</a>, and just before I finished my implementation on Sunday (I was quite busy during the long weekend helping to move our company&#8217;s office), I looked at <a href="http://processors.wiki.ti.com/index.php/EZ430-Chronos">Chronos Wiki</a> again to find some links to the chronos documentation, and found out that  <a href="http://tnhh.net/pancake/chronos-otp.xml">Huan Truong has just implemented his version of OTP</a> by modifying OpenChronos.</p>
<p><img src="http://1.bp.blogspot.com/-FXbRgwkcP1U/TWcEytoBZjI/AAAAAAAACEs/Tdbx5RYBQ7s/s320/%253D%253Futf-8%253FB%253FSmFtIGd3IHNhbXBlLiBHYSBrZW5hIHBhamVrLi5qcGc%253D%253F%253D-765512" /></p>
<p>After learning that in his version the clock function doesn&#8217;t work yet (in his readme it says &#8220;THIS FIRMWARE CURRENTLY HAS A YET-TO-IMPLEMENT CLOCK FUNCTIONALITY, SO IT WONT DISPLAY TIME PROPERLY&#8221;), I decided to continue my implementation. My implementation doesn&#8217;t change the time logic so you can still use the stock Control Center provided by TI  (Huan Troung changed the OpenChronos code to use epoch implementation, and he modified the control center) . Instead of replacing all algorithms to use timestamp, I use a simple mktime implementation to convert existing year/month/date data to unix timestamp.</p>
<p>After flashing the image to the watch, a new menu is added to the second line after &#8220;rFbSL&#8221;, it will show a heart icon  and first 2 digits of the OTP (I will never buy a heart monitor for this watch so I use that icon just to show that I am in OTP mode). Pressing the &#8220;#&#8221; key for a few seconds will show the remaining 4 digits. Just for your information, enabling CONFIG_OTP adds  2914 bytes to the code size.</p>
<p>So here is my version of Google OTP <strike> (If many people are interested, I can put it in github):</p>
<p>http://tinyhack.com/files/OpenChronos-joe-otp.zip</p>
<p>I am too lazy to implement the &#8220;make config&#8217;, just edit otp.h with your key, and fill in the timezone offset (+N from UTC). You can get the key from base32 encoded string using codegen script that I made, for example:</p>
<p>bash$ python codegen.py pf xwqy lomvz wu 33f<br />
\x79\x6f\x68\x61\x6e\x65\x73\x6a\x6f\x65<br />
</strike></p>
<p><a href="https://github.com/yohanes/OpenChronos">https://github.com/yohanes/OpenChronos</a></p>
<p>You can use <code>make config</code> to set your secret key in base32 (that means you can just copy paste from the auth code presented by Google), and you can set the timezone offset.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2011/03/02/ez430-chronos-otp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New Adventures</title>
		<link>http://tinyhack.com/2011/02/14/new-adventures/</link>
		<comments>http://tinyhack.com/2011/02/14/new-adventures/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 05:52:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[freebsd]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=182</guid>
		<description><![CDATA[My last post was about 6 months ago. Now I am back with some new adventures. The first one is Jonathan, my first baby: And the next one is BeagleBoard-xM from John Nicholls. About a month ago I found a &#8230; <a href="http://tinyhack.com/2011/02/14/new-adventures/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My last post was about 6 months ago. Now I am back with some new adventures. The first one is Jonathan, my first baby:</p>
<p><a href="http://www.flickr.com/photos/yohanes/5444012596/" title="Jonathan by Yohanes &amp; Risna, on Flickr"><img src="http://farm6.static.flickr.com/5094/5444012596_9fd24f4476.jpg" width="333" height="500" alt="Jonathan" /></a></p>
<p>And the next one is BeagleBoard-xM from John Nicholls.</p>
<p><a href="http://www.flickr.com/photos/yohanes/5443852594/" title="BeagleBoard-xM by Yohanes &amp; Risna, on Flickr"><img src="http://farm6.static.flickr.com/5055/5443852594_73979ef90d.jpg" width="500" height="333" alt="BeagleBoard-xM" /></a></p>
<p>About a month ago I found a promotion and got this free MSP430 USB development tool:</p>
<p><a href="http://www.flickr.com/photos/yohanes/5404453918/" title="eZ430-F2013 by Yohanes &amp; Risna, on Flickr"><img src="http://farm6.static.flickr.com/5257/5404453918_18100098c3.jpg" width="500" height="333" alt="eZ430-F2013" /></a></p>
<p>It got me interested in MSP430 in general and bought some <a href="http://www.ti.com/launchpadwiki">LaunchPad</a> (only 4.30 usd each). My first project is to control the plug so i can plug and unplug BeagleBoard-xM through PC (so I can control it remotely via SSH). With this, I should be able to work on BeagleBoard remotely (like when I am in my room holding my baby boy).</p>
<p><a href="http://www.flickr.com/photos/yohanes/5444066752/" title="LaunchPad MSP430 by Yohanes &amp; Risna, on Flickr"><img src="http://farm6.static.flickr.com/5097/5444066752_12f51b4c40.jpg" width="500" height="333" alt="LaunchPad MSP430" /></a></p>
<p>And I have updated the CNS21XX code in my <a href="http://gitorious.org/freebsd-arm">gitorious repo</a> with the latest head. Hopefully I can put the code to SVN HEAD in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2011/02/14/new-adventures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CNS21XX port completed</title>
		<link>http://tinyhack.com/2010/07/06/cns21xx-port-completed/</link>
		<comments>http://tinyhack.com/2010/07/06/cns21xx-port-completed/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 15:01:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[freebsd]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=172</guid>
		<description><![CDATA[About six months ago, Stefan Bethke donated me some money to buy a device from dealextreme so I can port FreeBSD to that device (you can see the pictures here). This device uses ARM Cavium Econa CNS21XX (formerly known as &#8230; <a href="http://tinyhack.com/2010/07/06/cns21xx-port-completed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/yohanes/4274406568/in/set-72157623208918338/"><img src="http://farm5.static.flickr.com/4054/4274406568_d1870fd1f2.jpg" width="500" height="333"></a><br />
About six months ago, Stefan Bethke donated me some money to buy <a href="http://dealextreme.com/details.dx/sku.20383~r.70455276">a device from dealextreme</a> so I can port FreeBSD to that device (you can see the pictures <a href="http://www.flickr.com/photos/yohanes/sets/72157623208918338/">here</a>). This device uses ARM Cavium Econa CNS21XX (formerly known as STR8132). Within few days I have completed the driver for serial port, interrupt controller, EHCI/OHCI. Then I stopped working on it, three months later I continued and finished the network driver, then I stopped again.</p>
<p>The last part that wasn&#8217;t finished was the SPI controller and the SPI flash driver, so this weekend I spent some time to finish it. So now, I can say that the port is finished, all drivers have been written for the device. With SPI flash support, I can now write the kernel to the device, and boot it from there (I don&#8217;t need to boot from network anymore).</p>
<p>Actually I am not really finished yet, since I still need to reformat the code according to the FreeBSD standard, and there might still be bugs in my code, so I invite everyone that have this device to try it out. There is also a feature in the network driver that is not implemented yet (multicast filtering), because the datasheet is not very clear (<del datetime="2010-07-06T15:02:02+00:00">i would be very happy if someone could help me to complete this</del>, wait now i suddenly understands the documentation).</p>
<p>For the boot loader, I am still using the default boot loader. This boot loader will load the kernel from memory 0&#215;600000, and since I can&#8217;t change the boot loader configuration in this particular device, I modified the kernel configuration to match this. The latest code can be accessed at <a href="http://gitorious.org/freebsd-arm">http://gitorious.org/freebsd-arm</a>.</p>
<p>To do initial boot, you will need serial port. You will need to put your kernel on your tftp server. Hit any key during boot, and type:</p>
<pre>
setenv serverip 172.17.1.1
setenv ipaddr 172.17.1.2
tftpboot 0x600000 kernel.bin
go 0x600000
</pre>
<p>and to make it permanent:</p>
<p><code>dd if=kernel.gz.tramp.bin of=/dev/flash/spi0  obs=4k conv=osync seek=96</code></p>
<p>Please note that the blocksize is 4k, and 96 means the offset is 0&#215;60000 (96*4096) which will be mapped to 0&#215;600000 by the boot loader. If you are brave, you can just compile the image and dd using the default Linux, but I don&#8217;t recommend this, since you may have different hardware (espcially SPI flash chip).</p>
<p><a href="http://www.flickr.com/photos/yohanes/4274404960/in/set-72157623208918338/"><img src="http://farm5.static.flickr.com/4061/4274404960_5ea0ebeab5.jpg" width="500" height="333"></a></p>
<p>Another news: I have completed the driver for ThinLinx Hot-e NAND using NAND2 framework. I also completed the SPI part and support for the flash SPI (read only).</p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2010/07/06/cns21xx-port-completed/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>D-LINK DIR-300 Serial Port and SD mod</title>
		<link>http://tinyhack.com/2010/04/04/d-link-dir-300-serial-port-and-sd-mod/</link>
		<comments>http://tinyhack.com/2010/04/04/d-link-dir-300-serial-port-and-sd-mod/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 13:45:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=162</guid>
		<description><![CDATA[The latest progress of my freeBSD port for CNS21XX and ThinkLink Hot-e was three weeks ago. The CNS21XX network driver and Hot-e network driver was completed. I haven&#8217;t touched anything since then because I had to work on weekends at &#8230; <a href="http://tinyhack.com/2010/04/04/d-link-dir-300-serial-port-and-sd-mod/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The latest progress of my freeBSD port for CNS21XX and ThinkLink Hot-e was three weeks ago. The CNS21XX network driver and Hot-e network driver was completed. I haven&#8217;t touched anything since then because I had to work on weekends at the office. This weekend, I could have continued coding, but I don&#8217;t feel like coding, so I did a hardware project: adding serial port and SD card slot to my D-LINK DIR-300 that I <a href="http://tinyhack.com/2009/04/05/too-many-things-to-do/">bought April last year</a>.</p>
<p>This is not a difficult project, I already added SD/MMC card to my WRT54GL about 2,5 years ago. The difference is that there isn&#8217;t much guide about the hardware part (which GPIO pins to solder), and the software part (how to activate the drivers). So here is a short guide to anyone who needs it. Note that I already installed OpenWRT Kamikaze using the guide from: <a href="http://oldwiki.openwrt.org/OpenWrtDocs(2f)Hardware(2f)D(2d)Link(2f)DIR(2d)300.html">OpenWRT site</a>.<br />
<span id="more-162"></span><br />
This is what the front side of PCB looks like:</p>
<p><a href="http://www.flickr.com/photos/yohanes/4488923533/" title="DLINK DIR-300 PCB FRONT by Yohanes &amp; Risna, on Flickr"><img src="http://farm3.static.flickr.com/2766/4488923533_3351855dae.jpg" width="500" height="405" alt="DLINK DIR-300 PCB FRONT" /></a></p>
<p>On the bottom right, you can connect a serial port (note: 3.3V, you will need MAX3232 or use a data cable from phone, don&#8217;t connect directly). Many guides are already available for connecting serial port (for example: <a href="http://nuwiki.openwrt.org/oldwiki/OpenWrtDocs/Customizing/Hardware/Serial_Console">here</a>, <a href="http://blog.brixandersen.dk/?p=62">here</a>, <a href="http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort">here</a>, and <a href="https://forum.openwrt.org/viewtopic.php?pid=7240">here</a>), so I wont write about it. Just note that you will use the 3.3V and GND for the SD card mod.</p>
<p><a href="http://www.flickr.com/photos/yohanes/4488923529/" title="DLINK DIR-300 SERIAL by Yohanes &amp; Risna, on Flickr"><img src="http://farm5.static.flickr.com/4010/4488923529_d257a72c8c_m.jpg" width="203" height="240" alt="DLINK DIR-300 SERIAL" /></a></p>
<p>This is what the PCB looks like from the back:</p>
<p><a href="http://www.flickr.com/photos/yohanes/4488923531/" title="DLINK DIR-300 PCB BACK by Yohanes &amp; Risna, on Flickr"><img src="http://farm3.static.flickr.com/2701/4488923531_82f792226b.jpg" width="500" height="350" alt="DLINK DIR-300 PCB BACK" /></a></p>
<p>I found the GPIO pins from this <a href="http://www.dd-wrt.com/phpBB2/viewtopic.php?p=269511">posting</a>  by guidoa:</p>
<blockquote><p><code><br />
1: SES Button Blue led (Enable=ON)<br />
2: WiFi led<br />
3: SES Button Red led (Enable=ON)<br />
4: SES Button (Pressed=01)<br />
6: Reset Button (Pressed=01)<br />
7: Status led (Enable=ON) </code>
</p></blockquote>
<p>I have confirmed it using voltmeter and <code>gpioctl</code> command line tool. The SES button is the button on the right side of the unit. As far as I know, SES button, and the LEDS (red and blue) are not used by default, the Wifi LED is used to indicate Wifi ON/OFF. So we can use GPIO 1,3,4. We need another one: we can use GPIO 6 or 7. Since The status led is not used, I prefer GPIO 7. You can see the location of the GPIO pins that I used from the above picture.</p>
<p>Now, look at the SD Card Pinout (you can search it in Google, or just look <a href="http://www.jbprojects.net/articles/wrt54gl_mods/">here</a>).<br />
You  need to connect SD Pin 4 to to 3.3V (see the serial port above), Pin 3 and 6 to GND. The rest is up to you (we will configure this later in software). This is what I use:</p>
<ul>
<li>Pin 2 (Data In/MOSI) to GPIO 4 (SES Button)</li>
<li>Pin 7 (Data Out/MISO) to GPIO 7 (Status LED)</li>
<li>Pin 5 in SD Card (CLK) to GPIO 1 (blue LED)</li>
<li>Pin 1 in SD Card (Chip Select) to GPIO 3 (red LED)</li>
</ul>
<p>After you solder them, you need to install these packages using opkg: kmod-mmc, kmod-mmc-over-gpio, kmod-mmc-spi, kmod-spi-bitbang, and kmod-spi-gpio. We need to edit /etc/init.d/mmc_over_gpio. The line that you are looking for is the <code>add_device "default"</code>. There are some numbers in the following order DI, DO, CLK, CS and SPI_MODE. You need to fill in the GPIO that you use for each of that pins and just fill in 0 for SPI_MODE. In my case I edit the line to become:  <code>add_device "default" 4 7 1 3 0</code>.</p>
<p>Now I can start the SD card using: <code>/etc/init.d/mmc_over_gpio start</code>. You can now mount the card. To remove the card, umount the card and  <code>/etc/init.d/mmc_over_gpio stop</code>. The SD card speed is to slow, I will look on to this later, but for now the speed is enough for me.</p>
<p>This is my final result (I am really lousy at soldering):</p>
<p><a href="http://www.flickr.com/photos/yohanes/4489691820/" title="D-LINK DIR-300 by Yohanes &amp; Risna, on Flickr"><img src="http://farm3.static.flickr.com/2700/4489691820_995f1d43cb.jpg" width="500" height="333" alt="D-LINK DIR-300" /></a></p>
<p>Doesn&#8217;t look too bad from the outside for the SD Card:</p>
<p><a href="http://www.flickr.com/photos/yohanes/4489618324/" title="DLINK DIR-300 SD CARD by Yohanes &amp; Risna, on Flickr"><img src="http://farm5.static.flickr.com/4049/4489618324_c8654d398e.jpg" width="500" height="333" alt="DLINK DIR-300 SD CARD" /></a></p>
<p>But I made a stupid mistake for the RS232 port. I put the port on the wrong place, and I can not drill for the screw on the right side of the port. Fortunately this is not fatal, I just glued the port to the casing.</p>
<p><a href="http://www.flickr.com/photos/yohanes/4489618318/" title="DLINK DIR-300 Serial Port by Yohanes &amp; Risna, on Flickr"><img src="http://farm3.static.flickr.com/2768/4489618318_1121771697.jpg" width="500" height="333" alt="DLINK DIR-300 Serial Port" /></a></p>
<p><b>Update</b> This is the dmesg log after <code>/etc/init.d/mmc_over_gpio start</code></p>
<pre>
gpio-mmc: Failed to request mmc_spi module.
mmc_spi spi32765.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
gpio-mmc: MMC-Card "default" attached to GPIO pins di=4, do=7, clk=1, cs=3
mmc_spi spi32765.0: can't change chip-select polarity
mmc0: new SD card on SPI
mmcblk0: mmc0:0000 SD512 495488KiB
 mmcblk0: p1
</pre>
<p><b>Update 9 April 2010</b> to make it clear, this is the picture of the back side of the pcb after soldering:</p>
<p><a href="http://www.flickr.com/photos/yohanes/4505357944/" title="back side of DLink DIR-300 by Yohanes &amp; Risna, on Flickr"><img src="http://farm3.static.flickr.com/2713/4505357944_ee06179198.jpg" width="500" height="333" alt="back side of DLink DIR-300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2010/04/04/d-link-dir-300-serial-port-and-sd-mod/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>ThinLinx Hot-e and CNS21XX</title>
		<link>http://tinyhack.com/2010/01/20/thinlinx-hot-e-and-cns21xx/</link>
		<comments>http://tinyhack.com/2010/01/20/thinlinx-hot-e-and-cns21xx/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 15:41:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[freebsd]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=159</guid>
		<description><![CDATA[I am still fixing the Cavium Econa CNS11XX network driver with the guide from Pyun YongHyeon. He is guiding to make the network driver more robust. Unfortunately, we still don&#8217;t know why the driver is slower than the Linux version. &#8230; <a href="http://tinyhack.com/2010/01/20/thinlinx-hot-e-and-cns21xx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I am still fixing the Cavium Econa CNS11XX network driver with the guide from Pyun YongHyeon. He is guiding to make the network driver more robust. Unfortunately, we still don&#8217;t know why the driver is slower than the Linux version. The port is currently accessible through FreeBSD CVS at:</p>
<p> <a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/arm/econa/">http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/arm/econa/</a></p>
<p>I asked in the freebsd-arm mailing list if anyone would like to donate me a CNS21XX device, and Stefan Bethke immediately offered me to buy one for me. I bought the <a href="http://dealextreme.com/details.dx/sku.20383~r.70455276">device from dealextreme</a> with the money donated to me. It took 9 days until it arrived.</p>
<p>Meanwhile John Nicolls from <a href="http://www.thinlinx.com/">ThinkLinx</a> sent me a Hot-e, a device based on AT91SAM9G20. I told him that I have received mr Stefan offer, but he said I can work on it anytime I want it. Since the Hot-e arrived earlier, I have managed to get it to boot. At first i was going to use the work from Sylvestre Gallon on at91sam9621(<a href="http://lists.freebsd.org/pipermail/freebsd-arm/2009-May/001741.html">mailing list archive</a>), but it turns out that it is not usable yet.</p>
<p>I have fixed the clock computation in at91_pmc.c, and currently writing a new timer driver (at91_pit.c), because the system timer device (at91_st.c) no longer exists in AT91SAM9G20. Currently the timer device is still not working properly, but I think I will be able to get it work this week.</p>
<p>When the CNS211XX LAN device finally arrived, I stopped the work for Hot-e for a while to test the new device. I bought a CA-42 cable to connect to it, but I can&#8217;t send anything to the device.  I thought that the device was faulty, but turns out that the cable is faulty. I was disappointed because usually I used that type of cable (it is cheap only 132 baht or 4 usd). Fortunately I still have one MAX3232, and I can make my own cable.</p>
<p>I think porting CNS21XX will not be so difficult. I made some small adjustment for the serial port driver to make it show something. Memory mapping is different compared to CNS11XX, but that can easily be adjusted. The Interrupt controller is different, so I need to rewrite some parts. After it works, EHCI/OHCI was working fine. The network driver will need major adjustment (may be I will just write a new driver for this one), and the device doesn&#8217;t use CFI for Flash, it uses SPI, so I will need to write a driver for SPI bus.</p>
<p>For CNS11XX and CNS21XX You can see my progress in this wiki page:<br />
 <a href="http://wiki.freebsd.org/FreeBSDcns11xx">http://wiki.freebsd.org/FreeBSDcns11xx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2010/01/20/thinlinx-hot-e-and-cns21xx/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>CNS11XX FreeBSD port completed</title>
		<link>http://tinyhack.com/2009/12/11/cns11xx-freebsd-port-completed/</link>
		<comments>http://tinyhack.com/2009/12/11/cns11xx-freebsd-port-completed/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 08:33:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[agestar]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=149</guid>
		<description><![CDATA[It has been a long time since I started this project, and even though I am making a good progress at the beginning, my progress was getting slower lately. Today I decided to take a day off from work to &#8230; <a href="http://tinyhack.com/2009/12/11/cns11xx-freebsd-port-completed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It has been a long time since I started this project, and even though I am making a good progress at the beginning, my progress was getting slower lately. Today I decided to take a day off from work to finish some remaining task: network driver, automatic memory detection, and flash device support.</p>
<p>Pyun YongHyeon have helped me a lot with the network driver. The speed is still not good, but he have helped to make the network driver to more correct (better, more reliable). I will still need to ask him to check for the final version, but I believe I have fixed most errors he pointed out.</p>
<p>My agestar, which also uses CNS11XX devices comes with 32Mb memory, while the Emprex NSD-100 have 64mb of memory. I have added a code to autodetect the memory size. So one binary file should work on both devices.</p>
<p>The flash device in Emprex NSD-100 complies with CFI, and it was very easy to use with the existing CFI driver. I just need to write several lines of code. The next step is to boot freebsd directly from the flash (with the root filesystem on USB). Unlike in Linux, the flash device can not be accessed as partitions (not yet).</p>
<p>First, we need to write the kernel.bin to cfi0, because the first 132 kb is used by boot loader, we need to skip to somewhere > 132kb. To make it easy, i just skip 1 megabyte from beginning of flash.</p>
<p>dd if=kernel.bin seek=1 bs=1m of=/dev/cfi0</p>
<p>be very very very careful with the dd command. Without correct seek and bs, you may overwrite the bootloader. The command  will take quite a long time to finish (3 minutes).</p>
<p>Next step is to set the initial boot command. In the boot loader, setup bootcmd to copy the data in ram to 0&#215;1000000 from 0&#215;10100000, then boot the device:</p>
<p>setenv bootcmd cp.l 0&#215;10100000 0&#215;1000000 0x1a0000\;go 0&#215;1000000<br />
saveenv</p>
<p>Now when we boot the device, we should go directly to freebsd.</p>
<p>I won&#8217;t provide binaries, but the latest source code is in:</p>
<p><a href="http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/str91xx/src/sys/arm/econa&#038;HIDEDEL=NO">http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/str91xx/src/sys/arm/econa&#038;HIDEDEL=NO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2009/12/11/cns11xx-freebsd-port-completed/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CNX11XX/STR91XX FreeBSD Progress</title>
		<link>http://tinyhack.com/2009/09/28/cnx11xxstr91xx-freebsd-progress/</link>
		<comments>http://tinyhack.com/2009/09/28/cnx11xxstr91xx-freebsd-progress/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 15:56:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[agestar]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=145</guid>
		<description><![CDATA[Last weekend I continued my work on FreeBSD port. I am concentrating on the network speed improvement, and I made a good progress with it. The network speed is now about 2.1 Mbps (FTP upload from device), this is still &#8230; <a href="http://tinyhack.com/2009/09/28/cnx11xxstr91xx-freebsd-progress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Last weekend I continued my work on FreeBSD port. I am concentrating on the network speed improvement, and I made a good progress with it. The network speed is now about 2.1 Mbps (FTP upload from device), this is still slower than the Linux version but i think it already reach a usable state (I think I should be able to stream some DivX files through HTTP from it). I will ask around in the freebsd-arm/freebsd-net mailing list so I can do more improvement on the driver.</p>
<p>I am still a bit worried playing around with the Flash, since I don&#8217;t have anything to restore it back in case I made a mistake. So I think I will leave this part for a while.</p>
<p>For everyone who have NSD-100 with Serial Port attached to it, you can try a precompiled binary thah I have prepared, or you can compile from source.  To use the binary version, you will need a USB disk (at least 2GB in size), and a TFTP server. Actually you only need about 256 megabyte if you prepare your own disk instead of using my image.</p>
<p>Here are the steps for the binary version:</p>
<ol>
<li>Download the disk image from <a href="http://tinyhack.com/files/disk-2gb-freebsd-armv4-26-september-2009.img.bz2">here</a></li>
<li>Decompress (bunzip) the disk image, use dd to write to your USB disk</li>
<li>Since there is no boot menu, entering single or multi user mode is done by booting different kernel. Download the <a href="http://tinyhack.com/files/kernel-cns11xx-multi-freebsd-28-sept-2009.bin">multi user kernel</a> or <a href="http://tinyhack.com/files/kernel-cns11xx-single-freebsd-28-sept-2009.bin">single user kernel</a> and put it in your tftpserver</li>
<li>Boot the kernel </li>
</ol>
<p>To boot the kernel, you need to access your device using serial port. I think You need to hold the reset button to enter the boot prompt (mine always goes to the boot prompt because Bruce did something with the configuration area). You should see
<pre>STR9100></pre>
<p> prompt.</p>
<pre>
setenv serverip 192.168.1.1
(you can also 'saveenv' to save the TFTP server address permanently)
tftpboot 0x1000000 name-of-kernel.bin
go 0x1000000
</pre>
<p>To build your own disk image, make an empty disk.img with the size that you want. Goto /usr/src and then (modified from instruction to make i386 image <a href="http://bsdimp.blogspot.com/2007/10/building-bootable-freebsdi386-images.html">by Warner Losh</a>)</p>
<pre>
export TARGET_ARCH=arm
make buildworld
mdconfig -a -t vnode -f disk.img
fdisk -I md0
fdisk -B md0
bsdlabel -w md0s1 auto
bsdlabel -B md0s1
newfs /dev/md0s1a
mount /dev/md0s1a /mnt/
make installworld DESTDIR=/mnt
make distrib-dirs DESTDIR=/mnt
make distribution DESTDIR=/mnt
echo /dev/da0s1a / ufs rw 1 1 > /mnt/etc/fstab
echo ifconfig_DEFAULT=DHCP > /mnt/etc/rc.conf
echo hostname=demo >> /mnt/etc/rc.conf
</pre>
<p>To compare your boot experience <a href="http://tinyhack.com/files/freebsd-cns11xx-log-multi-28-sept-2009.txt">here is is the bootlog for the multi user mode</a>, and <a href="http://tinyhack.com/files/freebsd-cns11xx-log-single-28-sept-2009.txt">the single user mode</a>.</p>
<p>For the latest kernel source, you can see the perforce depot at:</p>
<p><a href="http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/str91xx&#038;HIDEDEL=NO">http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/str91xx&#038;HIDEDEL=NO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2009/09/28/cnx11xxstr91xx-freebsd-progress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SmartQ7</title>
		<link>http://tinyhack.com/2009/08/16/smartq7/</link>
		<comments>http://tinyhack.com/2009/08/16/smartq7/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 15:27:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://tinyhack.com/?p=137</guid>
		<description><![CDATA[I just got my SmartQ 7 few days ago. In this post I want to share some technical thing (not a full review, you can find it somewhere else). Before giving my opinion about this device, I want to give &#8230; <a href="http://tinyhack.com/2009/08/16/smartq7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I just got my SmartQ 7 few days ago. In this post I want to share some technical thing (not a full review, you can find it somewhere else). Before giving my opinion about this device, I want to give quick update: I haven&#8217;t done much progress on the STR9104 FreeBSD port except to keep it up to date with FreeBSD Current. I am planning to start to work on it again this week. Andrew Certain have added joystick support for AppleWii. See the <a href="http://code.google.com/p/wiiapple">Google Code</a> for latest version.</p>
<p>I bought this device from <a href="http://www.dealextreme.com/details.dx/sku.27441~r.70455276">DealExtreme for 206.1 USD </a>, this is the first expensive thing that I bought from <a href="http://www.dealextreme.com/default.dx/r.70455276">DealExtreme</a> (I only bought small things from then, usually my total is less than 20 USD). The thing shipped in about 10 days, but I need to get the thing from the post office, because I need to pay extra tax 350 baht (~11 USD).<br />
<span id="more-137"></span></p>
<p>SmartQ 7 is a 7&#8243; MID (mobile internet device) running ubuntu. It has ARM processor (the SoC is Samsung S3C6410), the RAM is 128 Mb, with 1GB internal flash storage. There are 2 USB ports, one for USB Host, and the other for USB OTG. It doesn&#8217;t have an internal bluetooth, buat a bluetooth dongle is given, it looks like <a href="http://www.dealextreme.com/details.dx/sku.13701~r.70455276">this thing in DealExtreme</a>. It has 4500mAh battery. The screen resolution is 800&#215;600.</p>
<p>My short opinion is: this thing is great, but needs better software. There is no accelerated driver for Xorg (X uses fbdev, an unaccelerated framebuffer driver). By default it allocates 128Mb swap space in the internal flash. I am a little bit worried about this (the flash have limited write cycle), and I move the swap to external SD Card. Because the memory is only 128Mb, it swaps a lot.</p>
<p>This SoC has a 3D graphics support, but of course, no driver for it yet. It also has a hardware JPEG decoder (no driver for it yet), hardware MPEG-4 video decoder (no driver for it also). I hope someone will make those drivers (or may be I will if I have finished the FreeBSD stuff).</p>
<p>The power management is still not so good. Sometimes it works perfectly, but sometimes not. On the first day, I can use it about 9.5 hours (according to uptime, part of this uptime is when the LCD is off when i left it for  a while)  reading comic books while installing several softwares using apt-get (the wifi is kept on). On the next day, it shows some strange behaviour, such as refusing to resume after sleep. And restarting it several times makes the battery drain faster (I think it lasted less than 5 hours). I still don&#8217;t know whether this behaviour is from the factory, or may be I have messed around too much.</p>
<p>Most sofware are not designed to be touch operated. I have seen several modal dialog box that appears beneath current window, and you can not switch to it. Plugging an external USB Keyboard seems to be the only good solution when it happens. Sometimes you ocan still escape by holding some combination of buttons, but sometimes plugging a USB keyboard or resetting the device is the only solution (or if you have installed an openssh server, SSH-ing to the device and killing the application).</p>
<p>You have several options for the operating system: the built in OS (Ubuntu), Mer, Google Android (just some initial support, I haven&#8217;t tested it), and Windows CE (Chinese version only for now). You can also do multiboot using those OSes (dual boot, tripeboot, or even quadboot).</p>
<p>Just a note: the device is perfect for reading Manga, but not American comic books. The size fits perfectly for a manga page (except when they show double page). I suggest you use latest Comix application, because it is more touch friendly.</p>
<p>If you are looking for a device that &#8220;just works&#8221;, then this not the device that youare looking for. If you are like me, who likes to mess around with stuff, then this device has many potential. I can use this device as a very large PDA, and I can use it as a netbook by connecting a USB keyboard. It is not pocketable, but it is very portable (smaller than my wife&#8217;s EEE PC). With the USB Host functionality, I can do almost everything that I can do with laptops, such as copying things from USB Disks.</p>
<p>My wife have an EEE PC for her traveling needs, and she also owns a MacBook Pro, which is quite portable around the house, but too heavy for long trips. I wanted to buy another netbook, but I think this device is better for me. I can carry the SmartQ, and put the USB keyboard on my bag. For my traveling preparation, I have bought a USB hub (with power adapter, for those devices that requires it) and a small keyboard, the total for both are 500 baht (~15 USD).</p>
<p>I wrote this post on SmartQ 7, using usb keyboard on Emacs, and then I copy paste the text to Midori web browser.</p>
<p><img src="http://tinyhack.com/wp-content/uploads/2009/08/15082009006-300x225.jpg" alt="15082009(006)" title="15082009(006)" width="300" height="225" class="alignnone size-medium wp-image-141" /></p>
]]></content:encoded>
			<wfw:commentRss>http://tinyhack.com/2009/08/16/smartq7/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
