The Year is 2009 and ...

Installing Maven 2.0.9 on OS X
While Apache Maven, our favorite software project management and comprehension tool, is already installed on OS X, as with so many other great open source tools on the Mac, they aren't really kept up to date. However, installing Maven 2.0.9 isn't a big deal and you even have several options.
Maven
wpbook:~ wolf$ mvn -version
Maven version: 2.0.6
wpbook:~ wolf$


One way to get an up-to-date Maven version on your Mac would be to use Mac Ports and Porticus:
  1. Download and install MacPorts
  2. Download and install Porticus
  3. Start Porticus
  4. Search for "maven" in Porticus
  5. Install

Installing Maven without MacPorts is a little bit more involved but can be done in 5 minutes or less.
  1. Download Maven from http://maven.apache.org/download.html.
  2. Unpacking will create a apache-maven-2.0.9 folder, probably on your desktop. Move this folder into /usr/local, like this:

    sudo mv ~/Desktop/apache-maven-2.0.9 /usr/local/

  3. To make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Maven:

    sudo ln -s /usr/local/apache-maven-2.0.9 /Library/Maven

  4. Next step is making Maven executable:

    chmod ug+x /Library/Maven/bin/mvn
    chmod ug+x /Library/Maven/bin/m2

  5. Now we change the ownership of the /Libaray/Maven folder hierarchy:

    sudo chown -R your_username /Library/Maven

  6. Last step is to update ~/.bash_profile and to verify the update:
    Add the following to the bash_profile:

    export M2_HOME=/Library/Maven
    export M2=$M2_HOME/bin
    export JAVA_HOME=/Library/Java/Home/
    export PATH=$PATH:$M2


    and open a Terminal and enter:

    mvn -version

Dynamic 2D bar codes on the fly
QR-Code for http://wolfpaulus.com Building with QR Code QR Codes (Quick Response Codes) are two dimensional bar codes, developed back in 1994 by Denso-Wave, and are currently very popular in Japan, mostly used for marketing.
With more mobile phones are now equipped with a reasonably good digital camera, QR Codes are used for storing addresses and URLs (known as mobile tagging), allowing mobile phone users to easily and virtually error free bookmark and/or launch URLs in a mobile browser.
While probably more for fun than actually usefulness, this blog now contains QR Codes at the end of every blog entry - well, in the printed version, there may really be a good use-case for including a QR-Code. Anyway, there are a couple of ways how to dynamically generate the QR Code images on the fly.
  • Y.Swetake for instance makes Perl, CGI, and PHP scripts available that can be deployed on a Web Server.
  • Even easier, Google's Chart API can be used on a dynamic site, to create QR-Codes on the fly without having to install any additional libraries, see example below.

Generating QR Codes dynamically on the fly, using Google's Chart API


function getGoogleQR($url,$size ='150',$EC_level='L',$margin='0') {
   $url = urlencode($url);
   $gapi= 'http://chart.apis.google.com/chart';
   return '<img src=".'$gapi'.?chs='.$size.'x'.$size.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$url.'" alt="QR-Code" width="'.$size.'" height="'.$size.'"/>';
}


Give it a try, there are lots of sites allowing you to generate QR-Codes on the Web. Here is just one: KAYWA QR-Code Generator. A QR Code Decoder, converting an image back to the original test string can be found at http://www.drhu.org/QRCode/QRDecoder.php
Btw, ALT-based NeoMedia Technologies' free iPhone application NeoReader performs beautifully, encoding QR codes and launching URLs in Mobile Safari.

Building PhoneME for Mac OS X
A few days ago, I wrote here about how the PhoneME JavaVM can be built with and integrated into OpenWrt, the Linux distribution optimized for WiFi routers or any device that connects over Wifi. However, even with a powerful Java runtime environment available on the target hardware platform, we still need to develop and simulate/test on a development workstation, which may very well be a Mac.
Developing for the PhoneME JavaVM becomes much easier and more fun, if you have the same VM available on your development platform; so here is what I did to get the PhoneME VM build for OS X 10.5 (Intel).

Again, we need to get the sources from the SVN server on java.net here: https://phoneme.dev.java.net/svn/phoneme. Don't get everything, just the trunk (i.e. phoneme/components/cdc/trunk) and tools (i.e. phoneme/components/tools) folder. However, trunk and tools need to end up on the same level (like siblings) on the build machine.

Unfortunately, the currently available trunk only builds on older Macs that is Macs built on the Power-PC architecture. For newer Macs, i.e. Intel based machines, a patch needs to be installed into the just created trunk folder.
Markus Heberling has made this patch available here: http://markus.heberling.net/wp-uploads/2008/04/phoneme-cdc-darwin-x86.zip. The three folders in this patch just need to be added into the source tree in trunk: x86-mac-patch
  • patch cdc/src/darwin-x86 becomes trunk/src/darwin-x86
  • patch cdc/src/darwin-x86 becomes trunk/src/darwin-x86
  • patch cdc/buld/darwin-x86-mac becomes trunk/build/darwin-x86-mac

All ducks are in a row now to kick-off the PhoneME build. But there is still one final decision to be made, what kind of PhoneME runtime should be built?
The J2ME_CLASSLIB argument provided to Make, defines what class library will eventually be created:
  • cdc - (default) will create a limited class library (cdc.jar 884 KBytes) that is meant for testing purposes only.
  • foundation - creates the full Foundation Profile class library (foundation.jar 1.475 KBytes).
  • personal - creates the full Personal Profile class library (personal.jar 2.047 KBytes).

Just like you would expect, compared to the Personal Profile, Foundation is missing java.applet.* and java.awt.*. And compared to the Foundation Profile, the cdc.jar is missing some of the networking and security related classes.
Running Java applications on a Mac that depend on the Personal Profile, also require The X Window System (available at http://xquartz.macosforge.org/trac/wiki) and QT3, the Cross-Platform GUI application framework, installed. QT3 is best installed using FINK and Fink Commander. I usually prefer Porticus but even after several attempts could not make Personal Profile depending Java Apps run. Only after installing QT3 using Fink, did they work flawlessly.

  cd trunk/build/darwin-x86-mac
  make J2ME_CLASSLIB=foundation


With the Java Runtime Environment built, we can now either use and ANT script like this, to build (and deploy) a Java app:



.. or create a new JSDK in an IDE, like IntelliJ IDEA
you may have to rename the trunk/build/darwin-x86-mac/cvm into trunk/build/darwin-x86-mac/java





ideapme3

By Developers For Developers
It's Code Camp time again in Southern California and lots of Coders, Programers, Engineers, Geeks, and Hackers will meet at the California State University Fullerton this coming Saturday and Sunday, January 24 and 25.
Code Camp is a community driven event for developers of all platforms, programming languages and disciplines - well that's the idea at least. Looking at session table, one cannot shake the feeling that .net, asp.net, Azure and Silverlight seem a little over represented - but there are also a couple platform independent, embedded, and Java specific talks scheduled as well.
My sessions: Turning a WiFi Router into a general-purpose Network Device and Java UI Generation at Runtime with SwiXML have been scheduled to take place on Saturday, before dinner. I hope to see you Saturday afternoon at the CSFU Campus in H-123 ... when you Twitter about the event, please use #SoCalCodeCamp in your tweet so we can track.
CodeCamp

Turning a WiFi Router into a general-purpose Network Device

CSFU Campus, H 123, Sat. 01/24/2009, 3:45 - 5:00 PM
Embedded systems are increasingly present in our life and quite a few of them can be repurposed (a.k.a. hacked), to make them even more useful.
The purpose of this session is to have fun and give you some inside of what's involved in turning a $30 wireless router into a general purpose embedded network device, running the LINUX OS and a full featured Java Runtime environment.
We will take a closer look at some popular Router OS distributions, like OpenWrt, DD-WRT, FreeWRT, Tomato, or X-Wrt and show how to flash the Fonera (FON) WiFi router with a vanilla OpenWrt distribution. The FON is a very small, relatively simple, and inexpensive router, built on the AR531x/231x Atheros WiSoC (Wireless System-on-a-Chip) with an integrated 32-bit MIPS R4000-class processor running at 183.5 MHz, comes with 8 Mbytes Flash Memory and 16 MByte RAM. In short, it has all the attributes required to be added our digital playground.

Embedded OS Development / Kernel Architecture, Implementation and port for Embedded Systems
OpenWrt is a Linux distribution optimized especially for embedded devices and surprisingly, the OpenWrt kernel configuration is done with the help of a character based UI. OpenWrt also comes with a lightweight package management system (IPKG or more recently OPKG), meaning that features that have not already been built into the kernel, can be added later, at runtime. As an example, we will take a look at how a JavaVM could be built, packaged, and deployed, or built directly into the kernel.

Java UI Generation at Runtime with SwiXML

CSFU Campus, H 123, Sat. 01/24/2009, 2:30 - 3:45 AM
SwiXML is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that are parsed at runtime and rendered into javax.swing objects. Theoretically, you can look at SwiXML as an XML based domain-specific language, allowing to declare Java Swing GUIs. The SwiXML engine will then later at runtime, take a GUI declaration and create that User-Interface on the fly, just like a Web Browser would do with an HTML document.
SwiXML doesn't introduce any new layout managers or component classes. Instead, it operates directly on the Swing component classes using introspection.
Doubling the Arduino Flash Memory once again
Times really flys when you're having fun - it has been more two years since I posted this journal entry about how to double the Arduino board's Flash memory by replacing the ATmega8 with an ATmega168 microcontroller. Lots has changed since then, e.g. the Arduino project now includes several board designs and layouts, most of which feature the ATmega168.

For the last couple of months now, the even better AVR 8-Bit RISC ATmega328P micro-controller was hard get. However, it's now more broadly available and four of these 8-Bit Micros have arrived today, shipped form one of my favorite Online-Electronics stores: SparkFun. The ATmega328P features 32 KBytes of Flash, 2 KBytes of RAM, and 1 KByte of EEPROM a nice improvement over Arduino's original configuration with an ATmega8: (8 KBytes of flash, 1 KByte of RAM, and 512 Bytes of EEPROM).
Time to revisit the Arduino Project, an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software, intended for anyone interested in creating interactive objects or environments.
ATmega328P-20PU

Burn Baby Burn .. Again

AVRISP mkII In-System Programmer The ATmega328 comes in the same 28-lead PDIP packaging and replacing the chip was straight forward and took only a couple of seconds; burning the boot loader on the other hand - just like last time - took a little longer. The Arduino board has the AVR typical 6 header ICSP, an in-system programming port, which allows burning a boot loader without removing the microcontroller chip from the board. At least for Mac users, I recommend AVR's AVRISP mkII (ATAVRIPS2-ND), available for $34 at DigiKey.
The AVRISP can program newer 8-bit RISC microcontrollers (with ICSP Interface) through the USB port. The target board still needs to be powered and its regular ports should be disconnected from other devices.
Arduino Board with the original ATmega Micro-Controller removed
Since switching form the ATmege8 to the 16, the Arduino's Development Environment has also switched to avrdude, the software that loads programs from your machine onto the chips - manipulates the ROM and EEPROM contents of AVR microcontrollers. To use avrdude successfully with the new ATmega3258P, you may need to update its configuration file somewhere like here: /Applications/arduino-0013/hardware/tools/avr/etc, (look for the configuration file in the Resources areas below).

Preparation ...

At this point, the Arduino's microcontroller had been replaced with the 32 KByte ATmega328P and everything but the ICSP port had been disconnected. The Arduino board itself was powered by a 7.5V 500mA power supply and the AVRISP-mkII connected the board with the Mac's USB port.
On the software side, avrdude 5.5 was installed, the avrdude.conf file had been updated, and the ATmega328 boot-loader was made available here /AT328.hex, (look for the configuration file in the Resources areas below).
Arduino Board with AVRISP mkII during the burn process

Burning, Fuses, and Flashing the Bootloader

Burning a new boot loader is a three-step process: unlocking the boot loader segment, uploading the new boot loader, and looking boot loader segment again. For an AVR microcontroller, the closest thing to a configuration file is its set of fuses. Fuses are used to configure important system parameters and a few important but obscure options can only be set through the ICSP. For instance, the ATmega328 defaults to the use of a 1 MHz internal clock and would ignoring the 16 MHz crystal on the Arduino board, if not told otherwise, through a fuse setting.
  1. Unlocking the boot loader segment, erase the chip, and set fuses (set boot loader size to 2K words [=2KByte]: 0x3800-0xFFFF, set clock speed to external 16 MHz)
    avrdude -p m328p -b 115200 -P usb -c avrispmkII -V -e -U lock:w:0x3F:m -U hfuse:w:0xD8:m -U lfuse:w:0xFF:m -U efuse:w:0x03:m
  2. Uploading the boot loader
    avrdude -p m328p -b 115200 -P usb -c avrispmkII -V -D -U flash:w:/AT328.hex:i
  3. Re-locking the boot loader segment
    avrdude -p m328p -b 115200 -P usb -c avrispmkII -V -U lock:w:0x0F:m
Check out the Atmel AVR Fuse Calculator for more details.

Burn Log

Arduino IDE

After removing the AVRISP mkII In-System Programmer and changing the power-selector on the Arduino board, it was time to fire-up the Arduino IDE, but not before replacing the board definition file, required to make the IDE recognize the new micorcontroller, (look for the configuration file in the Resources areas below). Now the ATmega328 can be set by selecting Arduino w/ ATmege328 from the Tools/Board menu.
The Fibonacci program was quickly uploaded and running - the IDE reported Binary sketch size: 2020 bytes (of a 30720 byte maximum), which makes sense, considering that we set the efuse to preserve 2K words for the boot loader.

Arduino IDE after uploading a program
[Arduino IDE after uploading a program]
Fibonacci Program Output for the 1st 39 fibs

Resources

Arduino NG board with the ATmega328P-PU 8-Bit RISC Micro Controller
[Arduino NG board with the ATmega328P-PU 8-Bit RISC Micro Controller]
Batiquitos Lagoon after Sunset
Batiquitos Lagoon after Sunset

A Carlsbad evening, when the sun disappears and daylight fades.

Batiquitos Lagoon is located on the coast about 30 miles north of San Diego. It's in the city of Carlsbad and just north of the city of Encinitas. Batiquitos Lagoon is a coastal wetland north of San Diego between the cities of Carlsbad and Encinitas. It is one of the few remaining tidal wetlands on the southern California coast of the United States.

Hello AppleTV, sometimes someone will find you annoying
Hello AppleTV, sometimes someone will find you annoying because you happen to do something ... or more likely, because you don't. I don't want you to change something about yourself just because and you know, we are all annoying at times, and some people are too quick to criticize. Oh, forget about it, enough is enough ...

I have an AppleTV for several months now and even with good tools like Handbrake and the unfortunately discontinued VisualHub, it's really annoying, having to convert every AVI or DivX encoded movie to make it play on the AppleTV. Other then that, it's really a great device which doesn't require much attention.

Meaning the task at hand was to mod. the AppleTV to make it play all sorts of movies, not only those that were encoded in a format that has Apple's blessing. Nothing more, nothing less.
This AppleTV has only a 40 GByte Harddrive and with hulu removed from Boxee, I didn't see the need to install any other software components.

AppleTV

Patchstick

The 1st step was to enable ssh on the AppleTV. This used to be very hard and required opening the enclosure. Not anymore! The atvusb-creator projects describes in detail how to put software onto a USB-Flashdrive that when inserted before the AppleTV boots enables ssh. Again, since Boxee, XBMC, or SoftwareMenu weren't necessary, I happily opted-out.
With ssh now enabled, the rest was done in the matter of minutes. And since I had all the required codecs installed on my Macbook already, the remaining tasks were simply to copy the files over to the AppleTV, to put them into the right location, and finally to reboot the device.

AppleTV Patchstick

Copy

With ssh available, copying files can be done via scp, or Fugu, or Tranmit, the target location should be the home folder of the frontrow user account: frontrow@AppleTV.local:~
  • ~/Downloads/ATVFiles-1.2.0.run.sh (available at http://ericiii.net/sa/appletv/ATVFiles-1.2.0.run)
  • /Library/Quicktime/Perian.component
  • /Library/Quicktime/AC3MovieImport.component
  • /Library/Quicktime/Flip4Mac\ WMV\ Import.component .. (optional)
  • /Library/Audio/Plug-ins/Components/A52Codec.component
  • /System/Library/Quicktime/QuickTimeMPEG2.component .. (optional)

Deploy

Next step was to ssh into the AppleTV and run the ATVFiles installer script and move the components into their final destination:
  • sudo sh ~/ATVFiles-1.2.0.run.sh
  • sudo mount -uw /
    (sets the file system to read and write)
  • sudo mv ~/Perian.component /Library/Quicktime/
  • sudo mv ~/AC3MovieImport.component /Library/Quicktime/
  • sudo mv ~/Flip4Mac\ WMV\ Import.component /Library/Quicktime/> .. (optional)
  • sudo mv ~/A52Codec.component /Library/Audio/Plug-Ins/Components/
  • sudo mv ~/QuickTimeMPEG2.component /System/Library/QuickTime/ .. (optional)

Reboot

After rebooting the AppleTV via sudo reboot tools like fugu or transmit work well, copying files over to the AppleTV. When watching the AppleTV, there is now a new menu item, Files, which for instance allows browsing of the frontrow user's home directory structure, the location where movies are best copied to.

If you just want to play a movie every now and then that doesn't happen to be a mov or mp4 file, this is a quick and easy way to make it happen.
While Boxee or NitoTV are much more capable, they also seem to make the AppleTV more sluggish.
The Nutella Experiment
Growing up in Germany means being exposed to different foods than kids here in America. I still remember the jelly, my grandmother used to make from homegrown raspberries, we helped her pick in the garden.
North-American and German Nutella Jars Kids in Europe usually don't know much about peanut butter and grow up on hazelnut spread instead. There are different brands, all with subtle flavor differences, featuring either a more nutty or more chocolaty taste. Ferrero's Nutella is the leading brand, with the term Nutella being synonymously used for Hazelnut Spreads all over Europe. Not surprisingly, it's also among the more expensive hazelnut chocolate spreads.

The Nutella success story began in northwestern Italy, shortly after World War II, when master confectioner Pietro Ferrero used hazelnuts, which are plentiful in the Piedmont region of Italy, to extend the chocolate supply. 23 years later, in 1969, Ferrero U.S.A., Inc. was founded and Nutella was introduced to the US market. Today, the Nutella supply for the US is produced in Canada and somehow finds its way to my breakfast table quite regularly.
Lately, Nutella became more popular here in the US, (e.g. My Nutella - Rihanna Umbrella Parody, and was featured in the Los Angeles Times' Food Section this February: Nutty for Nutella: spreadable joy however during a recent visit to Germany http://twitter.com/tompaulus and I made a disturbing discovery. The Nutella in Germany tastes differently than the Nutella here in the US and what's even worse, the German stuff tastes much better.
Open German Nutella Jar German Nutella and North-American Jars, still sealed North-American and German Nutella Spoon Test North-American and German Nutella  Taste Test

The Nutella Experiment

Back in the US we almost forgot about the taste difference, until one morning when we once again enjoyed the creamy goodness. But we weren't sure anymore, if the German Nutella really tasted better and therefore decided to find out and do the ultimate taste-test.

Acquisition

Like abovementioned, the Nutella here in the US is actually a product of Canada, and available in many grocery store chains like VONS, Ralphs, or Albertsons; the Store Locator may show some additional stores locations near you.
The North American Nutella sample for out test was purchased at the World Market in Oceanside, which offers the 13 OZ (370 g) plastic jar for US$ 3.99

Finding Nutella, produced in Europe, or to be more precise in Germany, can be a real challenge. Fortunately, Big John, founder and owner of Tip Top Meats - European Delicatessen, Inc. calls Carlsbad his home and his store offers many German and European specialties, among them extraordinary German beers (topic for another blog post, maybe) and Nutella. Slightly more expensive, the 29.1 OZ (825 g) glass jar was to be had for US$ 10.49

Classification

For the untrained shopper it can be quite challenging to see the subtle differences in the packaging. Here are some hints:
  • Glass vs. Plastic - a glass jar is a strong hint that you may have found Nutella, originating in Europe.
  • Texture on the embossed text on the lid - all lids seem to be white with the Nutella name embossed. However, the German version has a dotted texture on the characters.
  • Golden Foil - removing the lid reveals a golden foil, sealing the content. The North American version is blank, the German Nutella has the product name and additional information printed on the foil.

Look, Smell, and Taste

Cert. Nutella Taste Tester To create fair and equal test conditions, we kept the two jars for one week in a dark location at room temperature. Opening the lids and removing the golden foil was already an eye-opening experience. The German Nutella is a little darker and the surface appear to be less shiny.

The smell is even more telling that there must be a difference. The North-American product doesn't seem to be releasing much scent at all. The German Nutella on the other hand has a noticeable nutty scent.
The widely-known Spoon Test showed that the consistency of the North-American Nutella is a little creamier and softer.

Obviously, taste is subjective, and opinions differ even stronger, when it comes to food. However, all participating Nutella Testers (that would be http://twitter.com/tompaulus and http://twitter.com/wolfpaulus) agreed unanimously that the German Nutella tastes much more intensive, more nutty and chocolaty, when compared with the North-American product. One tester got blind folded and was still able to identified the Nutella's origin in four consecutive tests.
The German Nutella tasted better and not surprisingly, was strongly preferred during the meal following the Taste Test.

Better then Nothing but still a Bad Copy

If a European or German version is unavailable or simply too hard to get then we will certainly continue to buy the Canadian version of the Nutella product. However, I feel sorry for the typical American consumer, who doesn't even know what the real stuff tastes like.
There are many more examples like that. Take for instance the famous Harp Lager, an Irish beer (cousin of Guinness Stout) and widely available here in the US. The label clearly states Imported, a closer look however reveals that imported in this case means imported from Canada, where the beer is brewed and bottled. Again, the taste is different when compared to the real Irish Harp, which can be sampled in some fine Irish pubs here in Southern California.
Seems like food corporations could do a much better job when introducing foreign specialties but instead are sacrificing quality for profit or maybe act just carelessly.
On the other hand, if given a choice, we as consumers shouldn't be rewarding those companies by buying their "tainted" products. Coke for example puts High Fructose Corn Syrup in the Coca-Cola it's selling here in the US. The Coca-Cola bottled in Tijuana, Mexico however, is made with cane sugar. Cron.com had an interesting piece about this here: Have a taste of the real thing - sugar, that is
Just like my grandmother did way back when, we should be spending our money more consciously, going the extra mile, buying products from companies that do the same.
Anza-Borrego's Hellhole Canyon
Anza-Borrego's Hellhole Canyon

Anza-Borrego's Hellhole Canyon


Near the center of Anza-Borrego Desert State Park, the largest state park in California, lies Hellhole Canyon. After 1.2 miles in, the walls of the canyon begin to close in and it seems a bit surprising to find a place where mosses, ferns, sycamores, and cottonwoods flourish around a small 20 feet waterfall, Maidenhair Falls. View the entire set here.
La Fonera 2.0 Preview
The Fonera 2.0 just became available in Europe (on April 21st) and is expected to arrive here in the US in May, making this the perfect time for taking a first look at the new 2.0 software.

I had gotten my hands on the La Fonera 2.0 beta hardware back in December 2008 and had deployed an OpenWrt 8.09 RC release soon there after, which was still on there. This meant that I needed to somehow reflash the router with the new loader and firmware before I could see what the new Software was all about.

Putting the original (or newer) firmware back on a Fonera FON 2.0

During booting, the FON 2200, waits at IP address 192.168.1.1 on port 9000, for a brief moment, to receive an interrupting Control-C. The process of how to get to the bootloader prompt is described in some detail over here: La Fonera 2.0 (FON 2202) Hacking, Cleaning House Fonera and Fonera 2.0

Files

The following 3 files are required during re-flashing and need to be made available to the router via TFTP. Also, check here for a more current Fonera 2 image: http://download.fonosfera.org

RedBoot Prompt

Here are steps required to put the three files back on the fonera router. Writing to flash takes some time, especially the last step, in which a 4.4 MBytes are written, requires some patience.


#========================================================
# Reset the current flash and the partition table
#========================================================
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .


#========================================================
# Tell RedBoot about the TFTP-Server's IP
#========================================================
RedBoot> ip_address -l 192.168.1.1/24 -h 192.168.1.2
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2


#========================================================
# write the 2nd stage bootloader into flash
#========================================================
RedBoot> load -r -b %{FREEMEMLO} loader.bin
Using default protocol (TFTP)
Raw file loaded 0x80040400-0x800503ff, assumed entry at 0x80040400


RedBoot> fis create -e 0x80100000 -r 0x80100000 loader
... Erase from 0xa8030000-0xa8040000: .
... Program from 0x80040400-0x80050400 at 0xa8030000: .
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .


#========================================================
# load into RAM and write the failsafe image into flash
#========================================================
RedBoot> load -r -b %{FREEMEMLO} failsafe.image
Using default protocol (TFTP)
Raw file loaded 0x80040400-0x801803ff, assumed entry at 0x80040400


RedBoot> fis create -f 0xA8660000 image2
... Erase from 0xa8660000-0xa87a0000: ....................
... Program from 0x80040400-0x80180400 at 0xa8660000: ....................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .


#========================================================
# load into RAM and write the image (4+ MB) into flash
#========================================================
RedBoot> load -r -b %{FREEMEMLO} flipper.image
Using default protocol (TFTP)
Raw file loaded 0x80040400-0x804b0403, assumed entry at 0x80040400


RedBoot> fis create image
... Erase from 0xa8040000-0xa84b0004: ........................................................................
... Program from 0x80040400-0x804b0404 at 0xa8040000: ........................................................................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>

When the re-flashing is finally done, all what's left to do to is to reboot the router.

Fonera 2.0 UI

Fonera 2.0 GUI
Fonera 2.0 GUI
Fonera 2.0 GUI
Sh!t We Like - The Creative Live! Cam Vid. IM Ultra
Originally I was just looking for a decent Webcam for a Linux project, but since almost all computers in my house run OS X, I thought it would be nice to find one that could be use on a MacMini as well. Fortunately, there is a growing list of UVC compatible devices available, some of which have been tested to work on a Mac out-of-the-box, i.e. without the need to install additional drivers.
Considering Linux and Mac compatibility, pixel/resolution, as well as price, we picked the Creative LIVE! CAM Video IM Ultra, which when compared to a built-in iSight cameras seems to create higher quality videos.

Video Recording

While we used the standard 640x480 video format for the recording below, the VF415 Live! Cam Vid. IM Ultra's native format is Y'CbCr 4:2:2 -yuvy, 1280x960 with Millions of Colors.
Creative LIVE! CAM Video IM Ultra

  • Format: H.264 640x480 Millions of Colors, AAC, Mono, 44.100 KHz
  • FPS: 30 frames per second
  • Data Rate: 1500.24 kbits/s

MacBook built-in iSight Camera

  • Format: H.264 640x480 Millions of Colors, AAC, Mono, 44.100 KHz
  • FPS: 30 frames per second
  • Data Rate: 711.34 kbits/s


Audio Recording

It was a positive surprise, finding out that there is a microphone hidden in the camera's focus ring. However, the microphone is pretty much useless, at least when used under Mac OS X. We used WireTap Studio to create a fair comparison recording, using the MacBook's built-in microphone, the Live Cam Ultra's built-in mic., as well as an external Logitech USB Microphone.
imultra
  • Creative LIVE! CAM Video IM Ultra built-in Microphone:
  • Creative LIVE! CAM Video IM Ultra built-in Microphone:
  • Logitech AK5370 external USB Microphone:,

Overall, we really like the IM Ultra, the image quality is crisp and it attaches easily to a laptop's lids as well as a much thicker LCD monitors. However, the audio quality really sucks (at least when used on a Mac and you better have another mic on hand). Moreover, expectedly, the camera doesn't work on a low power USB port.
La Fonera 2.0 FON 2100 a/b/c - RedBoot details and booting into OpenWrt 8.09.1 Kamikaze
Some blog post take a little longer to write and this was certainly one of those. It wasn't so much the writing but the building of the tools and tool-chain, running all the tests and scripts, and just to get things right.
The Fonera 2.0g (FON 2202) became available in Europe (on April 21st) and an all new 2.0n (with 802.11 N support) is expected to arrive in Europe as well as here in the US (US$ 99) in October, making this the perfect time for a discovery mission into the Fonera FON 2100, which isn't a very complex piece hardware but still a very capable device.

The La Fonera 2.0 (FON 2100) doesn't come with ssh enabled but its RedBoot v1.3.0 boot manager, which is based on the eCos real-time operating system Hardware Abstraction Layer (HAL), allows for downloading and execution of embedded applications via serial (X/Y-modem protocol) or Ethernet (TFTP protocol); there are plenty of sites that provide detailed recipes on how to get the Fonera into a state, where its bootloader becomes accessible.
RedBoot makes it easy to replace the currently deployed heavily customized Linux distribution with a more commonly used Linux distribution for wireless devices, like DD-WRT or OpenWrt.

During booting, the FON 2100, waits at IP address 192.168.1.254 on port 9000, for about 10 seconds, to receive an interrupting Control C. Meaning, if a host computer with an assigned IP of something like 192.168.1.2 is connected to the Fonara, issues this command:

echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo nc -vvv 192.168.1.254 9000 < break.bin; telnet 192.168.1.254 9000

and the Fonera gets rebooted, RedBoot will pause the boot process and show the RedBoot> prompt.

Depending on the host's OS, this can also be done, by simply launching telnet 192.168.1.254 9000 and pressing Control C. However, it may be necessary to re-configure telnet a little, for instance by putting this .telnetrc file in the user's home directory.

Fonera 2100 Serial Access
# ~/.telnetrc
# Fonera 2100 Hacking
192.168.1.254 9000
  mode line
# Fonera 220x Hacking
192.168.1.1
  mode line

The boot process can also be interrupted, using the Fonera's serial port (TTL, 9600, 8N1), accessible only after opening the Fonera's enclosure. The Keyspan USA-19HS USB to Serial Adapter and a RS232 Level Shifter Adapter may be necessary accessories to access the Fonera through the serial port.

RedBoot Prompt

No matter if accessed through ethernet or serial port, entering Control C during the initial phase of the boot process will provide access to the bootloader prompt.

Entering the version command reveals that the bootloader operates in ROMRAM mode, where RedBoot resides in flash memory, but is copied to RAM memory before it starts executing. The RAM footprint is larger than for ROM mode, but it normally runs faster and it is able to update itself, i.e. the flash region where its image resides.

RedBoot> version

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
RedBoot>

This output shows that of the Fonera's 16 MB RAM (0x81000000 - 0x80000000 = 0x1000000 = 16,777,216) almost all (0x80fe1000 - 0x80040450 =0xFA0BB0 = 16,386,992) is available. An OS is still stored in the 8 MB Flash (0x7F0000 = 8,323,072) i.e. 64K are occupied.

Board Information

Entering the bdshow command reveals the Atheros Board Data information

RedBoot> bdshow
name: MR3201A-FLF-FON
magic: 35333131
cksum: 5eb3
rev: 5
major: 1
minor: 0
pciid: 0013
wlan0: yes 00:18:84:**:**:**
wlan1: no ff:ff:ff:ff:ff:ff
enet0: yes 00:18:84:**:**:**
enet1: no ff:ff:ff:ff:ff:ff
localbus: no ff:ff:ff:ff:ff:ff
PCI: no ff:ff:ff:ff:ff:ff
uart0: yes
sysled: yes, gpio 2
factory: yes, gpio 6
serclk: external
cpufreq: configured -1 Hz
sysfreq: configured -1 Hz
memcap: disabled
watchdg: enabled
serialNo: 8647******
RedBoot>

Persistent State Flash-based Configuration and Control

Executing the fconfig -l command will list the configuration that is kept in FLASH memory. More details about the fconfig command options can be found here: http://ecos.sourceware.org/docs-latest/redboot/configuring-the-redboot-environment.html.

RedBoot> fconfig -l
Run script at boot: true
Boot script:

Boot script timeout (1000ms resolution): 10
Use BOOTP for network configuration: false
Gateway IP address: 0.0.0.0
Local IP address: 192.168.1.254
Local IP address mask: 255.255.255.0
Default server IP address: 0.0.0.0
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false


Executing the fconfig -i command will interactively change and then persist the configuration. Important configuration information like the Serial Port's communication speed (default is 9600 kbps), the TFTP server's IP Address, or the file name of the Linux Kernel can be changed here.

RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: true
Boot script:
Enter script, terminate with empty line
>> fis load -l vmlinux.bin.l7
>> exec
>>
Boot script timeout (1000ms resolution): 5
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.1
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.2
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .

fis load transfers an image from flash memory to RAM. More details about the fis command options can be found here: http://ecos.sourceware.org/docs-latest/redboot/fis-load-command.html.

Flash Image System (FIS)

The Fonera's Flash Image System can be accessed and modified using the fis.
  • fis init -- Initialize Flash Image System
  • fis list -- List Flash Image System directory
  • fis free -- Free flash image
  • fis create -- Create flash image
  • fis load -- Load flash image
  • fis delete -- Delete flash image
  • fis lock -- Lock flash area
  • fis unlock -- Unlock flash area
  • fis erase -- Erase flash area
  • fis write -- Write flash area
More details about the fis command options can be found here: http://ecos.sourceware.org/docs-latest/redboot/flash-image-system.html.
Deleting all but the boot blocks is as simple as issuing the fis init command. Here, the fis init command is executed followed by a fis list and a fis free

Running reset shows that the OS has been removed and the Fonera now boots into the bootloader prompt.

RedBoot> reset
+PHY ID is 0022:5521
Ethernet eth0: MAC address 00:18:84:**:**:**
IP: 192.168.1.254/255.255.255.0, Gateway: 0.0.0.0
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug 7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort
RedBoot>

Running telnet 192.168.1.254 9000 will also immediately show the RedBoot prompt now:

wpbook:~ wolf$ telnet 192.168.1.254 9000
Trying 192.168.1.254...
?Invalid command: 9000
Connected to 192.168.1.254.
Escape character is '^]'.
RedBoot>


OpenWrt

Running the fis init command on the Fonera removes the OS and the only software available on the device now is the bootloader, i.e., we now need a new Linux distribution for this embedded device to bring it back to life. OpenWrt is one of the options and freely available via subversion.
  cd ~/Work/Embedded/OpenWrt/branches/8.09.1
  svn co svn://svn.openwrt.org/openwrt/tags/8.09.1 8.09.1

Generally, the following tools need to be pre-installed and if building on OS X, MacPorts and Porticus are recommended to simplify their installation.
  • gcc
  • binutils
  • patch
  • bzip2
  • flex
  • bison
  • make
  • gettext
  • pkg-config
  • unzip
  • libz-dev
  • libc headers
  • autoconf
  • bison
  • ccache
  • flex
  • gawk
  • libncurses-dev.
  • svn
  • ccache
With OpenWrt Kamikaze 8.09.1 and all the tools downloaded, issuing make menuconfig will bring show the OpenWrt Configuration Menu where the Atheros 231x/5312 [2.6] target needs to be selected. To keep the initial image small, the following unessential tools can be deselected:
  • Base System: bridge, firewall, iptables, opkg, uci, uclibc
  • Network: ppp

OpenWrt: make menuconfig
Executing make after saving the configuration, results in deployable kernel image and root file system, both of which can be found here: ~/Work/Embedded/OpenWrt/barnches/8.09.1/bin/. Look for
  • openwrt-atheros-vmlinux.lzma - (kernel) about 700 KB
  • openwrt-atheros-root.squashfs - (root fs) about 900 KB
The image can be hosted using either an HTTP-Webserver or a TFTP server, like Fabrizio La Rosa's.

Load the Kernel Image

.. back on the device in RedBoot ..

ip_address

More details about ip_address here: http://ecos.sourceware.org/docs-latest/redboot/ip-address-command.html
ip_address sets the IP address of the default server. Use of this address is implied by other commands, such as load.

RedBoot> ip_address -h 192.168.1.2
IP: 192.168.1.254/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
RedBoot>

load

More details about load can be found can be found here: http://ecos.sourceware.org/docs-latest/redboot/download-command.html
load downloads programs or data to the RedBoot platform. By default RedBoot loads images into some free RAM area which can be addressed later using the variable %{FREEMEMLO}.
-r specifies raw (or binary) data, which also implies that -b or -f must be used.
-b address in memory to load the data. Formatted data streams will have an implied load address, which this option may override.
-f address in flash to load the data. Formatted data streams will have an implied load address, which this option may override.

RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x800f07ff, assumed entry at 0x80040800
RedBoot>

fis create

More details about fis create here: http://ecos.sourceware.org/docs-latest/redboot/fis-create-command.html.
This command creates an image in the FIS directory and obviously, the data for the image must exist in RAM memory before it can be copied. By default, fis create takes the data loaded by the last load command as input for a partition starting at the first free block of the flash space. Important are the values for the RAM address (-r) and entry point (-e), which are linux specific and need to have exactly these values. The partition name 'vmlinux.bin.l7' is configured within RedBoot (see above) as the default boot partition's name and is of course changeable.

RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa80e0000: ...........
... Program from 0x80040800-0x800f0800 at 0xa8030000: ...........
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>


Load the Rootfs Image

Before loading the root filesystem, we issue fis list and fis free once again:

RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
vmlinux.bin.l7 0xA8030000 0x80041000 0x000B0000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000

RedBoot> fis free
0xA80E0000 .. 0xA87E0000

RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-root.squashfs
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x801207ff, assumed entry at 0x80040800


The information provided by fis free is now used like this:
0xA87E0000 minus 0xA80E0000 = 0x700000, which is used to create the Root-Filesystem rootfs:

RedBoot> fis create -l 0x700000 rootfs
... Erase from 0xa80e0000-0xa87e0000: ................................................................................................................
... Program from 0x80040800-0x80120800 at 0xa80e0000: ..............
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>


Reset

This time, running reset will boot the Fonera into OpenWrt ...
RedBoot> reset



Fonera Photos

  • Fonera 2.0 a/b/c (FON 2100)  
  • Fonera 2.0 a/b/c and 2.0 g (FON 2202)  
  • Fonera 2.0 n (FON ....)  
La Fonera 2.0 FON 2202 g - RedBoot details and booting into OpenWrt 8.09.1 Kamikaze
Like previously mentioned, the Fonera 2.0g (FON 2202) became available in Europe (on April 21st) and an all new 2.0n (with 802.11 N support) is expected to arrive in Europe as well as here in the US (US$ 99) in October, once again, making this the perfect time for a discovery mission into the Fonera FON 2202, which just like the FON 2100, isn't a very complex but still a capable device.

The La Fonera 2.0 (FON 2202) developer version comes with ssh enabled but there is also the RedBoot v1.1 boot manager, which is based on the eCos real-time operating system Hardware Abstraction Layer (HAL), allows for downloading and execution of embedded applications via serial (X/Y-modem protocol) or Ethernet (TFTP protocol); there are plenty of sites that provide detailed recipes on how to get the Fonera into a state, where its bootloader becomes accessible.
RedBoot makes it easy to replace the currently deployed heavily customized Linux distribution with a more commonly used Linux distribution for wireless devices, like DD-WRT or OpenWrt.

During booting, the FON 2202, waits at IP address 192.168.1.1 on port 9000, for about 2 seconds, to receive an interrupting Control C. Meaning, if a host computer with an assigned IP of something like 192.168.1.2 is connected to the Fonara, issues this command:

echo -e "\0377\0364\0377\0375\0006" >break.bin; sudo nc -vvv 192.168.1.1 9000 < break.bin; telnet 192.168.1.1 9000

and the Fonera gets rebooted, RedBoot will pause the boot process and show the RedBoot> prompt.

Depending on the host's OS, this can also be done, by simply launching telnet 192.168.1.1 9000 and pressing Control C. However, it may be necessary to re-configure telnet a little, for instance by putting this .telnetrc file in the user's home directory.

Fonera 2202 Serial Access
# ~/.telnetrc
# Fonera 2100 Hacking
192.168.1.254 9000
  mode line
# Fonera 220x Hacking
192.168.1.1
  mode line

The boot process can also be interrupted, using the Fonera's serial port (TTL, 9600, 8N1), accessible only after opening the Fonera's enclosure. The Keyspan USA-19HS USB to Serial Adapter and a RS232 Level Shifter Adapter may be necessary accessories to access the Fonera through the serial port.

RedBoot Prompt

No matter if accessed through ethernet or serial port, entering Control C during the initial phase of the boot process will provide access to the bootloader prompt.

Entering the version command reveals that the bootloader operates in ROMRAM mode, where RedBoot resides in flash memory, but is copied to RAM memory before it starts executing. The RAM footprint is larger than for ROM mode, but it normally runs faster and it is able to update itself, i.e. the flash region where its image resides.

RedBoot> version

RedBoot(tm) bootstrap and debug environment [ROMRAM]
OpenWrt certified release, version 1.1 - built 12:40:38, Sep 3 2007

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: FON 2202
RAM: 0x8000 0000-0x82000000, [0x80040290-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
RedBoot>

This output shows the Fonera's 32 MB RAM (0x8200 0000 - 0x8000 0000 = 0x200 0000 = 33,554,432) and 8 MB Flash (0x7F0000 = 8,323,072)

Persistent State Flash-based Configuration and Control

Executing the fconfig -l command will list the configuration that is kept in FLASH memory. More details about the fconfig command options can be found here: http://ecos.sourceware.org/docs-latest/redboot/configuring-the-redboot-environment.html.

RedBoot> fconfig -l
Run script at boot: true
Boot script:
.. fis load -l kernel
.. exec

Boot script timeout (1000ms resolution): 2
Use BOOTP for network configuration: false
Gateway IP address: 0.0.0.0
Local IP address: 192.168.1.1
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.254
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
RedBoot>


Executing the fconfig -i command will interactively change and then persist the configuration. Important configuration information like the Serial Port's communication speed (default is 9600 kbps), the TFTP server's IP Address, or the file name of the Linux Kernel can be changed here.

RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: true
Boot script:
Enter script, terminate with empty line
>> fis load kernel
>> exec
>>
Boot script timeout (1000ms resolution): 5
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.50
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.2
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .

fis load transfers an image from flash memory to RAM. More details about the fis command options can be found here: http://ecos.sourceware.org/docs-latest/redboot/fis-load-command.html.
http://ecos.sourceware.org/docs-latest/redboot/fis-load-command.html

Flash Image System (FIS)

The Fonera's Flash Image System can be accessed and modified using the fis.
  • fis init -- Initialize Flash Image System
  • fis list -- List Flash Image System directory
  • fis free -- Free flash image
  • fis create -- Create flash image
  • fis load -- Load flash image
  • fis delete -- Delete flash image
  • fis lock -- Lock flash area
  • fis unlock -- Unlock flash area
  • fis erase -- Erase flash area
  • fis write -- Write flash area
More details about the fis command options can be found here: http://ecos.sourceware.org/docs-latest/redboot/flash-image-system.html.

fis list

More details about fis list can be found can be found here: http://ecos.sourceware.org/docs-latest/redboot/fis-list-command.html
list lists the images currently available in the FIS.

  • RedBoot - the bootloader itself, occupying about 192 KByte
  • FIS directory - a Partition Table, about 60 KByte, without it, RedBoot wouldn't know what to load and boot.
  • RedBoot config - 4 Kbyte, contains the configuration for the bootloader.
Deleting all but the boot blocks is as simple as issuing the fis init command.
Here, the fis init command is executed followed by a fis list and a fis free

Running reset shows that the OS has been removed and the Fonera now boots into the bootloader prompt.

Running telnet 192.168.1.50 9000 will also immediately show the RedBoot prompt now:

wpbook:~ wolf$ telnet 192.168.1.50 9000
Trying 192.168.1.50...
Connected to 192.168.1.50.
Escape character is '^]'.

RedBoot>


OpenWrt

Running the fis init command on the Fonera removes the OS and the only software available on the device now is the bootloader, i.e., we now need a new Linux distribution for this embedded device to bring it back to life. OpenWrt is one of the options and freely available via subversion.
  cd ~/Work/Embedded/OpenWrt/branches/8.09.1
  svn co svn://svn.openwrt.org/openwrt/tags/8.09.1 8.09.1

Generally, the following tools need to be pre-installed and if building on OS X, MacPorts and Porticus are recommended to simplify their installation.
  • gcc
  • binutils
  • patch
  • bzip2
  • flex
  • bison
  • make
  • gettext
  • pkg-config
  • unzip
  • libz-dev
  • libc headers
  • autoconf
  • bison
  • ccache
  • flex
  • gawk
  • libncurses-dev.
  • svn
  • ccache
With OpenWrt Kamikaze 8.09.1 and all the tools downloaded, issuing make menuconfig will bring show the OpenWrt Configuration Menu where the Atheros 231x/5312 [2.6] target needs to be selected. To keep the initial image small, the following unessential tools can be deselected:
  • Base System: bridge, firewall, iptables, opkg, uci, uclibc
  • Network: ppp

OpenWrt: make menuconfig
Executing make after saving the configuration, results in deployable kernel image and root file system, both of which can be found here: ~/Work/Embedded/OpenWrt/barnches/8.09.1/bin/. Look for
  • openwrt-atheros-vmlinux.lzma - (kernel) about 700 KB
  • openwrt-atheros-root.squashfs - (root fs) about 900 KB
The image can be hosted using either an HTTP-Webserver or a TFTP server, like Fabrizio La Rosa's.

TFTP Server

Load the Kernel Image

.. back on the device in RedBoot ..

ip_address

More details about ip_address here: http://ecos.sourceware.org/docs-latest/redboot/ip-address-command.html
ip_address sets the IP address of the default server. Use of this address is implied by other commands, such as load.

RedBoot> ip_address -h 192.168.1.2
IP: 192.168.1.50/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.2
RedBoot>

load

More details about load can be found can be found here: http://ecos.sourceware.org/docs-latest/redboot/download-command.html
load downloads programs or data to the RedBoot platform. By default RedBoot loads images into some free RAM area which can be addressed later using the variable %{FREEMEMLO}.
-r specifies raw (or binary) data, which also implies that -b or -f must be used.
-b address in memory to load the data. Formatted data streams will have an implied load address, which this option may override.
-f address in flash to load the data. Formatted data streams will have an implied load address, which this option may override.

RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040400-0x801203ff, assumed entry at 0x80040400
RedBoot>

fis create

More details about fis create here: http://ecos.sourceware.org/docs-latest/redboot/fis-create-command.html.
This command creates an image in the FIS directory and obviously, the data for the image must exist in RAM memory before it can be copied. By default, fis create takes the data loaded by the last load command as input for a partition starting at the first free block of the flash space. Important are the values for the RAM address (-r) and entry point (-e), which are linux specific and need to have exactly these values. The partition name 'kernel' is configured within RedBoot (see above) as the default boot partition's name and is of course changeable.

RedBoot> fis create -e 0x80041000 -r 0x80041000 kernel
... Erase from 0xa8030000-0xa8110000: ..............
... Program from 0x80040400-0x80120400 at 0xa8030000: ..............
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>


Load the Rootfs Image

Before loading the root filesystem, we issue fis list and fis free once again:

RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xA8000000 0xA8000000 0x00030000 0x00000000
kernel 0xA8030000 0x80041000 0x000E0000 0x80041000
FIS directory 0xA87E0000 0xA87E0000 0x0000F000 0x00000000
RedBoot config 0xA87EF000 0xA87EF000 0x00001000 0x00000000

RedBoot> fis free
0xA8110000 .. 0xA87E0000

RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-root.squashfs
Using default protocol (TFTP)
Raw file loaded 0x80040400-0x801a03ff, assumed entry at 0x80040400


The information provided by fis free is now used like this:
0xA87E0000 minus 0xA8110000 = 0x6D0000, which is used to create the Root-Filesystem rootfs:

RedBoot> fis create -l 0x6D0000 rootfs
... Erase from 0xa8110000-0xa87e0000: ..........................................
... Program from 0x80040400-0x801a0400 at 0xa8110000: ......................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>


Reset

This time, running reset will boot the Fonera into OpenWrt 8.09.1 ...
RedBoot> reset



Fonera Photos

  • Fonera 2.0 a/b/c (FON 2100)  
  • Fonera 2.0 a/b/c and 2.0 g (FON 2202)  
  • Fonera 2.0 n (FON ....)  
TiffanyScreens 3.0 - a major leap forward
tssn3 TiffanyScreens is a presentation tool that continuously captures the content of the presenter's screen and sends it to multiple other computers at the same time. Best of all, any computer can seamlessly become the presenting computer, no matter if connected wirelessly or through an Ethernet cable.

The User Interface has been refined and many new features like password protected screen-sharing or refresh-rate regulation have recently been introduced to and tested by TiffanyScreens' loyal user base. Most importantly however, TiffanyScreens 3.0 got faster - a lot faster. When installed on Apple's new OS X 10.6 Snow Leopard for instance, TiffanyScreens makes full use of the underlaying 64-bit technology and becomes screaming fast but even on OS X 10.5 or Windows XP, the performance improvement are very much noticeable.
TiffanyScreens 1.x and 2.x licenses continue to work with TiffanyScreens 3.0.
Tomba, the Home Explorer - The Movie
Tom's LEGO NXT 2.0 based Home Explorer uses ultrasound to detect and bypass obstacles.
When driving, the NXT scans the surrounding using its ultrasound sensor. In case it gets too close to an obstacles, the NXT stops, backs-up a little, and makes a random turn (in a pre-defined range), before moving on.
Enjoy the movie, including cool onboard footage.

Motorola droid - 1st Impressions
"I would much rather have gone with Master Luke than stay here with you. I don't know what all this trouble is about, but I'm sure it must be your fault."

The Motorola droid is probably the first 2nd generation Android phone and after playing the the HTC Hero and Motorola Cliq, I now had the chance to take a much closer look at the Motorola Droid.

iPhone Vs. Moto Droid

Connectivity

There are two sockets on the droid, a standard headphone jack, which surprisingly works well with iPhone ear-buts (i.e. on/off switch mutes the mic.) and a mirco-usb data access and charging socket. While I have plenty of mini-USB cables, I didn't have a single micro-usb cable; the one the Motorola has included is short and very inflexible.

Display

The 3.7" WVGA display (480x854 pixels) is impressive but unfortunately Android's UI is not really build for it, at least not yet. The icons (48x48 pixels) appear to be way too small now.

Keyboard

I understand that Motorola put a lot of time and energy in getting the Cliq's keyboard right. Unfortunately, nothing of the teams must not have been talking too each other. The droid's physical keyboard is hardly more useful than its on-screen virtual keyboard and most droid users will not be able to type as fast on the physical keyboards as iPhone users type on the display.

Buttons

The phone has four physical buttons, and four touchscreen buttons just below the display. As one would expect, the physical buttons are the power button which is way too small, tho. A volume rocker, which is on the wrong side (right), and a camera shutter button. The touchscreen buttons the made possible by extending the touchscreen beyond the display and their haptic feedback really rocks.

Camera

The 5MP digital camera is probably the weakest part of the Motorola droid, delivering 5 mega-pixel of noise even when used at best lighting conditions. Some unedited iPhone and Moto Droid shots can be found here: http://www.flickr.com/photos/wolfpaulus/sets/72157604509087860/

iPhone vs. Moto Droid

Conclusion

The Moto droid is most likely the best Android phone currently available and geeks and developers will love it. However, when compared to the iPhone, the droid lacks basic functionally and user-friendliness we are now so accustomed to. If Google really wants to push Android, it needs to continue to develop the basic applications like mail, calendar, etc. to a point where they are at least as good at what Apple includes with the iPhoneOS. Like it or not, the iPhone OS and the included apps are the baseline now and basic everyday Android applications like Mail and Calendar are plain ugly.
Turning the Web on its head - let's have the server call the client
Code Camp is not just for geeks, hackers, and code monkeys; and while you may find some of them at the University of Southern California on November 21 and 22, Code Camp is first and foremost a place for software developers to come together, share ideas and experiences, and learn from their peers.
This will be my 2nd LA Code Camp, which compared to the Code Camp up North at Cal State Fullerton, seems more focused on Microsoft and .net related technologies. However, I'm pretty sure this topic will fill a room: Turning the Web on its head - let's have the server call the client.

We will take the accepted view that a Web-Client calls (via HTTP GET or POST) a server and turn it on its head. Let's have the server call the client. It is really not that far fetched, to imaging a scenario where the server, when it has determined that something exciting just happened (e.g., the Dow Jones Industrial Avg. Index jumped 100 points) calls the Web Client, instead of clients constantly polling the server (even when the DOW barely moves).

Sounds interesting and a couple of implementation ideas may come to mind. After looking briefly into some xml and binary web service protocols, we will take a closer look at the notification mechanism, provided by Java's management extensions and eventually take a really close look at a full featured implementation of the above mentioned problem.
Interestingly, even when looking at both, the client and the server part of this solution, there isn't really all that much code to write, which means that even in the little time we have, all the concept and patterns used, can be looked at and discussed. Honestly, all the code, (client and server) that makes this 'Stock Quote Client' an event-consumer, instead of a stupid poller, will be shown.
Hello AppleTV, you can be so annoying sometimes, .. for a short time
Hello AppleTV, sometimes someone will find you annoying because you happen to do something ... or more likely, because you don't. I don't want you to change something about yourself just because, and you know, we are all annoying at times, and some people are too quick to criticize. Oh, forget about it, enough is enough ... you will get hacked again, NOW!

I have an AppleTV for many months now and even with good tools like Handbrake and the unfortunately discontinued VisualHub, it's really annoying, having to convert every AVI or DivX encoded movie to make it play on the AppleTV. Other then that, it's really a great device which doesn't require much attention.

Meaning the task at hand was to mod. the AppleTV to make it play all sorts of movies, not only those that were encoded in a format that has Apple's blessing. Nothing more, nothing less.

This was accompished easily, as described here: http://wolfpaulus.com/journal/hardware/atvusb.html. However, the most recent two software updates (3.0 and 3.0.1) broke this added functionality, but not for long ...
This AppleTV has only a 40 GByte Harddrive and with hulu removed from Boxee, I didn't see the need to install any other software components.

AppleTV

Patchstick

The 1st step was to enable ssh on the AppleTV. This used to be very hard and required opening the enclosure. Not anymore! The atvusb-creator project (currently at version 1.0b10) describes in detail how to put software onto a USB-Flashdrive that when inserted before the AppleTV boots enables ssh. Again, since Boxee, XBMC, or SoftwareMenu weren't necessary, I happily opted-out.
  1. Download the AppleTV image here: http://mesu.apple.com/data/OS/061-7491.20091107.TVA31/2Z694-6004-003.dmg
  2. Download the ATV USB (Patchstick) generator here:http://atvusb-creator.googlecode.com/files/atvusb-creator-1.0.b10.zip
  3. Insert a USB Drive, this may not work with all drives and the current data will be overwritten; a Kingston 8GB DataTraveler always works perfectly fine for me.
  4. Disable unnecessary tool, before generating the PatchStick, which should take less than 2 minutes.
  5. Insert the Patchstick into the AppleTV and reboot (power down and up) the AppleTV
  6. Wait until the AppleTV booted, remove the Patchstick, and boot again.

AppleTV Patchstick Creation

With ssh now enabled, the rest was done in the matter of minutes. And since I had all the required codecs installed on my Macbook already, the remaining tasks were simply to copy the files over to the AppleTV, to put them into the right location, and finally to reboot the device.

PatchStick

Copy

With ssh available, copying files can be done via scp, or Fugu, or Tranmit, the target location should be the home folder of the frontrow user account: frontrow@AppleTV.local:~
  • ~/Downloads/ATVFiles-1.3.0b1.run.sh (available at http://ericiii.net/sa/appletv/ATVFiles-1.3.0b1.run)
  • /Library/Quicktime/Perian.component
  • /Library/Quicktime/AC3MovieImport.component
  • /Library/Quicktime/Flip4Mac\ WMV\ Import.component .. (optional)
  • /Library/Audio/Plug-ins/Components/A52Codec.component
  • /System/Library/Quicktime/QuickTimeMPEG2.component .. (optional)
  • .. or just copy everything from your Mac's /Library/Quicktime/ folder over to the ATV's

Deploy

Next step was to ssh into the AppleTV and run the ATVFiles installer script and move the components into their final destination:
  • sudo sh ~/ATVFiles-1.3.0b1.run
  • sudo mount -uw /
    (sets the file system to read and write)
  • sudo mv ~/Perian.component /Library/Quicktime/
  • sudo mv ~/AC3MovieImport.component /Library/Quicktime/
  • sudo mv ~/Flip4Mac\ WMV\ Import.component /Library/Quicktime/> .. (optional)
  • sudo mv ~/A52Codec.component /Library/Audio/Plug-Ins/Components/
  • sudo mv ~/QuickTimeMPEG2.component /System/Library/QuickTime/ .. (optional)

Reboot

After rebooting the AppleTV via sudo reboot tools like fugu or transmit work well, copying files over to the AppleTV. When watching the AppleTV, there is now a new menu item, Files, which for instance allows browsing of the frontrow user's home directory structure, the location where movies are best copied to.

If you just want to play a movie every now and then that doesn't happen to be a mov or mp4 file, this is a quick and easy way to make it happen.
While Boxee or NitoTV are much more capable, they also seem to make the AppleTV more sluggish.
Theodore, set free at last

Theodore

Way back in fall 2002, I had discovered Thinlets, which I liked for its lean approach. However, because it lacked tools and extensibility, I couldn't really use it for more serious projects. Still, the concept was intriguing, and while reimplementing it in a more object-oriented and extensible fashing wasn't an option, the least I could do, was to write an editor .. meet Theodore.

After I had written Theodore 1.0, I was even more convinced that Graphical User Interfaces should be described in XML documents that are parsed and rendered into widgets at runtime, a concept which should become known as the declarative UI paradigm. So in January 2003 I founded the Swixml open source project (www.swixml.org) to combine the benefits of Swing (availability of models, extensibility of widgets etc.) with the lean XUL-approach, demonstrated by the Thinlet project.

While my focus was clearly on Swixml, I still kept the Thinled Editor up to date, and eventually released the significantly updated Theodore 3.0 - IDE for Thinlet Developers, which was built with (and shiped with) the classic Thinlet.jar.

Today, Theodore is set free, turns freeware, i.e. there is no freeware editon anymore. The full-featured Theodore 3.0 AP Edition is available for download at http://wolfpaulus.com/theodore/ (the webstart version as been updated as well).
Android Webservice Slides
"After suffering a series of disastrous defeats at the hands of General Grievous, the Republic's foothold in the Outer Rim is in jeopardy. Commissioned to protect the strategic world of Bothawui, Anakin Skywalker and his weary battle group are all that stands between the system and domination by the droid army..."

I have probably never prepared harder for a talk and still felt completely unprepared when presenting at the Univerity of California USC CodeCamp last week. Fortunately, it turned out to be a really great event and I got very posivtive feedback and while I have already started enhancing the presentation for an upcoming event in January, I have also published the slides on slideshare as well as on my side here. Check 'em out if you like.
Sh!t We Like - The nook ebook reader

The nook has arrived

1st impressions of Barnes & Noble's new ebook reader

After being delayed twice, today the nook, Barnes & Nobles eBook reader finally arrived at my doorstep, (literally). The nook came nicely packaged and wrapped, almost iPod-style. After unwrapping it, it took only about an hour to complete charge the already about 70% charged battery. Hooking it up to a WIFI router was extremely easily. The nook discovered the 802.11g router quickly and all I had to do was entering the WPA2 key.

Making ebook purchases is obviously a walk in the park. After setting up an account at B&N's web site, registering the nook is straight forward and only requires the email address registered with the account. Two clicks later and the first ebook was purchased and downloaded onto the device.

However, not all ebook need to be purchased through Barnes & Noble. For instance, I recently bought 'Unlocking Android' at Amazon. The book comes with a free PDF version, which can be copied over to the nook, using the included USB to Mirco-USB cable, which is also needed to charge the device. Anyway, after coping the 10MB PDF document over (happened very swiftly), the document was readable after only a brief moment, required to format the PDF to the nook's screen size.