Monday, August 31, 2009

Bluetooth interactive console using pyS60

Nowadays, text messages via mobile phones are shortening to small, but difficult to understand language. I don't think whether the major reason behind this shortening is economic, but most people feel tedious to type text through a 4*3 panel. Typing a program like, C or python in correct syntax is again a tedious work. You can use bluetooth console, in order to avoid this problem effectively. Here I describe how to setup bluetooth consloe communcation in your MS Windows XP platform. For beginners, this procedure may feel ambigous. So I tried my maximum to describe it with screenshots.

If you are not aware of pyS60 please read this.

You can find some other tutorials here:
s60python
nokia wiki
pys60 Library Referance
Yet another tutorial
Lecture

The above links were extremely useful to me. The procedure is repeated here, but I tried to describe it in rather simple way. If you feel any difficulties, please inform me.

Setting up bluetooth interactive console in winXP

step1: Plug your bluetooth device into your PC (any USB port). Then Run your bluetooth driver program which you installed from the CD/DVD when you buy your bluetooth dongle.
Then automatically a serial port is assigned for it. In my PC, it is COM6. You can do step 5 in case you don't know the COM port your PC supported.

step2: Run command 'hypertrm' in your run window. Run window can be opened by clicking Run option from the start menu.

step3:You will get hyperterminal opened like this:

Enter any valid name for your connection and select a suitable icon and forward.

step4:Then you will get another box like this:

Type any 3 digit area code and phone number.Your country or region may be automatically filled. If not, do it manually. Select COM6 from 'connection using' lineEdit tab. It may be changed. You will get which COM port your computer assigned (If you didn't get it, notice first screenshot)

step5:Take your symbian smart phone with pys60 installed. Turn your bluetooth ON and open pys60 application. From 'options' menu, select 'bluetooth console'. Your application then searches for blutooth device. You can optionally select it as your default connection.

step6 (Error Debugging): You are now probably connected successfully. Not yet? Check your connections. Check whether you run your bluetooth driver.If your bluetooth driver is running, a symbol of bluetooth will appear on the panel (see screenshot 1). I used Enter blutooth dongle (part number:E-UBTV) from entermultimedia. and it's driver(BlueSoleil). The driver is downloadable in case you lost the CD/DVD with your dongle. If you can type anythong on the white blank screen of hyperterminal, you are probably done everything. Else, you should check the whole procedure.
In any case, you should plug out the dongle and replug.
Didn't connected yet? Some mysterious powers are playing around you ;-)
I am happy to help if you can't find any way to connect.


step7: If you are successful in connecting your mobile, you are done.

step8:You can do anythong with python. Try these

step9: While you close application, you get a dialogue box and click yes.

You can save hyperterminal settings for the future use. Then when you run 'hypertrm' command, you will get a window like screenshot 2. simply close the box named 'Connection Description' and then you can open the saved file (here, pybluetooth.ht). Again there is an option to save the connection in your mobile and make it as default connection.

Friday, August 28, 2009

Slax- A brief review

Yesterday, I found some good stuff on the official website of Slax (It is a simple but very beautiful distro. Yes, it's build up of KDE). Website itself is very cute and everything is simple as like SUSE or Mandriva. I know some real geeks may not like the entire structure of slax, but it will be stunning those who were allured with Microsoft Windows OSs. The simplicity makes everything easy.
One more advantage is that they give a free 30MB online memory which can be easily be used like ordinary disk drives. The memory of 30MB is free for slax users for unlimited period even if you didn't use it for a long time (The info is from the official blog, the unlimited period may be varied. But they didn't commented about it yet). You can use the online memory from any machines that supports slax, or any other OS, even Windows. A 200MB iso file or tar file is to be downloaded in order to make a liveCD or USB. I installed latest version of slax (slax6.1.2) to my SanDisk Cruizer 4GB pendrive and it works fine. A live CD can easily be created, but to do USB installation, you need to work for 2 minutes.
The whole procedure can be done in your windows platform itself. Try this link.
Another fantastic feature I've seen in their website is to run an application without actually installing on our system known as 'activat'ion. Almost all general purpose applications are available as .lzm binary format which is ready for the installation without any dependencies. You can select which software you want to use from modules page. There are three options - first to download (normal download for later installation), secondly 'add to build' which helps to customize your distro before download. If you want to check whether the software listed is good, just do the third method -activate. Then you can use the software as you have installed it in your system, but actually not.

The major advantage is that it is pocket linux (handy) and can be used everywhere. But personally I felt that it has less hardware support compared to Puppy Linux. But I stil like slax because of it's greenish beauty!

Happy slaxing!

Wednesday, August 26, 2009

Linux Demo? What's the hell?

One of the reason why I love linux a lot is that it has no barriers at all. Many programs usually comes as a demo version which will not not be as much handy as a proffessional or full version. Demo versions seems sometimes nasty, and is too dry to wet out appetite. So I hate the word 'Demo' itself.
But what's going on there is the arrival of "Demo Linux". I just wondered for a while and navigated to the official website.
But I found there is nothing to afraid and found some good stuff. How many of you felt boring while repeatedly installing and formating to find a suitable distro. Live CD's reduces this problem to a great extend. But now this problem is greatly dealt by Pendrives (Memory stick). Demo Linux is specially built linux distro to be alive!. That means there is no need of a hard disk at all. A 32MB of RAM is enough to work with it. Hope it will be useful for those people who loves to be small.
Also read about Puppy Linux Slax and Kolibri

Thursday, August 13, 2009

Resize images in Gimp



Resizing pictures is quite easy and there are several free programs available for this purpose. Resizing images by mouse is quite easy, but here is how to resize images in a professional way. It is quite easy.

Here is two images, one is the resized form of the other. To know the actual size difference, please download these images.

step1: Open GIMP
Applications->Graphics->GIMP in Linux (you can enter command 'gimp' in your terminal window as geeks do)
start->programs->GIMP in Windows

step2: Open image in Gimp

step3: Rigt click on the image and select image->scale image..
step4: Change width and height. If you change any one of them, the other will automatically be changed.

step5: Click 'scale' button

step6: Save yoiur image

Saturday, August 8, 2009

Try Ruby on your browser!

If you are ready to spent a 15 minutes of free time, it's enough to learn ruby. Ruby is Japanese brain and quite easy also. It is famous in its simplicity. You need not install ruby to try it, you can do it in your browser- Not joke!
Just navigate to the official website of ruby.


On the sidebar, you have a wonderful tutorial "Ruby in twenty minutes" to start with. Put a click on "Try ruby on browser" -circled in the above screenshot. Then you will get a command prompt like screen on your browser. Then now ruby is ready to what you want!
If you are beginner, type 'help' on the prompt and hit enter. Then the 'virtual' ruby navigate you through an interactive tutorial which is very useful for beginners. The tutorial takes only about 15minutes.

World's Smallest "Hello World" program

It's quite formal way to start with a "hello world!" program while introducing a new programming language. It is convinient by starting from "hello world" because the program may run properly and is helpful in gaining the confedence. Also it gives a proper output - Prints "hello world!" on the monitor. The programmer becomes happy while seeing this output. Here is a simple "hello world!" program in C.

#include
main()
{
printf("hello world!");
}
//output is
//hello world!


Quite simple?
But I think it is not at all simple. The special characters present in the program really offer some disturbances for the beginner, however a C program is not redundant and it is extreamly powerful.

In Python, I found a much more convenient way.

print "hello world!"


Simple?
It seems good but there is still void to shrink.

Take a look at Ruby,

"hello world"


That's it. I didn't found any void to shrink here. Just put the string you want to print in quotes (" ") and it is pretty easy. But this is not the standard way of printing a string on the monitor, as far as the offcial website of Ruby is concerned. They recommends,

puts ("hello world!)


Then the output will be,

Hello World
=> nil

nil stands for there is nothing to return.

Saturday, August 1, 2009

Introduction to parallel port (LPT) interfacing


Warning!:Usage of parallel port without care may cause serious impact on your PC.

Nowadays programing parallel ports (also known as printer port LPT (DB25 female on the back of IBM type PC) are prone to disappear from newer PC's. But, as far as computer based control engineering is concerned, parallel port is the easy way. So many people stick on parallel port. There are a plenty of programming languages offers convinent control over parallel port by high leve l of abstraction.In order to control things through your parallel port,you need a simple hardware also. Don't need to buy, just build one in your home. Before you dig into parallel port, just know what is a parallel port. If you are confedent that you have some knowledge of parallel port, just skip the links below.

Assuming you acquired basic operation of parallel port. Now let's begin to dig. Here I tried to describe maximum of how to work with parallel port in different systems and different platforms. You can read all of them in posts tagged in Parallel Port.

Read my post on parallel port control using python
Read my post on parallel port control using C/C++