Matthias Schmidt

Philipps University Marburg
Department of Mathematics and Computer Science

University logo

HOWTO establish a connection between Linux and a mobile phone via infrared

Update

This HOWTO is part of the official Infrared-HOWTO by Werner Heuser since May 2003, so you maybe want to have a look at his pages for a more recent version.

Additional to the HOWTO for Ericsson mobile phones by Hans and the Linux Infrared HOWTO I wrote this document for Siemens/Nokia mobile phone users.

Content:


Tested with the following mobiles:

  • Ericsson T39m
  • Siemens S25
  • Siemens S35i
  • Siemens ME45
  • Nokia 6110
  • Nokia 6210

Note: Some parts of the following text (Irda-Kernel, wvdial.conf) are stolen from Hans site (see above), because the general description will work for mostly all others too.

IRDA Kernel Configuration

Irda is working as module for me, after installing the irda-utils. I compiled the following kernel modules:

CONFIG_IRDA=m
CONFIG_IRLAN=m
CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_IRDA_ULTRA=y
CONFIG_IRDA_OPTIONS=y
CONFIG_IRDA_CACHE_LAST_LSAP=y
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y
CONFIG_IRTTY_SIR=m
CONFIG_NSC_FIR=m
CONFIG_WINBOND_FIR=m
CONFIG_TOSHIBA_FIR=m
CONFIG_SMC_IRCC_FIR=m

Edit /etc/modules.conf

alias tty-ldisc-11 irtty
# The following is for new kernel.
alias char-major-161 ircomm-tty

# The following is for old kernel.
alias char-major-60 ircomm_tty

# To be able to attach some dongles
alias irda-dongle-0 tekram
alias irda-dongle-1 esi
alias irda-dongle-2 actisys
alias irda-dongle-3 actisys
alias irda-dongle-4 girbil
alias irda-dongle-5 litelink
alias irda-dongle-6 airport
alias irda-dongle-7 old_belkin

# FIR device drivers.
# options smc-ircc ircc_irq= ircc_dma=
# alias irda0 smc-ircc
# options toshoboe max_baud=
# alias irda0 toshoboe
# options w83977af_ir io= io2= irq= qos_mtt_bits=
# alias irda0 w83977af_ir

# To use the NSC driver on a Thinkpad laptop: uncomment the following:
# options nsc-ircc dongle_id=0x09
# alias irda0 nsc-ircc

Bind the IRDA device

# /usr/sbin/irattach /dev/ttyS1 -s
# lsmod | grep -i ir
irtty                   7456   2  (autoclean)
irda                  141612   1  (autoclean) [irtty]

Mobile found?

# irdadump
xid:rsp be1eb736 < 08666644 S=6 s=4 SIEMENS S35 hint=9024 [ Modem IrCOMM IrOBEX ] (28)
# irdaump
xid:rsp be1eb736 < 35450000 S=6 s=4 Nokia 6100 hint=8101 [ PnP Telephony ] (28)
# irdaump
xid:rsp be1eb736 < 04489982 S=6 s=5 SIEMENS ME45 hint=b124 [ PnP Modem Fax IrCOMM IrOBEX ] (29)

Connect to the internet

You'll need the following things:

PPP kernel support

	CONFIG_PPP=m
	# CONFIG_PPP_MULTILINK is not set
	# CONFIG_PPP_FILTER is not set
	CONFIG_PPP_ASYNC=m
	CONFIG_PPP_SYNC_TTY=m
	# CONFIG_PPP_DEFLATE is not set
	CONFIG_PPP_BSDCOMP=m

PPP dial-up software

  • There are several ways to connect to your ISP. The easiest (and sometimes the only :) way is to use a terminal program like minicom.

  • If you prefer more comfort, you can use wvdial. It's easy to configure and it works with a lot of roaming providers and the german Tante T.

    gh0st and me did some testing yesterday and we weren't able to connect to the dial-in server of the HRZ with wvdial. wvdial always failed with "Bad password", because the server respondend faster that the mobile softmodem could send the login and password strings. See the standard ppp config below, it works fine :)

    • /etc/wvdial.conf:

      	[Dialer Defaults]
      	Modem = /dev/ircomm0
      	Baud = 9600
      	Init1 = ATZ
      	Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
      	Password = internet
      	Username = internet
      	Phone = 00393492002800
      	ISDN = 0
      	Modem Type = Analog Modem
      
      	[Dialer shh]
      	Init3 = ATM0
      	

  • Problems with wvdial (see explanation above)? IMO the best way is to use the standard PPP tools. You can configure them via pppconfig, start with pon and stop connection with poff.

    NOTE: All students of the Philipps-University Marburg can use the "Dial-In Zugang des HRZ" to connect to the internet via mobile. If you have D2/Vodafone and "Best-City-Special", you can check emails at the Mensa for a really low fare (email via mobile rocks :)

    Example files for PPP with a connection named uni:

    • /etc/ppp/pap-secrets
      	# HRZ-Username	connection-name	password
      	Test23		uni		test
      	

    • /etc/ppp/peers/uni
      	hide-password
      	noauth
      	connect "/usr/sbin/chat -v -f /etc/chatscripts/uni"
      	debug
      	/dev/ircomm0
      	9600
      	defaultroute
      	noipdefault
      	user Test23
      	remotename uni
      	ipparam uni
      	usepeerdns
      	

    • /etc/chatscripts/uni
      	ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' 
      	ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
      	'' ATZ
      	# dial-in number of the HRZ Marburg
      	OK-AT-OK ATDT064211790
      	CONNECT \d\c
      	

Play around with your Siemens (logos, sounds, sms, ...)

If you get your Siemens mobile working via infrared, you can do some nice stuff with it. You can fetch informations, save your phonebook or your SMS, send SMS, put new logos (BMP format) on it, save the old logo to your harddisk and do the same with your ringtone (MIDI).

To do all this nice things, you'll need the following:

  • a Siemens mobile-phone
  • a working infrared connection
  • scmxx
  • gscmxx (optional)

  1. Bind your mobile

    	# irattach /dev/ttyS1 -s
    	IrDA: Registered device irda0
    	# irdadump
    	xid:cmd 9d5dcefa > ffffffff S=6 s=3 (14)
    	xid:cmd 9d5dcefa > ffffffff S=6 s=4 (14)
    	xid:rsp 9d5dcefa < 08666644 S=6 s=3 SIEMENS S35 hint=9024 [ Modem IrCOMM IrOBEX ] (28)
    	
  2. Show informations about your mobile

    	# scmxx -i
    	Accessing device /dev/ircomm0
    	OK, a modem device is present.
    	Vendor:         SIEMENS
    	Model:          S35i
    	Revision:       20
    	Serial (Phone): xxxxxxxxxxxxxxx
    	Serial (SIM):   xxxxxxxxxxxxxxx
    	SIM-ID:         xxxxxxxxxxxxxxxxxxxxx
    	Operator:       D2
    	SMS Server:     +491722270333
    	Charset:        GSM
    	Battery:        40%
    	Signal/BER:     -79 dBm/?
    	Time:           02/10/07,11:48:49
    	Readable Slots: bmp: 0-1, mid: 0, vcs: 1-30
    	Phonebooks:     FD, SM, ON, ME, LD, MC, RC, OW, MS, CD, BL, RD, CS
    	SMS storages:   SM
    	
  3. Save your phonebook to disk

    	# scmxx -g -PSM -f phonebook
    	Accessing device /dev/ircomm0
    	OK, a modem device is present.
    	Detected SIEMENS S35i
    	phonebook created.
    	Receiving: 1 2 3 4 5 6 7 8 9 [...] 
    	Received all gettable entries
    	
  4. Show your SMS (here in slot 3)

    	# scmxx -g -S3 -f -
    	Accessing device /dev/ircomm0
    	OK, a modem device is present.
    	Detected SIEMENS S35i
    	Looking for SMS of specified type...
    	Receiving incoming, read SMS from slot 3.
    	Slot: 3
    	From: xxxxxxxxxxxxxx
    	Date: 2002-10-03 23:11:47 (GMT+0)
    	SMSC number: xxxxxxxxxxxxxxxx
    	PDU type: SMS-DELIVER MMS
    	Data Coding Scheme: 7bit-GSM
    	Message length: 160
    	Message:
    		xxxxxxxxxxxxxxxxxxxxxxxxxx
    	
  5. Save your current logo to disk

    	# scmxx -g -B0 -f logo.bmp
    	Accessing device /dev/ircomm0
    	OK, a modem device is present.
    	Detected SIEMENS S35i
    	Slot 0...
    	Receiving packet 1 of 5...
    	logo.bmp created.
    	Receiving packet 2 of 5...
    	Receiving packet 3 of 5...
    	Receiving packet 4 of 5...
    	Receiving packet 5 of 5...
    	File transfer complete.
    	
  6. Save your current ringtone to disk

    	# scmxx -g -M0 -f sound.mid
    	Accessing device /dev/ircomm0
    	OK, a modem device is present.
    	Detected SIEMENS S35i
    	Slot 0...
    	Receiving packet 1 of 1...
    	sound.mid created.
    	File transfer complete.
    	

Have a look at the scmxx(1) man-page or look at the README file for further information.


Copyleft (l) 2002-05 by Matthias Schmidt.