Bringing your contacts to a Nokia 7110
Dennis GuseI 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.
- Get your address book Export it somehow: I tried Evolution as well as GMail web-interface (both work).
- Get a serial port Setting up the serial port on my Lenovo X60 was not straight forward, but now it works… (Really depends on your hardware)
- Connect to phone Use minicom and check if the phone replies to AT commands
- Configure gnokii
1
2
3
4
5
6
[global]
port = /dev/ttyS0
model = 7110
connection = serial
use_locking = yes
serial_baudrate = 9600
- Use gnokii to read/write your address book gnokii –deletephonebook ME 1 200 gnokii –writephonebook -o –vcard > addressbook.vcf
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python
#encoding=UTF-8
import vobject
import sys
import inspect
#Remove entries except in list for one vcard.
def vcard3_remove_all_entries_except(vcard):
allowedEntries = {'version', 'fn', 'tel', 'categories'}
entries_dict = vcard.contents
for key in entries_dict.keys():
if key not in allowedEntries:
del entries_dict[key]
importedVCards = vobject.readComponents("".join(sys.stdin.readlines()))
try:
while (True):
vcard = importedVCards.next()
vcard3_remove_all_entries_except(vcard)
vcard.add('n');
try:
print(vcard.serialize())
except Exception as e:
print(e)
except StopIteration:
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.