FreeBSD 3G/GPRS Connection via USB or Bluetooth

Document updates

20050112 – Add 3G information

20060424 – Add some bluetooth information

You might also be interested in the hso(4) driver that provides support for HSDPA/UMTS/3G connections using USB devices from Option N.V (for example GlobeSurfer iCON).

Hardware

  • Sony Ericsson Z1010 OR
  • Ericsson T65
  • SonyEricsson USB Cable DCU-11 (aka. Susteen USB Data Cable) OR
  • Bluetooth dongle.

Most SonyEricsson mobiles should work, perhaps some tweaking with the AT-commands are needed.

Kernel patching (USB only)

This is included per default in FreeBSD 5.3 and FreeBSD 4-STABLE as of 18 Aug 2004

The cable enables USB tty support (ucom(4)).
However the cable is not listed in the correct driver which makes it appear as a ugen(4) device rendering it useless.

The following patch will make things work

  • susteen.diff – FreeBSD 5.2.1

Apply the patch

cd /usr/src/sys/dev
patch < susteen.diff
cd usb
make -f Makefile.usbdevs

Kernel rebuild (USB only)

The following options, in addition to the usual usb drivers,

are needed in your kernel configuration file

device          ucom
device          uplcom

Rebuild your kernel the usual way.
Attatching the cable now should give you something like this

May  8 16:14:30 biocandy kernel: ucom0: Susteen Inc. USB Data Cable, rev 1.10/0.01, addr 2

Your phone can now be accessed like a normal modem.

3G/GPRS configuration

Can be done using userland-ppp (ppp) or kernel-ppp (pppd).

The following configuration is for Tele2/Comviq and done with userland-ppp.

This most importat settings are CID and APN (Access Point Nodes)

Your phone assigns a CID for each GPRS APN you have, in my case the GPRS settings with internet access had been assign CID 2 by my phone.

APN is in my case isplnk1.swip.net

(Note that AT+CGDCONT might not be needed).

gprs:
set device /dev/ucom0  # Our device
set speed 115200	# Our speed
set phone *99***2#	# Magic number to "dial" gprs, 2 refers to CID

# This is our chat script, AT+CGDCONT=2 (CID) and isplnk1.swip.net
# should be change to reflect your settings
set dial "ABORT BUSY ABORT NOsCARRIER TIMEOUT 5
\"\" AT OK-AT-OK
AT OK-AT-OK dATDT TIMEOUT 40 CONNECT"
enable dns		# We want dns
set authname gprs	# Loginname
set authkey internet	# Password
accept PAP		# PAP is ok
set login		# not needed
add default HISADDR	# Set default route
set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0	# Dynamic ip (more on this in the handbook)
disable ipv6cp		# We don't want ipv6
disable mppe		# We don't want MS PPP encryption

# 3G configuration is almost identical to GPRS
3g:
set device /dev/ucom0
set speed 460800	# SPEED IS GOOD!
set phone *99***1#	# 1 refers to CID

# The chat script is a little bit different
set dial "ABORT BUSY ABORT NOsCARRIER TIMEOUT 5
\"\" AT OK-AT-OK
AT OK-AT-OK dATDT TIMEOUT 40 CONNECT"
enable dns
set authname wap	# Authname and password are different than gprs becase
set authkey wap	# my provider decided so :)
accept PAP
set login
add default HISADDR
set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0
disable ipv6cp
disable mppe

Note, your provider should provide you with correct APN, authname(username) and authkey(password). Dialing is then done with

root@myhost> ppp 3g
Working in interactive mode
Using interface: tun0
ppp ON myhost>

At this point you can start your connection by issuing dial

ppp ON myhost> dial

Notes on Ericsson T65

Issuing the commands close left the gprs connection active on the phone, a manual disconnect using the phone was needed.

Alternative, issuing the command term inside ppp and sending +++ATH to the phone disconnects the session.

3G/GPRS configuration

Setup bluetooth as described in the handbook.
This involves adding the device to /etc/bluetooth/hcsecd.conf and starting hcsecd (pairing devices).

Then create a similar ppp-label in /etc/ppp/ppp.conf

3g-bt:
enable force-scripts
set speed 460800       # SPEED IS GOOD!
set phone *99***1#    # 1 refers to CID

set dial "ABORT BUSY ABORT NOsCARRIER TIMEOUT 5
\"\" AT OK-AT-OK
AT OK-AT-OK dATDT TIMEOUT 40 CONNECT"
enable dns
set authname wap
set authkey wap
accept PAP
set login
add default HISADDR
set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0
disable ipv6cp
disable mppe

The big difference is the addition of enable force-scripts and the removal of the device string.

Then to connect issue the following command

rfcomm_pppd -a mydevice -C DUN -l 3g-bt -d

This should connect your phone to 3g/gprs and create a tun-device for you,
close the connection by hitting ctrl-c.

Comments are closed.