Saturday, August 7, 2010

Illustrated Guide to Syncing Blackberry on Ubuntu Karmic

The reason why i decided to write this post was the lack of a complete and comprehensive guide on achieving syncing of Blackberry on Ubuntu.

This article is not intended for Uber geeks but instead for dummies like me. I have tried to make the article as illustrative and self explanatory as possible.

Requirements : An internet connected (only for installing required software packages) Linux Box running Ubuntu 9.04 (Karmic Koala) , Blackberry (8400g in my case) and a working data cable. I assume that the user has got atleast some working level knowledge of linux in general and is not bamboozled by terms like Synaptic, Evolution, Terminal, sudo et al

Step 1: Installing necessary Packages.

Use Synaptic and install following software packages.

multisync0.90 , barrybackup-gui, barry-util,libbarry0,opensync-plugin-barry,opensync-plugin-evolution,multisync-tools

Alternatively you can install them from command line

sudo aptitude install multisync0.90  barrybackup-gui barry-util libbarry0 opensync-plugin-barry opensync-plugin-evolution multisync-tools

Step 2:  Connecting Blackberry

Connect blackberry to your computer using the compatible data cable and fire up terminal. We will check whether the computer detects the device or not. Note down the device pin.
sudo btool -l

Screenshot-1

Step 3: Backing up the Blackberry

Fire up your terminal and execute the barrybackup . Once opened it will prompt you for entering your device name. Enter the device name and Click Ok

Screenshot-1

Screenshot-3 Screenshot-4

Step 4: Configuring Multisync for Syncing Contacts

Open Application->Accessories->Multisync-gui

Screenshot-multisync0.90Screenshot-multisync0.90-1 Screenshot-multisync0.90-2

The initial screen is blank. Click Add to create a new sync group. I have named the group as Blackberry-Contacts. Click Edit to add members to this group. Remember to add Evolution plugin  first and then the Barry plugin. Not vice versa. My setup is erroneous

Screenshot-7

Once you have finished you will have two members on the left hand side pane. evo2-sync and barry sync. Click on evo2-sync member and we shall configure its properties. Select address book of your choice. I have made a blank address book in Evolution and named it as blackberry. Select No Calendar and No To-do as this group will sync only contacts.

Screenshot-multisync0.90-4

Click on barry-sync member and on the right hand side pane you will see a text pane enumerating some setting. Don't worry. just scroll down to the place where it says Device pin and update your device pin there. The default device pin reads 204ad4e8 . Update the pin. There are 2 more digits ahead 1 0 change them and make them 0 and 1. The 1 is enable and 0 is disable. The first 1 is for calendar syncing and the second 1 is for contact syncing. So since we are only going to sync contacts and not calendar we amend the setting to 0 and 1

So the final line reads as thus Device 3009efe3 1 0. Don't  worry about the save option the file is saved auto-magically. Close the Window

Screenshot-multisync0.90-5Screenshot-multisync0.90-6

Now you will see following window. I am repeating again. My setup was erroneous. If you have followed the steps properly you will see the evo2-sync member above the barry-sync. In case you land up in a situation just like me. Just Remove and configure again. Its simple.

Step 5: Syncing Contacts

Screenshot-multisync0.90-7

Click Refresh and you are done. The sync process will start . It takes a couple of minutes

Screenshot-multisync0.90-8 Screenshot-multisync0.90-9 Screenshot-multisync0.90-10

Viola!! Your contacts are synced.

Step 6: Configuring Multisync for Syncing Calendar.

The steps for configuring Multisync-gui are similar to those we took for contacts .  Make a new group Blackberry-Contacts. Add evo2-sync member first and barry-sync member next. Click on evo2-sync member and we shall configure its properties. Select Calendar of your choice, select local calendars preferably at first. Select No Address Book and No To-do as this group will sync only calendar.

Screenshot-multisync0.90-11 Screenshot-multisync0.90-14

Click on barry-sync member and on the right hand side pane you will see a text pane enumerating some setting. Don't worry. just scroll down to the place where it says Device pin and update your device pin there. The default device pin reads 204ad4e8 . Update the pin. There are 2 more digits ahead 1 0 change them and make them 1 and 0. The 1 is enable and 0 is disable. The first 1 is for calendar syncing and the second 1 is for contact syncing. So since we are only going to sync calendar and not contacts we amend the setting to 1 and 0. My Setting is wrong

Screenshot-multisync0.90-6

Close the windows and you are ready to sync the calendar now

Screenshot-multisync0.90-15

Step 7: Syncing Calendar

Click refresh and your calendars are being synced. Following screen shots illustrate the process.

Screenshot-multisync0.90-19 Screenshot-multisync0.90-18

Screenshot-multisync0.90-20 Screenshot-multisync0.90-21

Thats all…..time you have to sync… Just connect your phone and fire up Multisync-gui and click refresh.

Hope this guide was useful.

Monday, April 5, 2010

How to make your own IR Receiver.. Remote Control Your PC

This post will describe how I made my own remote control receiver.. like in a costly desktop PC. Believe me its extremely easy and dirt cheap to make less than Rs 50

This post is divided into 2 parts
Hardware and Software

Lets get going..

Hardware
Bill of Material

IC 78L05 5V Volatage Regulator
1N4148 Zener Diode
4.7K resistor
4.7uF capacitor ceramic
IR receiver TSOP
DB9 Serial Port Connector
Any remote control... even your music system remote/tv remote will work
Circuit Diagram

Solder the circuit as per the diagram

End products looks like this (trainees are advised not to learn the bad soldering/electrical hygiene techniques I have demonstrated)






Software Part :Linux

Now getting to the second part of the deal.. getting the stuff working in linux

My test platform :
Ubuntu Jaunty Jacklope +9.04, 2.6.28-16-generic running on
AMD 64 X2 Dual Core Processor 4600+,2GB RAM, 2x120 GB,Flatron W2242T

Software required:
Ensure that you are connected to net , Fire up your terminal and punch the following commands
sudo aptitude search lirc

type follwing to install lirc with its dependant packages
sudo aptitude install lirc lirc-x

..to be continued

Decode AIS String using PHP

This is for all who may want to decode an AIS String but never knew how to do.

For all who don't know what is AIS.. try this link
http://www.imo.org/Safety/mainframe.asp?topic_id=754
http://en.wikipedia.org/wiki/Automatic_ ... ion_System



this code is tested for type 1 messages and further development has been stalled. I had just coded it in my free time on ship. It is scripted in PHP. but you may adapt for c++ or VB.

100% original
//code to decode ais messages
/*
? Receives a broadcast message,
? Organises the binary bits of the Message Data into 6-bit strings,
? Converts the 6-bit strings into their representative "valid characters" – see IEC 61162-1,
table 7,
? Assembles the valid characters into an encapsulation string, and
? Transfers the encapsulation string using the VDM sentence formatter.

sample message
!AIVDM,1,1,,A,1P000Oh1IT1svTP2r:43grwb0Eq4,0*01

*/
$ais = "1P000Oh1IT1svTP2r:43grwb0Eq4";
$aisdata168=NULL;//six bit array of ascii characters
$ais_nmea_array = str_split($ais);
foreach ($ais_nmea_array as $value)
{
$dec=ascii_2_dec($value);
$bit8=asciidec_2_8bit($dec);
$bit6=dec_2_6bit($bit8);
echo $value ."-" .$bit6 ."
";
$aisdata168 .=$bit6;
}
echo $aisdata168 . "
";

echo "mmsi= " . bindec(substr($aisdata168,9,29)) . "
";
echo "cog= " . bindec(substr($aisdata168,116,12))/10 . "
";
echo "sog= " . bindec(substr($aisdata168,50,10))/10 . "
";

function ascii_2_dec($chr)
{
$dec=ord($chr);//get decimal ascii code
$hex=dechex($dec);//convert decimal to hex
return ($dec);
}

function asciidec_2_8bit($ascii)
{
if ($ascii<48){}
else
{
if($ascii>119){}
else
{
if($ascii>87 && $ascii <96){}
else
{
$ascii=$ascii+40;
if ($ascii>128){$ascii=$ascii+32;}
else{$ascii=$ascii+40;}
}
}
}
return ($ascii);
}
function dec_2_6bit($dec)
{
$bin=decbin($dec);
return(substr($bin, -6));
}