Tuesday, December 26, 2006

OpenPCD application

Wrote my second OpenPCD application, now my KDE desktop can be locked-unlocked using my OpenPCD board.
Tarique asked for adding some more lines with this.
For this code again taking help from Harald's librfid-tool.c in the utils directory of the librfid source. The main idea is to show how OpenPCD can be used. First I was looking for a way to keep unlock my laptop as my OpenPCD card is near to the OpenPCD reader & as I(the card) move away from the reader it should get unlocked automatically,, which it turn produced my first application.
Last night found a simple way to do that with dcop.

dcop kdesktop KScreensaverIface lock
dcop kdesktop KScreensaverIface quit

The first line will lock your KDE desktop & the second one will unlock it. Still don't understand makefiles well, tried to avoid any more dependencies in the code thus calling these two commands as need using system().

Friday, December 22, 2006

csv module

There is a csv module in python :)
You can use it like:

import csv
reader = csv.reader(open('details.csv', 'r'))
for row in reader:
print row

Tuesday, December 05, 2006

My first C code

Well, I can say that this is my first C code :)
Milosch gave me the idea to write a small application which can detect openpcd cards and unlock the computer. So, I started with easier target & now my openpcd board can login in any (username,password) based system(tested with different browsers still now). The code is in very early stage, and I put every thing manually(not dynamic at all).

Sunday, December 03, 2006

OpenPCD Hack day 2:

Day two finished. A more eventful one. Milosch bought a basic electronics book for me so that I can understand the basics :)
Then we went to SP Road to buy the equipments. Again Milosch bought all of them for me.

Here is the set.

Then my first work. A single LED :P

At the end Milosch made a piezo speaker system for the openpcd board, and we made few changes to build a new firmware (main_piezo) which can make a 10sec noise at the speaker system.

Can you find the speaker in the above picture ? :P

Friday, December 01, 2006

openpcd hack..

So, the best thing this time in foss.in is the starting of my embedded work. Openpcd is a nice work from Milosch, Brita & Harald.
Yesterday from 4pm me & Milosch was trying to make my laptop configured properly so that I can start wokring on the openpcd board that Milosch presented me :) And it took 8 hours (with 2 hours for dinner) to fix it. Now it is a only 3 minute job.
So, here is the procedure:

First make sure that you do a modprobe usbserial.
Now first I am going to fix my laptop as the host:

tar -xjvf librfid-1929.tar.bz2
mv librfid librfid.host
cd librfid.host/
mcedit src/Makefile.am //////delete -lopenct from there
./configure --without-openct --prefix=/usr/local/openpcd
su -c "make install"

Now I have to fix my librfid for the firmware:

tar -xjvf librfid-host.tar.bz2
cd ..
tar -xjvf openpcd-firmware-274.tar.bz2
find firmware -exec touch \{\} \;
cd host/
ls -l
cd ..
tar -xjvf librfid-1929.tar.bz2
mv librfid librfid.firm
cd librfid.firm/
export CFLAGS="-I/usr/include -DLIBRFID_FIRMWARE"
export CC=arm-elf-gcc
export PATH=/usr/local/gnuarm-4.0.2/bin:$PATH
./configure --without-openct --host=arm-elf --with-firmware=/home/kd/build/openpcd/firmware
cd ../firmware/
mcedit Makefile (((((((((((((((Please point LIBRFID to the correct directory))))))))))
make DEBUG=1 BOARD=PCD TARGET=main_reqa
ls -l
su -c "/usr/local/openpcd/bin/dfu-programmer openpcd dfu_dnload main_reqa.bin"
su -c "/usr/local/openpcd/bin/dfu-programmer openpcd dfu_dnload main_reqa.bin"

And it is done..
My first experience with good C :P

No job..

I am jobless .... :)