Tuesday, June 29, 2010

USB Serial Adapter Drivers for Chromium

A few weeks ago I downloaded Chromium OS Flow and tried it out on my netbook using a jump drive. I really liked it a lot, although the USB device was slow and had a tendency to stall out. So I pulled out an 8GB SDHC SD card that I had been hoarding and installed Chromium Flow to that. And all I can say is *WOW*. This OS is awesome. It boots (and shuts down) on a dime. The interface is quite slick. And it has a full screen terminal with apt-get and a lot of installable software.

But then I ran into a problem. Lately I have been resetting a lot of router passwords using a console cable (don't ask). To perform this technique, you need a serial port. No laptop or netbook made in the past ten years has a serial port on it so I usually get by with a USB to serial adapter (aka "a serial dongle"). We happen to have one at work, which was lucky. Except it didn't work at all in Chromium.

Long story short ...
1) I had to use gparted on a jump drive to resize some partitions. Chromium Flow is a 2GB "image". So I needed to move some boundaries to take advantage of all that empty space on my SD card.
2) I had to relocate /var/cache/apt. The tiny slice that the directory sits on didn't leave much room for installing software. I moved the directory to /, and then created a symbolic link to it.
3) I installed the build-essential and kernel source (2.6.31) packages.
4) I unzipped the kernel source, turned on all of the USB serial drivers as modules, and then built a kernel.
5) Now I have a little stack of kernel modules for a slew of USB to serial adapters.

I can load it with insmod ./pl2303.ko. If I do a dmesg | tail I can see that it loaded properly. Now when I plug in my dongle, it gets a serial device assignment whereas before all I got was a notice telling me that it was plugged in.

If you are in need of a USB serial adapter driver for Chromium flow, just use mine. This should save you a couple of hours. ;-) You can download the bundle of kernel modules here: http://www.oddree.com/rayhaque/usbserial.tgz

Tomorrow I can fire up minicom and start rocking out Cisco console ports with my little netbook and not have to drag around a 25 pound P.O.S. with Windows XP and Hyperterminal! Hooray!

** EDIT ***
I guess I should tell anyone who might download this how you should use it.
1) Get the file downloaded. From terminal ...
wget http://www.oddree.com/rayhaque/usbserial.tgz
2) Untar/zgip it...
tar -xzvf usbserial.tgz
3) Move the directory into the right place alongside your other kernel modules ...
mv usbserial /lib/modules/2.6.31-4-intel-menlow/kernel/drivers/usb
4) Change to that directory and optionally rename it to what it would normally be...
cd /lib/modules/2.6.31-4-intel-menlow/kernel/drivers/usb/usbserial && move usbserial serial
5) Make the kernel aware that there are new modules out there ...
depmod -a
6) Now, load your module. If you were using the same one as me ...
modprobe pl2303
7) Check the dmesg output for clues as to whether or not the driver is working ...
dmesg

ENJOY! :-)

Wednesday, March 31, 2010

"Too long WEP key" Problem Resolved?

I know many of you using IZ2S have had trouble with getting your Zipit to accept a 128-bit WEP key in hexadecimal format (26 characters).

I may have traced the problem to the use of double quotation marks in the configuration file. It seems that wpa_supplicant assumes that if you are wrapping your key in quotation marks, then it must be ASCII.

I have made some changes to the wifi script which will now ask the user if they are inputting a Hexadecimal or ASCII key. Ideally it would be nice to have the Zipit figure this out on it's own and not even have to ask the user. But I am providing a quick fix for those of you have been struggling with this.

First, you will want to get the latest version of IZ2S which at present is the BETA. If you are all ready running the BETA, don't re-download it. It's unchanged.

http://www.oddree.com/zipit/Z2S-v205-BETA.zip

Then, you will want to grab this new script ...

http://www.oddree.com/zipit/setup-wifi.sh

Put it in /mnt/sd0/bin or the "bin folder" of your SD card. You can replace or overwrite the current file. Then, reboot and choose yes when asked if you want to change your wireless settings. You should get a new question after choosing WEP. If you have a long 26 character key, you should choose "H)exadecimal".

Please post your success and failures to me in the comments area. I can't do much testing here without reconfiguring my own access point (and my wife wouldn't appreciate that too much because she is using it).

Also - sorry for the absence lately. I hope to be back to developing soon!

Friday, February 26, 2010

All New Zipit Z2 Development Kit Released

A while back I had released a virtual machine that included tools that would help folks build software for the Zipit Z2. It was thrown together rather hastily and it became frustrating to anyone who downloaded and tried to use it. Releasing a new version with some fixes include - was long overdue.

You can get the new image here: Zipit Z2 Development V2.torrent
Or here: http://thepiratebay.org/torrent/5392949/Zipit_Z2_Development_V2

NOTE: The seeding is not going as well as I had hoped on this torrent. If you are able, you should forward a port on your firewall/router for your bit-torrent client to use. That will allow you to download from a connection I have set up which is seeding at 300k. Also - if any of you would rather just get a copy of this development kit by mail, I am going to offer that service to you. I will send a disc to anyone in the US for a flat fee of $10. That should cover materials, postage, etc. Just PayPal $10 to donations AT oddree.com. If you would like a copy and you are outside of the US, please email me (ray AT oddree.com) and we can try and work something out. I see there are some Swede's in my seeds. :-)

The release notes are below, but here is a quick rundown ... This was built for VirtualBox and the guest edition tools are all ready installed. Instead of trying to share raw files again (sorry about that) this is being shared as an "exported appliance". Which means you could also use this with VMWare if you wanted to. Also, because buildroot has proven useful in a few areas involving kernel modules, I have included that too.

It's been suggested that I include a few pre-built packages. But not knowing what people will really use this for, I didn't want to "muddy the waters" of an otherwise clean build environment. Rather, I will build some packages of my choosing and then perhaps find a way to share those in a way that you can drop them into your VirtualBox (if anyone is interested?).

If you are having trouble using this, or if you have questions etc. drop me a comment to this post. You can email me too at ray AT oddree.com, but leaving comments is preferable if it's something others might benefit from reading.

RELEASE NOTES:
ABOUT
This is version 2 of the Zipit Z2 Development kit. You can use this kit to compile your own software for use on the Zipit Z2 from Zipit Wireless.

Included is a virtual appliance exported out of VirtualBox v3.1.4. This image should also work with VMWare. However, if you are using VMWare you will need to install the guest tools and possibly remove the included guest tools for VirtualBox.

The image includes a configured and ready-to-use Scratchbox environment and also a buildroot environment that includes a patched Z2 kernel and ALSA (thanks again, GPSFan).

INSTALLATION
Download and install VirtualBox from http://www.virtualbox.org. Click File > Import Appliance and then point to this torrent. Adjust your memory as you see fit (256MB is about as low as you should go - 1GB+ is probably overkill).

After booting up for the first time, you should be auto-logged on as "zipit". This users password is "password" (without the quotes). Note that the root password is also "password" and so you should change those if you are going to attach this device to a network!

MORE INFO
For more information - see the README.txt file on the Desktop of the virtual appliance, and the README.txt in the root of the Scratchbox home directory.

Check out www.oddree.com for more details and post-release notes and linux.zipitwireless.com for more on the Z2 device.

Hack on!
-Ray Dios Haque
February 2010

Thursday, February 04, 2010

Version 2.04 IZ2S Release

You can download IZ2S v2.04 here: http://www.oddree.com/zipit/Z2S-v204.zip

I had originally called this version the "Christmas release". But somehow it ended up being February and I still hadn't done anything new with it. Thanks to the hard work of some other folks, there are some grand changes with this release. In fact, I had little to do with these improvements.

Wicknix has given us the long awaited bash shell. He also gave us a configuration file for links which turns it into a much more usable browser. With the font and pictures scaled down, it's about like surfing the net with a cell phone.

rkdavis has provided an all new busybox binary which includes all the stuff that was left out in the original Zipit Wireless shell. If you are curious and do some digging around you will see that we have a strange way of handling that with the logon script. Basically there is a symbolic link for nearly every command which busybox offers.

Most of the stuff I added to this release will go unnoticed. I rebuilt a few packages, consolidated some things, etc. Some other nice additions include: A new build of centerim which supports ALL IM protocols, the nano editor, the midnight commander file manager, curl, and even a "mostly functional" release of tcpdump!

I plan on the next release being very different. I'm going to take everything I have learned and apply it to a clean installation. That is, I am going to take the original stock shell and begin building the additional packages all over again. This will give me an opportunity to use shared libraries for everything, and loose some of the "bulk" of IZ2S. I'm not sure when that will get released. It may not be for a while. Work is hell right now, and I have a car parked outside begging for my attention.

Also rkdavis seems to be very close to having backlight and keyboard backlight controls working. Hopefully he has that working in time for "IZ2S v3.0". ;-)

Here are the release notes for IZ2S v2.04 ...

IZS - The "Improved Z2 Shell" (aka Shell with Benefits) v2.04

ABOUT
This collection was built by Ray Dios Haque out of sheer necessity. I wanted something that I could play with that would not effect the stock software that comes on the Z2. The easiest way to do that was to take the Z2 Shell that was built by rossimo from Zipit Wireless and expand upon it. I take no credit for the work of the Zipit community. If I don't claim to have built it - it's because I didn't. Thanks to all of you for your contributions over the years. I hope you enjoy my additions!

INSTALL (borrowed from the original README)
Format your SD card as a FAT or a FAT16 file system. Copy everything from this zip file onto the root of the card (preserving all paths/directories). Insert your SD card into the Zipit and boot it up. Note that you can only boot this image if you are running the Stock OS that came with your Zipit. If you have installed OpenEmbedded or Debian, then you have probably replaced the stock operating system which included a routine to look for the z2script.sh script. For legal purposes, I cannot provide you this stock operating system. Some of the smarter people in the Zipit community might be able to help you restore this OS (see CHAT below).

CHAT
Come chat with us! There is a thriving (?) community of the worlds best Zipit hackers who hang out in #zipit on irc.freenode.net. You can fire up 'irc' from this very image and come hang out.

CHANGES/ADDITIONS
RELEASE 2.04 (ALL NEW!) - Christmas 2009
bash (by wicknix, then rebuilt by ray), ~/.bashrc (provides defaults to bash), ~/.links/html.cfg (by wicknix, makes graphical links fit the screen better), centerim-4.22.9 (supports ALL protocols), tcpdump, nano, mc (midnight commander), zip, NEW busybox v1.15.3 (built by rkdavis), curl.

RELEASE 2.03 - Early December 2009
We have sound!! Thanks GPSFan! (alsaconf, alsamixer, alsactl, amidi, aplay, gawk, getopt, iecset), SHARED Library support (ldd, ldconfig, readelf), cmus (a wicked MP3 Player), matrix (ncmatrix), mpg123, mplayer-10rc2, ntpdate, gzip (gzip, gunzip, gzexe, zcat, zcmp, zdiff, zegrep, zforce, zless, zmore, znew), zz (script to run after ssh'ing in - use . zz (dot space zz))

RELEASE 2.02 - November 2009
cls (clear screen), centerim (ncurses instant messenger with AIM, Yahoo, ICQ support), irssi (ncurses irc client), links (ncurses), links2 (graphical browser!), sed (for scripting), tar, bzip2 (bzip2, bz2recover), coreutils (10MB's of binaries)

RELEASE 2.01 - Initial Release
wget, ircii-20090520 (irc), wireless-tools (ifrename, iwconfig, iwevent, iwgetid, iwlist, iwpriv, iwspy), ftp (ftp, /etc/services), unzip (unzipsfx, unzip, funzip), nmap (nmap, *new* ncat), wpa_passphrase, less (lessecho, lesskey), grep

LIBS CHANGES
Removed the worthless ncurses static libs to make way for all of the *shared* libs. Not listing all of them here. Just look for yourself.

STARTUP SCRIPT MODIFICATION(S)
REV 2.04
- Removed the "motd" from this script, since .bashrc displays it now.
- Removed coreutils, as the new busybox does almost all the same things with less space.
- Added a symbolic link script to support all of the additional commands that busybox provides.
- We now use your actual MAC address if available from /mnt/ffs/properties.txt (thanks rkdavis).
REV 2.03
- Stopped audio_pxa from loading, and then run /mnt/sd0/modules/alsa/loadsound.sh for ALSA sound modules.
- Added ntp protocol to /etc/services file.
- Added a line which will fix the time and date if there is a network connection available, and then display that time/date to you.
- From here on out, all libs will go into /mnt/sd0/lib which will be linked to both /lib and /usr/lib/.
- Hid all the gory details of wpa_supplicant, while adding some other stuff for verbosity.
REV 2.02
- Modified the PATH statement so that coreutils and /mnt/sd0/bin binaries will override the busybox stuff.
- Created a home directory for the root user which exists on the SD card. It holds your stuff.
- Added a routine that change your MAC address to something random the first time you boot up. This should prevent duplicate MAC problems if you own multiple Z2 devices.
- Added a /var directory that exists on your SD card. Some things (like dropbear) expect to find it. Had to fix a script error in the BETA (thanks rkdavis).
- Added an /etc/issue file which is displayed at logon time and to ssh connections.
REV 2.01
- Added a routine asking if you would like to configure your wireless card. This was not possible before as there was no scanning routine and the image lacked the wpa_passphrase utility. You can now scan for and configure your wireless settings entirely from the zipit (wording updated in 2.02).
- Added "cp /mnt/sd0/etc/services /etc/services" which gives the ftp command the port numbers it needs to function.
- Added "cp -R /mnt/sd0/etc/terminfo /etc", "export TERM=vt102", "export TERMINFO=/etc/terminfo" to help irc understand the screen layout.
- Added "ln -s /mnt/sd0/lib/* /lib" to make ncurses libraries usable, and any future libraries that you or I might add.
- Added "ln -s /mnt/sd0/share /share" for nmap and anything else that might require a "share" directory to be present to function.

OTHER MODIFICATION(S)
- Replaced the stock keyboard driver in /modules with one that was created by GPSFan (Ken) from the Zipit Yahoo Group. This removed all of the problems with keys not working, or repeating while typing. The original drivers remain, but have been renamed to *.orig.

COMING SOON?
- An *easier to use* mp3 player alternative to cmus (most require network socket support, which the Z2 kernel does not support).
- A script to download and install "packages" (zip files) using wget, unzip, and a "binary repository" on www.oddree.com. A similar system could provide updates when I provide them. I have not worked on this at all. Sorry about that.

IFAQ (InFrequently Asked Questions)
Q. Why are you wasting your time on this? The Z2 Shell is dead!
A. It may be 10x more work to get simple things built for it - the Z2 is very lean, and still very useful.

Q. How can I add my own binary/package?
A. There are several ways to go about this. The method I have used to compile everything is "scratchbox". Scratchbox is a program which let's you cross-compile applications. That means that you can build stuff for an ARM platform, even though you have a regular x86 machine. It can be tricky and complicated. Try reading up on what I have posted at http://www.oddree.com.

Q. Why did you *insert snarky comment here*?
A. If you find that I did something stupid and inefficient, do let me know. I don't claim to have any expertise in the area of building software. If you have some suggestions on how to improve things or would like to help with the next release of this improved Z2 Shell, email me at ray@oddree.com. I would love to collaborate with some folks who might be more talented than myself.

Q. Will you build *insert package name here* for me?
A. Probably. Unless you are asking me to build something that has an endless list of dependencies. In which case I will probably tell you to install OpenEmbedded or full fledged Debian. They all ready have all of these packages. I am only expanding upon the old Z2 Shell because I find it lean and useful.

Sunday, January 24, 2010

Still Alive!

I just wanted to drop a few lines and assure everyone that I am still very well alive. A couple weeks ago now I was putting the finishing touches on the next release of IZ2S when all hell broke loose just about everywhere. It's been a very, very, busy past couple of weeks at work. I have been battling new projects, old projects, phones ringing off the hook, upgrades gone sour, lost support, you get the idea.

Meanwhile, my car has been acting up. I have had some trouble getting the old VW started lately so I replaced the battery. That seemed to work for a day or two, and then I was right back to same issue. And so last weekend I replaced the starter. Let me tell you, this was NOT an easy task. In the process of working on the starter it appeared that I was leaking something. Oil? Gas? Of course I was laying in the wet street and I had some dirty old compacted snow stuck to my underbody. Once everything had dried out, it looked like I was in good shape.

A day or two later I was barreling down the road when my green dash light came on. Suspecting *another* electrical problem I got out the old multimeter and began testing my voltages. It appeared that my generator was putting out enough juice, and my battery was getting charged. Perhaps my voltage regulator was allowing too much juice through? I was getting about 17v to the battery, and that didn't seem right. Then as I was leaving work on Thursday my engine just stopped. And I mean, it stopped HARD.

That's when I realized that the green light on my dash wasn't an electrical problem at all. It was the "low oil" light. I did have a leak! I have seized my engine. Could this week get any better?

I tried a few quick fixes to try and get the car home, but I ended up having to pull out my AAA card and get it towed to my house. And now, I just wish it would stop raining long enough that I can pull my engine and get it into my basement. Of course, I will be doing all this while laying in the gutter on a busy public street because I don't even have a driveway for my house (let alone a cozy garage to work in).

So anyway, I am alive. And I miss developing for my Zipit. I hope to be able to get back to it soon.

Wednesday, December 16, 2009

Restoring your Zipit Z2 to Defaults

A while back I bought my daughter a Z2 for Christmas. We got it off of eBay and my wife asked that I test it to make sure it works. About ten minutes later I realized that I had registered the device with Zipit Wireless using a nickname of my choosing. In effect, I just made this Zipit my own. But what if I wanted to "gift" this Zipit or sell it?

Quite simply, all you need to do to make a Zipit Z2 new again is to remove a few configuration files. You can do this using either my IZ2S, or even the vanilla Z2 Shell.

Boot up with your shell, and then do a "cd /mnt/ffs" and an "ls" to list the files there. You will see something like this ...

-rwxr-xr-x 1 root root 657 Dec 16 01:58 411.xml
-rwxr-xr-x 1 root root 112342 Dec 16 01:58 NeonGlow.jpg
-rwxr-xr-x 1 root root 1519952 Dec 16 01:58 Resources.arl
-rwxr-xr-x 1 root root 3578680 Dec 16 01:58 Zipit2
-rwxr-xr-x 1 root root 1921 Dec 16 01:58 properties.txt
-rwxr-xr-x 1 root root 4644 Dec 16 01:58 serversettings.xml
-rwxr-xr-x 1 root root 4644 Dec 16 01:58 serverstationz.xml
-rwxr-xr-x 1 root root 510 Dec 16 01:58 start.sh
drwxr-xr-x 2 root root 4096 Dec 16 01:58 wpa_supplicant


Only a few of these files are really required, and the rest are files that get downloaded from Zipit Wireless when your Z2 connects up to their servers through the wireless network.

You can safely remove these files:
NeonGlow.jpg - This is my chosen background wallpaper. Whatever you picked will have a .jpg extension. You can delete any .jpg file here.
properties.txt - This file contains your device ID (serial number), your username, and some other important settings. Deleting this file removes your Zipit Wireless account association.
serversettings.xml - This file contains a record of your messaging limit(s), your chosen wallpaper, and some radio station data.
serverstationz.xml - This file seems to contain the same data as "serversettings.xml". Both files can be deleted and would be recreated when you connect with your Zipit Wireless account.

DO NOT REMOVE (or alter) THESE FILES!
Resources.arl - This is some sort of archive which likely contains data for your theme. Although it's compressed, and I don't know how. Leave it alone.
Zipit2 - This is the core application for the Z2. Do not alter this file, or your Z2 will no longer be any fun.
start.sh - This short and simple script is what allows for you to run a shell, as it looks for an OS on your SD card at boot time. It also runs the Zipit2 application. Leave this alone!
wpa_supplicant - This directory contains an executable of the same name. This is what connects the Z2 to your wireless network. Leave this alone too!

Just to recap ...
If you want to make your Zipit "new again", you should delete your settings files so that your /mnt/ffs directory looks something like this ...

-rwxr-xr-x 1 root root 1519952 Jan 1 1970 Resources.arl
-rwxr-xr-x 1 root root 3578680 Jan 1 1970 Zipit2
-rwxr-xr-x 1 root root 510 Sep 17 2007 start.sh
drwxrwxr-x 2 root root 0 Sep 17 2007 wpa_supplicant


The next time you boot your Z2 (without the SD card inserted) you will get the "first time wizard". By the way, in case you forgot - one of your options in this wizard is to enter the credentials for your existing account.

Tuesday, December 15, 2009

Links2 (Graphical Web Browser) for the Zipit Z2

This is links2 compiled along with directfb to provide a graphical web browser to the Zipit Z2 Shell.

You can download it here: http://oddree.com/zipit/links2-zipitz2.zip

Note that if you get the latest IZ2S image from this site - you will not need this program because it is all ready included by default. This is just provided for folks who want to experiment with the Z2 Shell in it's unadulterated, and naked form.


Here is the included README ...
** Links2 built with graphical directfb support **
** for the Zipit Z2 Wireless device **
** by Ray Dios Haque **

ABOUT
This is links2 built with graphical support for
all of the popular image types (png, jpeg, gif).
It utilizes directfb as a graphical driver, and so
there is no need for X11! This tooks weeks to get
running correctly. So I hope you enjoy it. :-)

Remember - this is a very basic web browser. While
you can do fun things like read blogs and check your
email, watching videos and running Flash is just out
of the question!

INSTALL
Copy everything in the bin folder, to the bin folder
on your SD card. That's it. Keep in mind that this
package is now part of the "Improved Z2 Shell" which
is available from www.oddree.com.

USING LINKS2
To start links2 in graphical mode, just run 'links2'
inside of terminal. This will actually run a script
which launches links2 along with some special and
required parameters (such as the screen rotator).

To visit a web page, press the letter "g" and then
enter a URL. To move around on the page, you can
hold down ALT and SHIFT (white up arrow next to ALT)
and then use your arrow/navigational keys to move
around the page. When running links, you are using
a special keymap that aliosa27 created. When you
exit links, your original keymap is reloaded.

NOTE: You can still run links in text mode, simply
by running 'links' (without the 2).