Mobile phones


GSM (Global System for Mobile Communications was the second generation and got some evolutionary expansions as the General packet radio service (GPRS) for digital communications.GSM900/1800 refers to the frequencies (900MHz and 1.8GHz) used in Europe and other parts of the world (except North America, where my old Nokia phone really remained silent). Some countries have started to switch of their 2G networks, so older phones will become useless.Other protocols used in G2 are: EDGE, HSCSD

Data rate <0.2Mbit/2


3G means the 3rd generation mobile telecommunications project and their standards that should have brought harmonization into the world, so our G3 phone should also work outside your country.

Universal Mobile Telecommunications System (UMTS) got introduced with G3 phones.

Data rate <0.39Mbit/s (UTMS)

An other protocol used in 3G is HSPA taht boosted up data rate to <7.2Mbis/s and with HSPA+ to <42Mbit/s


With G4 LTE got introduced with data rate <150Mbit/s. (G4+ uses LTEadv with a datarate <450Mbit/s). G5 is expected to bring 1Gbit/s

Dial up

If you are lucky than it is just a serial to USB converter inside the cable. So connect the usb cable to the PC and observe what lsusb or usbview see. Then cd /usr/src/linux and check with make menuconfig if you find a corresponding USB Serial Converter (Windows mobile devices require the ipaq driver). If necessary compile the kernel with the missing driver.

If you plug in the mobile you should get the /dev/ttyUSB0 file. Now start a terminal application as gtkterm and select the port with baudrate of 9600 and no handshake. Make sure your gsm supports a serial connection and type at after that then phone should response with OK. Or better send at&f to reset it to factory defaults. On Nokia phones type ati3 to see your nokia model. Or type atd<a phone number>; to make a audio call. If this works then the connection is fine and the next step is setting up the software.

To use the phone to connect to the internet via you need a kernel with PPP support see and kernel settings as:

USB Serial Converter support

<*> USB driver for GSM and CDMA modems

To dail up to a gsm network emerge wvdial and make sure the PPP useflag is set. To use wvdial a config file is required:

[Dialer Defaults]
 Modem = /dev/ttyUSB0
 Phone = *99#
 Username =
 Password =

For password and user name check your provider, but it is likely that the strings are empty. The providers like your money and not your passwords. /etc/wvdial.conf and ~/.wvdialrc hold defaults. but can be created with wvdialconf /etc/wvdial.conf

Then it can be called as wvdial -C<my config>.txt

Connections using 3G phones

Phone connections are not free, therefore dial up and download will be too expensive and slow to many applications. It might be a good investment to buy a new phone and have the money in a new hardware piece and not in high telephone bills.

Plug in a modern USB phone might result in a additional Ethernet connection. Check it with udevadm monitor and/or see what is going on with the udev rules in /etc/udev/rules.d/70-persistent-net.rules

# USB device 0x0bb4:0x0b5f (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="80:00:60:0f:e8:00", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

The phone can be accessed via eth1, this can be the hard way or using networkmanager. To have it working, the phone must be setup to connect to the right 3g network on one side and to use usb on the other side.

The phone may have different operating modes to usb, as acting as external drive to have access to the memory card. Therefore it is important to have the right setup.

For 3G phones, bluetooth can be taken as alternative to usb to make an Internet connection.

To see what is supported via usb type lsusb and check the device number. Then lsusb -s <node number> -v | grep bInterfaceProtocol pops up the protocol. Picture Transfer Protocol and AT-commands might pop up.

Connecting a Samsung Galaxy

The samsung galaxy devices pop up as a Microsoft media transfer protocol or the Picture Transfer Protocol PTP device and not as USB memory device. To deal with these protocols the library libmtp is required.

A less problematic way is installing a FTP server (As Shuttle FTP for Android) on the mobile phone and use an FTP client on the PC (as Firefox plugin Fireftp that allows also synchronization).

mtp with gvfs

Gvfs can be used to automatically mount the mtp device when it gets plugged in.

For gentoo there is the mtp useflag that puts mtp functionalities to programs as vlc and gvfs

equery hasuse mtp will show those packages installed. emerge --newuse --pretend --deep @world shows then what has to be updated --deep is important to set so also ebuilds not in the world file get re-emerged.

mount mtp

Either mtpfs or jmtpfs to mount it as a file system can be used. mtpfs seems to be buggy whereas the latest versions of libmtp and jmtpfs work well.

To mount (maybe as root) jmtpfs /media/sgs3/ or jmtpfs -o allow_other /media/sgs3

To unmount fusermount -u /media/sgs3/ or add to /etc/fstab

        jmtpfs /media/sgs3 fuse users,noauto,allow_other 0 0

Then mounting works as usual mount /media/sgs3 and umount /media/sgs3

To mount as regular user add


in /etc/fuse.conf

A udev rule can start a script that automatically mounts it, when it gets plugged in, this is done as the user root, to unmount it it is no more root but a regular used, this is just allowed when the fstab line holds users and not user.

Sms from Android

To receive or send an sms plug phone (e.g. samsung galaxy s2, old phones as nokia supporting enough AT commands should also understand it) via USB to computer and check that a file as /dev/ttyACM0 is created. Then open terminal program as gtkterm and connect it 9600baud.

To receive sms: Type in the following (replace nnn with your phone number) after AT+CNMI=1,2,0,0,0 wait for an incoming sms.


+CMT: "+4179nnnn",,"15/06/12,17:31:13+08"
This is a sms

To send CTRL+Z (ASCII char 26) will terminate the sms text and sends it out

> This sms goes out

+CMGS: 6



It is an attempt to be something as Nokias PC suite:

Figure 13.1. Gnokii


A file needs to be created ~/.gnokiirc that holds the necessary configuration check for the sample file /usr/share/doc/gnokii/sample/gnokiirc.

For bluethooth there are two options connecting directly or connecting via /dev/rfcomm0 and using AT commands. If it fails check the reason, maybe other bluetooth software blocks /dev/rfcomm0

rfcomm connect 0 00:1D:3B:82:1C:9D 1

Type gnokii --identify and check if it is happy. If not modify your ~/.gnokiirc.

To backup the phone book

gnokii --getphonebook ME 1 end --vcard >myphonebook.vcf

and to restore it:

gnokii --writephonebook --vcard <myphonebook.vcf

or using the gui type xgnokii

For debugging, there is a monitor: gnokii --monitor

Gnokii has a support for opensync

emerge libopensync-plugin-gnokii and since it is masked it needs to be unmasked.

msynctool --listplugins


Obex allows data exchange to the phone. First find out your devices MAC by hcitool scan. There are two Obex services as sdptool browse 00:1D:3B:82:1C:9D | grep "OBEX" shows:

  1. OBEX file transfer (FTP)

  2. OBEX object push

obex_test is a test program


There is also emerge obexfs that allows easily mount the phone:

obexfs -b 00:1D:3B:82:1C:9D ~/obex/

and to unmount

fusermount -u ~/obex/


To get ftp emerge obexftp

To see what directories are on the phone type obexftp -b 00:1D:3B:82:1C:9D -l and the directories using xml formatting pop up.

To go into the subdirectory Fotos: obexftp -b 00:1D:3B:82:1C:9D -l /Fotos

To get the photo: obexftp -b 00:1D:3B:82:1C:9D -g /Fotos/Bild000.jpg

Delete the picture on and using the phone and then, to push it back: obexftp -b 00:1D:3B:82:1C:9D -c /Fotos --put Bild000.jpg

For more commands man obexftp


Opensync is the successor of Multisync that can be used to synchronize calendar, address list and other things with your computer and other devices or just between different programs.

The data supported are the v-formats as: VCALENDAR, VCARD

VCARD are simple since they hold everything about persons.

But VCALENDAR are usually complicated since many things can be written to a calendar, so VCALANDAR can include many other sub v-formatted data as VEVENT, VTODO, VJOURNAL, VFREEBUSY, VTIMEZONE, STANDARD and DAYLIGHT.

v-formatted data is text and uses BEGIN and END as brackets:

<other lines or sub vformats>

Many such v-formatted data can be packed into a single file forming a complete calendar or phone book.

emerge libopensync and check its version, since its plugins should have the same versions.

Do emerge osynctool since it is a separate ebuild. In previous version the tool msynctool has been used, but msynctool is no more compatible with the new versions of libopensync .


Type in the following osynctool commands as regular user and not as root, since a regular user wants to sync it data and not an administrator. The data goes into ~/.opensync

As regular user you need to create a group of devices that will be synchronized

osynctool --addgroup<groupname> will cerate a group.

osynctool --listgroups will show all groups you have.

osynctool --delgroup<groupname> will delete a group.

To work, different members have to be added to the group. The members might be devices or more precise libopensync-plugin's to those devices.


A delmember option does not exist, therefore when it is necessary to deleting a member, the group has to be deleted.

Common plugin issues

Plugins are required to work with Opensync. Plugins may connects to a phone, serve as gui to the user or provide data formatting functionality. Make sure all plugins, libraries have a similar version.

The name of the plugins can not necessary be used directly. Some plugins contain more than member protocol, others have just an other name. To find out what you have and what names to use type: osynctool --listplugins

After having emerged the plugins, most of them need to be configured, to show if they have not already be configured and if it is necessary to configure them type:

osynctool --showgroup<groupname> .

As example:

osynctool --showgroup private

Group: private

Member 1: evo2-sync

Member 2: file-sync

shows the the group private synchronizes data from the program evolution with opensync files.

Finally to configure them osynctool --configure<groupname><number of the member in the group> and a text editor pops up showing an xml file that needs to be edited. The plugins need to match with each other as example both need to be configured to synchronize events.

vformat plugin

This plugin does not pop up under osynctool --listplugins so it does not seem to be even a plugin, however it seems to be mandatory since it is the one that understands all the data formats. Type osynctool --listformats and not many formats are supported, then type emerge -v =app-pda/libopensync-plugin-vformat-0.<nn> and see again osynctool --listformats now everything seems to be there.

evolution plugin

For synchronizing evolution emerge -v =app-pda/libopensync-plugin-evolution2-0.<nn> then add it as member to the group. To make live a bit difficult, the plugin is not called evolution2. The name evo2-sync can be found using osynctool --listplugins.

Therefore the command to add the plugin is osynctool --addmember<groupname> evo2-sync. Finally osynctool --showgroup<groupname> shows you the success but tells that evo2-sync needs to be configured.

osynctool --configure<groupname><number of the member in the group>

And a text editor pops up showing an xml file that needs to be edited. Every group of data that can be synchronized is inside the <Resource> element:


<Enabled> element can have the value 0 to disable and not risk an error good strategy to start disable all.

<ObjType> tells what the resource is all about.

<Url> is used when multiple instances exist. As example an private address book and a business address book. default takes the default address book, but if multiple address books exist default should be replaced by the name of the particular address book to not cause a mess when the default address book changes. Just one address book can be selected in the xml file. If multiple address books need to be synced, then create multiple Opensyc groups

SyncML plugin

To connect a phone using SyncML emerge -v =app-pda/libopensync-plugin-syncml-0.39 then add it to the group. The command osynctool --listplugins shows that it comes with the following plugins: syncml-http-server syncml-http-client syncml-obex-client. To use obex client to connect the phone add: osynctool --addmember<groupname> syncml-obex-clientFinally osynctool --showgroup<groupname> shows you the success but tells that syncml-obex-client needs to be configured.

The stuff to be known:

Bluetooth address hcitool scan

Scanning ...

00:1A:16:E4:8C:87 Nokia 6234


Cheap phones as Nokia 2760 are limited if it comes to synchronization of agendas and other features and the following fails.

Look if it supports SyncML

sdptool search --bdaddr 00:1A:16:E4:8C:87 SyncML

Searching for SyncML on 00:1A:16:E4:8C:87 ...

Service Name: SyncML Client

Service RecHandle: 0x1000e

Service Class ID List:

UUID 128: 00000002-0000-1000-8000-0002ee000002

Protocol Descriptor List:

"L2CAP" (0x0100)

"RFCOMM" (0x0003)

Channel: 11

"OBEX" (0x0008)

Language Base Attr List:

code_ISO639: 0x656e

encoding: 0x6a

base_offset: 0x100

or more complete

sdptool browse 00:1A:16:E4:8C:87

osynctool --configure<groupname><number of the member in the group>

And a text editor pops up showing an xml file that needs to be edited.

file plugin

This plugin synchronizes data with a directory on your PC. It is intended for data backup of mobile phones, backup of data from evolution in an more open format or since no additional hardware is involved it is also a good start to test opensyc, so emerge -v =app-pda/libopensync-plugin-file-0.<nn>

The name file-sync can be found using osynctool --listplugins. Therefore the command to add the plugin is osynctool --addmember<groupname> file-sync. Finally osynctool --showgroup<groupname> shows you the success but tells that file-sync needs to be configured.

osynctool --configure<groupname><number of the member in the group>

And a text editor pops up showing an xml file where the path to the directory holding the data needs to be added in the <Path> element and the <ObjType> needs to hold what you like to get.

Many small vformatted files are created in the target directory

Synchronizing the data

Make sure you run the following as the user holding the data and not as root.

When using the first time run osynctool --discover<groupname><number of the member in the group>

After that use osynctool --sync<groupname>

Troubleshooting opensync

Unfortunately opensync seems pretty unstable. When playing with different versions and options it a lot of data is collected in .opensync, therefore it might be useful to delete those files when opensync is messed up.

The plugins depend on other programs and therefore a lot of maintenance effort is necessary to have them up to date. Unfortunately it looks that opensync is no more really active and programs as evolution seem to have an issue.

Linurs Servernest startpage