493: Undecipherable



-About me-


Bringing your contacts to a Nokia 7110

Dennis Guse

I just needed a new phone and decided to go for cool solution: Nokia 7110 (v4.84). I got one including serial data cable + dock and the only thing missing was: how do I get my contacts on the phone without typing?

The answer was quite simply: export your address book as vCard and send it to the phone via gnokii on an Ubuntu.

2port = /dev/ttyS0
3model = 7110
4connection = serial
5use_locking = yes
6serial_baudrate = 9600

The Nokia 7110 has a bug: the vCard-parser is broken... So, I needed to fix my addressbook: basically remove all not needed data (emails, addresses, birthdays etc.). I implemented a small python-script using vObject.

It reads from stdin and writes to stdout:

cat addressbook.vcf | python script.py

 4import vobject
 5import sys
 6import inspect
 8#Remove entries except in list for one vcard.
 9def vcard3_remove_all_entries_except(vcard):
10   allowedEntries = {'version', 'fn', 'tel', 'categories'}
11   entries_dict = vcard.contents
12   for key in entries_dict.keys():
13       if key not in allowedEntries:
14           del entries_dict[key]
16importedVCards = vobject.readComponents("".join(sys.stdin.readlines()))
18    while (True):
19        vcard = importedVCards.next()
20        vcard3_remove_all_entries_except(vcard)
21        vcard.add('n');
22        try:
23            print(vcard.serialize())
24        except Exception as e:
25            print(e)
26except StopIteration:
27    None

Sync with style:

cat contacts.vcf | python import.py | gnokii --writephonebook -o --vcard

And a tutorial to clean the Nokia 7110 can be found here.