Sharp Zaurus, Bluetooth, GPRS and a Nokia 6310i HOWTO

Version 1.0 Darren Beale - spam@acksys.co.uk

Last updated on Friday, 10-Jan-2003 16:31:37 UTC.

The aim of this document is to illustrate the steps that I took (minus all the wrong ones, and there were many) to get a successful GPRS data connection using my Sharp Zaurus, a Nokia 6310i, a Socket Bluetooth card and an O2 (UK mobile phone operator) GPRS data account.

I'm making the assumption that you already have a Sharp Zaurus (Z) (or are intending to buy one) and that you are OK with using Linux on the command line.

I hope it helps you.

Hardware

Sharp Zaurus PDA
http://www.sharp.co.uk/pda

Socket Bluetooth card
http://socketcom.com

Nokia 6310i phone

Software

OpenZaurus 3.1RC1 the alternative to the stock ROM that Sharp ships with the Z.
http://www.openzaurus.org.

Affix - Bluetooth Protocol Stack for Linux http://affix.sourceforge.net

From http://affix.sourceforge.net/feeds/unstable/zaurus/

blueapplet_1.2.6.1-2_arm.ipk
bluetooth-connector_1.2.6.7-1_arm.ipk
libgthread_1.2-10_arm.ipk
libopenobex_1.0.0.pre5-2_arm.ipk

From http://www.openzaurus.org/official/unstable/feed/

affix-modules_1.2.6-1_arm.ipk
affix_1.2.6-1_arm.ipk

Method

I placed all the ipks onto a CF card and installed them using aqpkg, you may need to force deps on a few of them.

Reboot the Z and you should have a little (grey) Bluetooth icon on your task bar.

an 'lsmod' gives me:

root@zaurus /root# lsmod
Module
SizeUsed by
affix_uart_cs39521
affix_uart204960[affix_uart_cs]
affix815840[affix_uart]
serial 25952 0 [affix_uart_cs]
sharp_mmcsd_m 27424 2
devinfo 3168 0 (unused)
sa1100_bi 45536 0 (unused)
net_fd 36016 1 [sa1100_bi]
usbdcore 20448 0 [sa1100_bi net_fd]
usbdmonitor 6112 0
For some reason when I put the card into the CF slot, the card is recognised but I cannot 'Turn Bluetooth ON' using the taskbar applet*. So I need to run little script which I have placed in /root/bin

root@zaurus /root# cat /root/bin/bt
#!/bin/sh
cardctl eject 0
modprobe affix_uart_cs
cardctl insert 0
btctl init_uart tlp 115200 ring,ctl,low btctl up

When I run this on my Z, I see the card 'ejected' and then 'inserted' and the little taskbar icon turns blue.

I can also see:

root@zaurus /root# btctl
Affix version: Affix 1.2.6
---->>>> Affix Bluetooth Driver control program <<<<---- For help use "btctl -h"

bt0     00:02:ee:76:f3:fd
        Name: "zaurus"
        Class: 0x820110, Computer (Handheld PC/PDA) [Networking,Information]
        Scan Mode: non-discoverable, non-connectable
        Security mode: service [-auth, -encrypt]
        Packet types: DM1 DH1 DM3 DH3 DM5 DH5 HV1
        Connection role: allow switch, remain slave
        Baseband:
                Manufacture: Nokia Mobile Phones, id: 1
                Features: 1.1 compliant
        Buffers:
                ACL: 4 x 340 bytes
                SCO: 0 x 0 bytes
        Suported features:
                Packet types: 3-slots, 5-slots
                Radio features: none
                Policy: switch, sniff mode,
                Encryption: supported
                Clock modes: slot offset, timing accuracy
                Audio: not supported
                Power Control: not supported

and

root@zaurus /root# ifconfig
bt0 Link encap:UNSPEC HWaddr
00-02-EE-76-F3-FD-00-00-00-00-00-00-00-00-00-00

          UP RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 iB)  TX bytes:0 (0.0 iB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:400 (400.0 iB)  TX bytes:400 (400.0 iB)

usbd0     Link encap:Ethernet  HWaddr 40:00:01:00:00:01
          inet addr:192.168.129.201  Bcast:192.168.129.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:776 errors:0 dropped:2 overruns:0 frame:0
          TX packets:670 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:44745 (43.6 kiB)  TX bytes:47111 (46.0 kiB)

So we have a bluetooth card plugged in and ready to roll, next we need to make the bluetooth connection.

Firstly make sure that Bluetooth is enabled on your phone. Next let's see if the Z can see it

root@zaurus /root# btctl discovery
Searching 8 sec ...
Searching done. Resolving names ...
done.
+1: Address: 00:02:ee:6c:d1:f5, Class: 0x500204, Key: "no", Name: "Nokia 6310i"

Phone (Cellular) [Object Transfer,Telephony]

Now we need to pair the phone with the Z. The following adds the PIN of '1' (not great I know) for the pairing

root@zaurus /root# btctl addpin 00:02:ee:6c:d1:f5 "1"

Now lets make the connection:

root@zaurus /root# btctl connect 00:02:ee:6c:d1:f5 Connecting to host 00:02:ee:6c:d1:f5 ... Service found on channel 3

The phone should beep and ask you to accept the connection to 'Zaurus' press accept and type in a 1 when asked for the PIN

Connecting to channel 3 ...
Connected. Bound to line 0 [/dev/bty0].

Now we need do is set up a ppp link. The following information is specific to my 02 http://www.o2.co.uk GPRS data account. The settings I got from other snippets that I found elsewhere did not work with O2 _at_all_ they needed quite a bit of jiggling around.

Firstly backup your /etc/ppp/options, create a new one and put in it the following

# File:
# /etc/ppp/options
-detach
noauth
name web # the O2 GPRS data username
defaultroute
nocrtscts
lock
usepeerdns
/dev/bty0
115200
local
noccp
asyncmap a0000

Next make a new directory called chat and place in it the following 2 files

# File:
# /etc/ppp/chat/gprs-connect
#
# Description:
# chat script to open O2 GPRS service with Nokia 6310i GPRS phone. #
# Modifed from script found at ConnectedUser.com exec chat -v
\
TIMEOUT 5
\
ECHO ON
\
ABORT '\nBUSY\r'
\
ABORT '\nERROR\r'
\
ABORT '\nNO ANSWER\r'
\
ABORT '\nNO CARRIER\r'
\
ABORT '\nNO DIALTONE\r'
\
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' '\rAT'
\
TIMEOUT 12
\
SAY "Press CTRL-C to close the connection at any stage!" \
SAY "\ndefining PDP context...\n" \
OK 'ATE1'
\
OK 'AT+CGDCONT=,,"mobile.o2.co.uk/"' \
OK 'ATDT *99#'
\
TIMEOUT 22
\
SAY "\nTrying to connect...\n" \

CONNECT         '' \
SAY             "\nConnected."
\
SAY             "\nIf the following ppp negotiations fail,\n"
\
SAY             "try restarting the phone.\n"

Note these 2 lines

OK 'AT+CGDCONT=,,"mobile.o2.co.uk/"' \
OK 'ATDT *99#'
\

mobile.o2.co.uk is the APN and *99# is the number to 'dial' see http://nds1.nokia.com/phones/files/guides/Nokia_AThelp.pdf for more info.

The second file is a disconnect script:

#File:
# /etc/ppp/chat/gprs-disconnect
#
# send break
exec /usr/sbin/chat -V -s -S \

ABORT           "BUSY"          \
ABORT           "ERROR"         \
ABORT           "NO DIALTONE"   \
SAY             "\nSending break to the modem\n"        \
""              "\K"            \
""              "+++ATH"        \
SAY             "\nPDP context detached\n"

Now create a file /etc/ppp/peers/gprs

#File:
# /etc/ppp/peers/gprs
#
# Settings here should work for a Nokia 6310i and a # GPRS data account with O2 (ex BTCellnet) in the UK # Darren Beale - spam@acksys.co.uk

debug

/dev/bty0 # bluetooth
115200

connect /etc/ppp/chat/gprs-connect
disconnect /etc/ppp/chat/gprs-disconnect

crtscts
defaultroute
usepeerdns
asyncmap a0000
noccp
noipdefault

Nearly there, create a file /etc/ppp/pap-secrets with one line:

web * web

(This is the O2 username and password for a GPRS data account)

also create /etc/resolv.conf and add the lines:

nameserver 193.113.200.200
nameserver 193.113.200.201

I'm sure that here any valid nameserver will do, but these IP's are correct for O2

Finally create the file /etc/ppp/ip-up.d/routing with the line

route add default gateway 10.6.6.6

again specific to 02

Now lets try to connect....

At this point I suggest that you make sure syslog is running by typing

/etc/init.d/syslog start

you can now open a second terminal window and 'watch logread'*

To connect type:

pppd call gprs &

Wait for a bit and then try to ping something in the outside world

root@zaurus ppp# ping www.openzaurus.org PING vhost.sourceforge.net/ (66.35.250.210): 56 data bytes 64 bytes from 66.35.250.210: icmp_seq=1 ttl=48 time=2252.4 ms 64 bytes from 66.35.250.210: icmp_seq=2 ttl=48 time=1298.7 ms 64 bytes from 66.35.250.210: icmp_seq=3 ttl=48 time=1357.3 ms 64 bytes from 66.35.250.210: icmp_seq=4 ttl=48 time=1097.4 ms

Yay!


Notes:
You'll need to chmod some of those files so they are executable Make sure that everything in /etc/ppp is owned by root, i.e. chmod -R root:root /etc/ppp
Credits

Thanks to:
-The OpenZaurus Team and the Affix team for writing the software for free
-ConnectedUser.com for a similar howto that was useful as a starting point
-Bill Unruh on comp.protocols.ppp for help with the ppp scripts