Tero Karvinen - Articles - Downloads - Courses - Contact

Table of Contents

Bluetooth Connection between Linux and Nokia 6820 Cell Phone

Bluetooth creates a wireless connection between phone and computer, allowing transfer of calendar events, contacts, ringtones and background images. Bluetooth is more practical than wires but less secure.

© 2005 Tero Karvinen

Procedure

Enable bluetooth on phone. Connect USB dongle to computer.

Choose a password (PIN) in /etc/bluetooth. The same password must be set in phone.

# /etc/bluetooth/pin - http://www.iki.fi/karvinen/bt6820/
1234

Pin (password) use must be enabled in hcid.conf. (It was not default in Ubuntu 5.04).

# /etc/bluetooth/hcid.conf - http://www.iki.fi/karvinen/bt6820/
options {
        autoinit yes;
        security user;
        pairing multi;
        pin_helper /usr/bin/bluez-pin;
}
device {
        name "%h-%d";
        class 0x100;
        iscan enable; pscan enable;
        lm accept;
        lp rswitch,hold,sniff,park;
}

Install gammu, the free phone manager similar to gnokii:

$ sudo apt-get install gammu

Setup gammu to use bluetooth. Note that

# ~/.gammurc - http://www.iki.fi/karvinen/bt6820/
[gammu]
port = 00:02:FE:A2:F3:GF
model = 6800
connection = bluephonet
synchronizetime = yes
logfile = /home/tee/.gammulog
logformat = textalldate
use_locking =
gammuloc =

Test connection.

$ gammu --identify
Manufacturer  : Nokia
Model         : 6820 (NHL-9)
[..]

If gammu printed your phone model, it works.

It Works, Now What?

Backup everything

$ echo "ALL" | gammu --backup foo

File suffix matters. That’s why we are using “foo” as a filename here. Because we chose unicode (UTF-8) characters, it is easier to edit the file with vim than nano

$ vim foo

Use “<esc>:wq” to exit vim.

Gammu also allows transfer of calendar or contacts separately. The file suffix (.vcf or .vcs) defines which one is transferred.

If you get multisync to work with 6820, please drop me a line.

Calendar

Backup (download) calendar to computer

$ echo "ALL" | gammu --backup calendar.vcs

Edit it

$ nano calendar.vcs

And restore (upload) it back to phone

$ echo "ALL" | gammu --restore calendar.vcs

The ‘echo “ALL”’ just answers yes to the question “Restore phone calendar notes” or “Backup phone calendar notes”.

To convert between different implementations of calendar standards, use vcalone.

Contacts

Backup (download) contacts to computer

$ echo "ALL" |gammu --backup contacts.vcf

Troubleshooting

Timeout

You have all the settings as above, but phone does not answer.

$ gammu --identify
"No response in specified timeout. Probably phone not connected."

Even more weirdly, gammu logfile shows phone name that it must have got from the phone.

Tue 2006/07/25 18:01:43: Device 00:02:FE:A2:F3:GF ("tero")
[ERROR 14: No response in specified timeout. Probably phone not connected.]

Fix: start bluetooth daemon:

$ sudo /etc/init.d/bluez-utils start
 * Starting Bluetooth services...
 hcid sdpd   ...done.

Now it works:

$ gammu --identify
Manufacturer  : Nokia
Model         : 6820 (NHL-9)

Notes

Configuration files can be printed without comments and empty lines using:

$ cat ~/.gammurc|grep -v '^\s*#'|grep -v '^\s*$'

Test setup: Nokia 6820 (phone), Ubuntu 5.04 Hoary (distro), Billionton Bluetooth (USB Bluetooth dongle). Tested by Tero 2005-09-25

Last modified: 2006-07-25. Permanent url: http://www.iki.fi/karvinen/bluetooth_connection_between_linux_and_nokia_6820.html

Tero Karvinen www.iki.fi/karvinen - Top - Validate HTML - Validate CSS