Friday, January 16, 2009

Dictionary for English -Sinhala and Sinhala-Engliish for stardict


Stardict is both static and scanning dictionary. Nice thing of stardict is, it does not depend on the application which the text is contained (eg: ensitip works only in firefox).
1) install stardict
apt-get install stardict
2) setting up Sinhala-English English-Sinhala dictionary
download the dictionary file from www.sinhalenfoss.org.
extract the compressed file to /usr/share/stardict/dic
tar -xzvf sinhala-stardict-120908.tar.gz -C
/usr/share/stardict/dic
3) configurations
stardict will be available in 'Accessories' sub-menu start it.
Click the small button at bottom right corner of the dictionary window.
Chose a suitable key for scan modification there. otherwise stardict will scan all the time when you select a text.
4) You can also download many other dictionaries at http://stardict.sourceforge.net/Dictionaries.php,http://stardict.sourceforge.net/Dictionaries_dictd-www.dict.org.php
Oxford Advanced Learner's Dictionary is a good one for English-English.

Sunday, January 11, 2009

SMS gateway with kannel and your mobile phone (Ubuntu intrepid)

Kannel is a gateway for connecting WAP (Wireless Application Protocol) phones to the Internet. It also works as an SMS gateway, for providing SMS based services for GSM phones. Bellow is my configuration of kannel as a SMS-gateway

1) apt-get install kannel
2)copy /usr/share/doc/kannel/examples/modems.conf to /etc/kannel/ to include in kannel.conf
3)Backup /etc/kannel/kannel.conf ( mv /etc/kannel/kannel.conf /etc/kannel/kannel.conf.bak) and create a new file /etc/kannel/kannel.conf with following configuration:

group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
log-file = "/var/log/kannel/kannel.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "127.0.0.1"


group = smsc
smsc = at
modemtype = auto
device=/dev/ttyUSB1
my-number =
connect-allow-ip = 127.0.0.1
log-level = 0


group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
global-sender =
log-level = 0


group = sendsms-user
username = kan
password = abc
concatenation= true
max-messages = 10


group = sms-service
keyword =
keyword-regex = .*
catch-all = yes
max-messages = 0
get-url = http://localhost/sms/inc/getsms.php?user=john&passwd=1234&mobile=%p&text=%a

include = "/etc/kannel/modems.conf"


4) in above configuration put your phone number in the place of and change the password and username under group = sendsms-user
5) Change device=/dev/ttyUSB1 to your device (eg: /dev/ttyS0, /dev/ttyACM0 ). I'm using huawei E220 in my case and using /dev/ttyUSB1 for sms-gateway and to access Internet I use /dev/ttyUSB0.
6) Now configuration is almost done... now you can test your configuration with starting the gateway with following commands. It will return the errors to the terminal.
bearerbox -v 0 smskannel.conf &
smsbox -v 0 smskannel.conf &

7) I you have problem with opening your device (eg: /dev/ttyUSB1) try changing the permissions for that device with chmod a+rw /dev/ttyUSB1
8) By default kannel will start at the boot time, so it is better you have plugged your device while booting otherwise kannel will try to probe the device continuously until you plug the device or stop kannel (to stop use '/etc/init.d/kannel stop' ).
9) kannel is configured to start as WAPBOX by default... to make it start as a SMSBOX (sms-gateway), edit /etc/default/kannel and put 'START_SMSBOX=1' instead of 'START_WAPBOX=1'
10) To send sms using terminal use following command:
lynx -dump "http://127.0.0.1:13013/cgi-bin/sendsms?username=kan&password=abc&to=[recipient no]&text=[text]"
* It is easy to write an application with php like serverside language and provide a web-gui for kannel. You can find a simple web front end for kannel here.

following link will provide brief descriptions for kannel.conf settings;
http://swik.net/User:marc/Chipmunk+Ninja+Technical+Articles/Setting+up,+Configuring,+and+Using+Kannel+to+send%2Freceive+SMS+messages/3e0s

Usefull links:
http://www.kannel.org/

http://kannel.jizz.gr/

User's guid






Thursday, January 1, 2009

Installing TinyOS-2.x in Ubuntu intrepid (8.10)

1) add bellow repository to your /etc/apt/sources.list though it is for hardy, it is working for intrepid also

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu hardy main

2) with following commands you can update the apt-cache and search the required packages thin you can install the required version and all.

apt-get update
apt-cache search tinyos
apt-get install tinyos-2.1.0

3) then install python development package (headers)

apt-get install python-dev

4) Edit /opt/tinyos-2.1.0/tinyos.sh and change the CLASSPATH env-variable as bellow

CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:.

4) Import /opt/tinyos-
2.1.0/tinyos.sh in your .bashrc; include bellow code snippet to ~/.bashrc

if [ -f /opt/tinyos-
2.1.0/tinyos.sh ] ; then
. /opt/tinyos-
2.1.0/tinyos.sh
fi

5) Now execut bash again or restart the terminal and chech your enviorenment with bellow command. It will check the enviorenment and report you the status. (Ignore the WORNING returned due to graphvis version)

tos-check-env

6) Lets compile the first application

cd $TOSROOT/apps/Blink
make micaz

for simulator

make micaz sim

have fun!~

Intel Corporation XMM7360 LTE Advanced Modem in ArchLinux

The required packages are available in ArchLinux User Repository (AUR) so it will be easier if you can use an AUR helper package like yay . ...