11.26.2008

Parallax Board of Education with Eee PC

I have a Board of Education from Parallax. I use it to program a Basic Stamp 2 microcontroller and perform various experiments in electronics. Today I figured out how to use it with my Eee PC 901. My BoE is has an RS232 port and I have a USB2RS232 adapter, so I can connect the programmer to my Eee PC via a standard USB cable. The adapter is handled by the usbserial kernel module, which is pre-installed to the default system, so I have to just load it as root:

sudo modprobe usbserial


The module creates the /dev/ttyUSB0 device file, but unfortunately the prorammer program looks for the /dev/bstamp device. So I have tweaked with udev to make it properly. I have created a custom udev rule file for this device. For that I have created the file /etc/udev/rules.d/10-custom.rules with this content:
# 10-custom.rules
# My own rules

# for the basic stamp programmer with rs232 - usb converter
KERNEL=="ttyUSB0", SYMLINK+="bstamp", GROUP="users", OPTIONS+="last_rule"

After that I have reloaded the udev rules like this:

udevcontrol reload_rules

And now, when I connect the programmer with thee USB cable, there is the /dev/bstamp device with the proper read/write rigths.
The next step is to install the programmer software. I use the BASIC Stamp Tools for Linux. I have downloaded from their site, and opened the archive. I have compiled the source with make, and installed with sudo make install
To install the proprietary tokenizer library from Parallax properly, I have done this as root:

echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

The previous installation put the tokenizer called libbstamptokenizer.so into the /usr/local/lib directory. These steps make it available for dynamic linking. So now I have two executables installed: bstamp_tokenize compile PBASIC language sourcecode, and bstamp_run download the compiled code to the microcontroller. An example session with compiling and code execution:

> bstamp_tokenize hello.bs2 hello.tok
PBASIC Tokenizer Library version 1.23
> bstamp_run hello.tok
Basic Stamp detected!Model: Basic Stamp 2
Firmware version in BCD = 16
18 characters transmitted
18 characters echoed
18 characters transmitted
18 characters echoed
18 characters transmitted
18 characters echoed
DEBUG OUTPUT: (Press [Control]-[C] to complete sequence)
_____________________________________________________________________
Hello world
Hello world
Hello world
___________________________________________________________________
Received [Control]-[C]!
Shutting down communication!

Success! So now I can use the Board of Education too continue my experiments!

11.22.2008

Flashcard program for Eee PC

I am learning Finnish language, and for that I need a flashcard program. Finnish words are hard to memorize, even though I am Hungarian, and since Hungarian and Finnish are somewhat related, I should learn easier than others, but it is not so. I hope that a flashcard program would help a bit. Earlier I have used kvoctrain on my other computes. I was looking for that program, but I have found, that if I install it from the debian repositories, it will update half of my system, and I do not want that.
Instead I have found that there is a program called mnemosyne. I have fallen in love immediately with its name. (You know, it is a Greek word after the name of an ancient goddess, but it also name of a beautiful butterfly.) It turned out, that it is easy to install this program I had to preinstall these packages from the debian repo: python-pygame, python-qt3, python-xml, memaid-pyqt, and python-setuptools. After that I have downloaded the linux source from the site of the project. I have decompressed, and after that I have installed ad root with the command:
python setup.py install
in the directory of the archive. It had installed without problems and now I can use it. The program works as expected, and I am fighting with words. Hopefully I will learn at least in some extent.

11.14.2008

Online storage services on Eee PC

I have just noticed, that Asus have provided me with my Eee PC 901 also a service called Eee Storage. It means 20 Gb storage on somewhere on a web based file server where I can keep my files and access from anywhere when I have internet connection. The idea is not new nor unknown for me. I have accounts for Box.net and also Dropbox services. I like both of them, since they have their own unique value. I like Box.net because they integrate seamlessly with other web 2.0 programs like Zoho or Facebook. And the best is that they provide accessibility also via webdav, so I can access my files directly from konqueror or any other file manager with webdav support.
I also like Dropbox. They give a client program available for Windows, Mac a Linux. The client connects to the internet storage and syncronizes a directory on the local hard disk and the file server. It means that I can work also offline, and the changes in the directory content is synced whenever next time I have a connection to the net. I enjoy most their directory sharing feature. We have created a shared folder with my father, so when I want to send him files, e.g. our latest family pictures or videos, I just copy them to this local folder, and after a while he can use them also.
So this is my experiences with online storage when Eee Storage came into the picture. I have realized this service just a few days ago, and I have tried yesterday. The size of the storage (20 Gb) is impressive compared to the free Box.net or DropBox capabilities. There is a built in client feature in the default file manager of my Eee PC which is produced by Xandros. Unfortunately I prefer to use Konqueror, but since the access method to the storage is not public (or I haven't found yet), I cannot setup it. The access with the default file manager is intolerably slow. During the first connection it sets up the account for me in the Eee Storage server without further notification. Unfortunately if I want to use the web interface, I have to make further steps to get the user name and password for it. The help in the FAQ of the service is misleading, I do not have the required 16 digits code on the manual of my gear nor the specified directories where I am supposed to do the setups automatically. Instead I have found a shell script in the Eee Storage/Web Storage directory called Account Setup.sh. Clicking on it I was able to provide the user name, password and email address what I wanted to use with my account. So this is not very mature, I have expected more from Asus. Not to speak that after the registration the service have sent me an email in which my user name and password is stated in plain text. I hate this kind of insecure solutions. Finally I was really disappointed with the speed of this service, so I have decided to go back to the other two solutions.
I quickly decided that Dropbox is not an option this time, because I do not want to give local hard drive space for the offline working. Instead I will use my Box.net storage mounted locally with webdav filesystem.
For this I have installed wdfs (and the dependent libneon26 package) as explained here. After that I was able to mount and umount manually the Box.net storage place. To make life easy, I have created two scripts for the task:
mountbox
wdfs http://www.box.net/dav '/home/user/My Documents/Boxnet' -u 'my.email@for.box.net' -p secret_passwd

umountbox
fusermount -u '/home/user/My Documents/Boxnet'

I have created the target dir:
mkdir '/home/user/My Documents/Boxnet'

And I have put the two scripts into the /home/user/bin directory. After chmod u+x *mountbox in that dir the scripts are working like a dream. The service is not particularly quick, but not bad. I can mount, umount the directory, move or copy files from any file manager, or even better, from command line. And that is it. Maybe when I will be out of storage, I will also use Eee Storage.

10.28.2008

PDF readers on Eee PC

Today I have fixed some smaller annoyances on my Eee PC 901 related to the installed Acrobat Reader. First of all, I am not very happy with this reader, on my other computers I use evince wherever it is possible. I like that this stores where I was in the text, so it will open my books where I have left last time. The second thing I like in evince that it can work better in full screen mode. Acrobat Reader show always the full page in full screen mode (correct me if I am wrong), however I prefer page with fit view. On the other hand it seems that Acrobat Reader overperforms evince in case of complex documents with a lot of pictures, just like my favourite Linux Magazine, what I intend to read also on my minilaptop. So finally I have decided to keep both reader program. I will mostly use evince, but Acrobat is kept for the shake of Linux Mag. (Linux diversity rulez!)
The first thing I have done was to get rid of the Finnish internationalization package for acrobat reader: apt-get remove acroread-fi
Then I have installed evince from the debian repository. I have udes this article from EeeUser as a guide. I have added the debian etch repo as explained earlier, evince was installed with apt-get install evince
Of course after that I have disabled again the debian repo to avoid unnecessary complications with the updates.
Finally I have set up in konqeror that evince will be the default programs fo PDF documents and acroread just an option when I cannot avoid it. And that's it! An even more confortable desktop on my Eee PC 901!

10.22.2008

Some more tricks on the desktop of my Eee PC

So I had recognised already in the first days of using my Eee PC 901, that the desktop is composed from KDE programs. Using the Ctrl+Alt+T and the xterm I can start a lot of preinstalled KDE 3 programs. Because of that I thought that it is a real KDE desktop customized by Asus. I am somewhat familiar with KDE since I use it on all my other computers. I started to streamlined the desktop of my Eee PC to make it more familiar. First I have started kconrol, the KDE Control Center. In that I was able to setup the necessary keyboard layouts (Finnish and Hungarian, since I use both in my work) and also some keyboard shortcuts. I was satisfied with this, but when I logged in next time, I have noticed that my settings were disappeared. Today I was hunting for the solution. It turned out, the the desktop is in reality IceWM, so I have created the /home/use/.icewm directory to contain my personalized config files. I have just copied the system wide configs, because mostly I am happy with them:

mkdir /home/use/.icewm
cp /etc/X11/icewm/* /home/use/.icewm

I wanted to start the keyboard layout handler program and the shortcut handler program when starting the desktop, so I have created the custom startup script for icewm: /home/use/.icewm/startup. The content of the file:

#!/bin/sh
/usr/bin/kxkb # KDE keyboard layou handler
/usr/bin/khotkeys # KDE hotkeys handler

Of course, I have made it executble with chmod +x /home/use/.icewm/startup
I turned out, that it does not work as such. The icewm config files are used there, for example I can make the start menu visible by setting the value 1 for TaskBarShowStartMenu in the file /home/use/.icewm/preferences. But the startup script was not executed. I have googled around and have found out, that this is because in the initialisation script: /usr/bin/startsimple.sh icewm is started an inproper way. edited the file as root (sudo -i) and replaced the line
exec icewm
to
exec icewm-session
as recommended in the documentation of icewm, and voilas, everything works like a dream!

10.21.2008

The touchpad of my Eee PC

Today I was playing around with the touchpad of my Eee PC. I works basically well, but I lack a lot the middle mouse button feature. As you know, middle mouse button has a very special function on linux: When you highlight text in most of the programs, it is automatically copied to the clipboard. You can easily paste that text with the middle button anywhere. I am very used to this feature, I use it in command line and also in the OpenOffice. The touchpad of the Eee PC has only two physical buttons, but I want that middle one also. On my old laptop it was the tapping with two fingers mapped to this function, so my goal was to set up the same here.
My first step was to have a look into the config file of X.org: /etc/X11/xorg.conf. I was lucky, I have found the related part there:

Section "InputDevice"
Identifier "synaptics"
Driver "synaptics"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "LeftEdge" "1400"
Option "RightEdge" "5900"
Option "TopEdge" "1400"
Option "BottomEdge" "4500"
Option "PalmDetect" "0"
Option "SHMConfig" "true"
Option "SendCoreEvents" "yes"
Option "HorizScrollDelta" "0"
Option "VertScrollDelta" "155"
Option "RBCornerButton" "0"
Option "RTCornerButton" "0"
Option "TapButton2" "0"
Option "MinSpeed" "0.095"
Option "MaxSpeed" "0.38"
Option "VertTwoFingerScroll" "1"
Option "VertEdgeScroll" "0"
Option "HorizEdgeScroll" "0"
EndSection

I was very happy to see that my touch pad here is using the standard synaptics driver, the same as my old laptop. I was also happy to see those optiion lise, that has hinted me that I can find the right one for my purpose. But what are those options doing? Looking around for some documentation of this driver, I have found that there is a man page for this, so a simple man synaptics command has poured the needed info. I have quickly found that I can map the middle button to the two finger tap by setting the "TapButton2" option to 2. I have edited the file as root and after restarting X (using the Ctrl+Alt+Bakspace key combination) I have now the feature.

10.20.2008

Dictionaries on Eee PC 901

During the weekend I have written I have written my first blog entry using my Eee PC, and I have realised that I lack the spell checker aid of OpenOffice and Firefox. (Shame on me and the gaps in my long ago forgotten grammar studies.) So I have started to find out how to install the Hungarian and English (UK and US) dictionaries for these programs.
For Firefox, it was easy. I have visited the Firefox Add-ons page, and with a few clicks I have installed the necessary files. After restarting firefox, everything was working.
In case of OpenOffice it was a bit trickier. I have found easily the wiki page of the program, so I could download the required packages. But the suggested method, i.e. to use the wizard for the installation didn't work for me, OpenOffice was hanging whenever I tried to open the wizard file (DicOOo.sxw).
Instead I have done this. I have download the zip files. For each languages there are two files in the zip package, for example for Hungarian there is hu_HU.aff and hu_HU.dic. These files were copied into the dir: /usr/lib/openoffice/share/dict/ooo
Affter that I had to update the /usr/lib/openoffice/share/dict/ooo/dictionary.lst file:

cat >> /usr/lib/openoffice/share/dict/ooo/dictionary.lst

DICT hu HU hu_HU # Hungarian

DICT en GB en_GB # British English


DICT en US en_US # American English


Ctrl+D


Obviously these shoulld be done as root in the console, which can be reached by Ctrl+Alt+T and then typing sudo -i
After that when I have restarted OpenOffice, I had spell checker for all these languages.

Latest book I have read: The last theorem

It is the last book of Arthur C. Clarke, one of the best science fiction writers. This book was co-written with Frederik Pohl, another maser of the genre. The main character of this novel is a mathematician, who is successful to give a simple proof for Fermat's famous theorem about the diophantine equations. This book has an interesting structure as it is like a gallery of the sci-fi themes invented by the two author, but mainly by Clarke. We can see the evergreen space elevator, solar sails, powerful super ETs, and and electromagnetic weapon, which is capable to destruct all the electronic tools of the enemy.
Unfortunately some parts were included from earlier novels, like the solar sail race or the heechee like aliens (the Grand Galactics). On the other hand I was very happy with the some kind of happy end feeling of the story, because it pushes the 'we have hope under any circumstances' thinking which is close to me. It was heart breaking to read about the machine stored ethereal life, since Clarke has finished this piece just months before his own death. I hope he is enjoying now his heaven, machine stored or otherwise. This novel is not his best masterpiece, but I am sure that the Clarke fans will enjoy it and remember of this big author of the ever best science fiction themes. R. I. P. Sir Arthur Clarke!

10.16.2008

Adding programs to Eee PC 901

So I am a happy owner of an Eee PC 901 with the original linux (almost Xandros) operating system. Before I have bougth this small laptop, I have read a lot of information, how much tweakable this toy is. So it is, and I have found nice pagen on the net providing the details. Unfortunately almost all the documentations are focused on the first generation Eee PCs (700 and 701 if I am correct), and there were some complains in the comments that applying them has made their 901 model broken. So I has become cautious.
I have learned that Eee PC has an operating system derived from Debian Etch via Xandros 4. However the version on the PC is not fully compatible either with Debian or Xandros, therefore I cannot install anything from those distributions. But I have learned from this that Eee PC uses apt as the package mangment system, which is known to be one of the best such package managers. I am quite familiar with rpm and yum from Fedora, so apt is something new for me to learn.
As maybe many of you know, programs in linux are organized to so called packages, which are compressed archives containing the binaries, libraries and usually the documentation necessary for usage of the programs. Package managers are downloading these packages from repositories, therefore the easy way to install new programs to a system to add the correct repos.
The first thing I have made was to replace the Finnish language repositories to the English one to be able to change the language of the system as I have written earlier. For that I have edited /etc/apt/sources.list file as root:

sudo -i

vim /etc/apt/sources.lost

You can use nano instead of vim if you are not familiar with this text editor.
I have changed the line for the Finnish files:
deb http://update.eeepc.asus.com/1.6/ fi main
to the English one:
deb http://update.eeepc.asus.com/1.6/ en main
After this I have installed several programs and packages with the synaptic program, which is a kind of graphical interface for the apt system.
After this I still had a lot of missings from my favourite programs, so I have decided to cross the dangerous line to install packages from Debian Etch. For this I have added a new entry to the sources.list file:

sudo -i

cat >> /etc/apt/sources.list

deb ftp://ftp.us.debian.org/debian/ stable main contrib non-free


Ctrl+D


After this I have downloaded the list of the available packages with
apt-get update
And intstalled some programs:

apt-get install emacs

apt-get install steghide

apt-get install unison


Since that was all what I needed, I have decided to comment out the debian repo from the sources.list file, so it won't offend the updates. To do this I simply put a hashmark (#) symbol to the beginning of the the offending line:
#deb ftp://ftp.us.debian.org/debian/ stable main contrib non-free
I updated again the package list with
apt-get update
And I am back again to the safe waters.
I have also installed the debian packages for FBReader from their site to have a decent ebook reader. So that is all. Now I have everything I need for my work on the Eee PC 901.

Personalizing my Eee Pc 901

On Tuesday I have got my new Eee PC 901. I intend to use as a replace of my old Acer laptop, which suffered breaks on its hinges. I am living in Finland, so it is not a surprize that my shiny new gadget arrived with a Finnish localized operatin system. Since I know, thet the desktop is a taylored KDE, I thougth, that it should not be a problem to change the language to English, or even to Hungarien, which is my mother tonge. As it turned out, I was wrong.
I turned out, that the kde-i18n packages are not available from standard repositories at Asus, so the most I can do is to swich it to English, since this is the fallback language. I have used info from EeeUser's wikipedia and mostly I was able to do the language change.
The first thing I have made was to install all the available English language related packages from the standard Eee PC repositories. (In another article I will explain it a bit more.)
After this I have changed the value of the LANG variable in the /etc/defaults/locale file from
LANG=fi_FI.UTF8
to
LANG=en_US.UTF8
By this step I was able to change most of the not KDE related messages. I also figured out, that I can disable the KDE i18n mo files in the /usr/share/locale directory this way:

sudo -i

cd /usr/share/locale
mv fi fi_orig
mv fi_FI fi_FI_orig

This way also most of the KDE also become English with a few exception messages. I could not figure out how to force Acrobat Reader to use English, maybe simply because the Finnish version is installed. Probably I should uninstall it and reinstall the English version. At the moment that is the most I was able to do about the topic, possibly later on I will be able to fix the last few Finnish texts.

10.11.2008

My skype for linux hack

I use skype for being in touch with my relatives in Hungary. It is not very unusual, but I do it on linux (actually now on fedora 8). In November of 2007 Skype released the first beta versions of their program for linux, which have supported the video transmissions. I started to experiment immediately, since before that we had really lacked this feature. Unfortunately I have an unsupported Logitech QuickCam Express webcam: ID 046d:0870. This old webcam uses the qc-usb driver, and gives picture format which is not suitable for the skype program. Luckily the trick has arrived soon, with the tool called gstfakevideo I can use the cam for video conferencing. So I had everything together, but there were tricks to be implemented.
First of all, the gstfakevideo is a gstreamer program, which redirect picture from /dev/video1 source and emulate a /dev/video0 device, which is then suitable for the skype. Unfortunately the gstfakevideo is not very flexible, so I had to solve, that the real devise to be created as /dev/video1 device, instead of video0 which is the default. It is possible to do by using a kernel module parameter: video_nr=1. To automate this I put a lint into the /etc/modprobe.conf file:

options quickcam compatible=2 video_nr=1


So it does the trick. Not I have the device file as /dev/video1, but I cannot read and write as a user, so I have to change the rights with the command:

chmod a+rw /dev/video1

I had to do it as root whenever I wanted to use skype with video. Plus I had to start skype with this command:

gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace


Obviously not very convenient, but what is worse, my wife cannot repeat all the steps whenever she wants. So I looked for the simplification.
First I solved the case of the read/write permission of the device file. I have created the file: /etc/udev/rules.d/10-custom.rules and I put into that the following lines:

# for the webcam driver permissions

ATTR{name}=="QuickCam USB", MODE="0666", OPTIONS+="last_rule"


By this step udev now happy to create the device files with the permissions: crw-rw-rw-

Next step was a bit harder: I had to create a small shell script, which will start the gstfakevideo program with the correct parameters, and looks like the skype program. The problem with this, that the skype executable should be in the PATH for the wrapper, but if I will call the script also skype, I will confuse everything which one will be started. I have skype installed under the /usr/local/share/skype directory. The actual executabvle is the /usr/local/share/skype/skype file, and I had a symlink as /usr/local/bin/skype. I have removed the symlink and I have put my script called skype into the /usr/local/bin dir. The content of the script:

export PATH='/usr/local/share/skype/':$PATH
/usr/local/bin/gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace


So nice, now everything works like I want. The skype executable is in the PATH for the gstfakevideo, but for the user the command skype calls the /usr/local/bin/skype, which is the wrapper. And what is even better, when I leave the skype open when log out, the next time I will log in, KDE will start automatically skype, but since in its PATH only the wrapper is available, I will have it with video support!
And great, there is not manual startings anymore, and also my wife can enjoy Skype for linux with video! And again, our parents can see us and our children without manual tricks.