Connecting the T610 to Linux, and other bluetooth adventures

I first bought the phone, with some idea about what I wanted to accomplish. I had heard a bit about this bluetooth stuff, and I really wanted to give it a go. Once I had the phone, I stated looking for some linux compatible hardware. To my surprise, I found heaps at:

Bluetooth hardware support for BlueZ

I found the Belkin F8T003 USB Bluetooth Adapter.

Software

Install the BlueZ bluetooth stack

$ emerge -pv bluez-utils gnome-bluetooth

That should install all the basic userspace bluez stuff that you need. You will also need support bluetooth enabled in your kernel. Start the bluetooth service:

$ /etc/init.d/bluetooth start

At this point, you should be able to access your phone. You can find the status of your device by looking at:

$ hciconfig
hci0:   Type: USB
BD Address: 00:02:72:40:63:27 ACL MTU: 192:8  SCO MTU: 64:8
UP RUNNING PSCAN ISCAN AUTH ENCRYPT
RX bytes:49235 acl:1876 sco:0 events:1395 errors:0
TX bytes:39270 acl:930 sco:0 commands:290 errors:0

You can scan for your devices by:

$ hcitool scan
Scanning ...
00:0A:D9:DC:A4:36       Andy's Phone

Using GPRS

The aim here is to be able to use the internet via gprs, on your laptop (not quite as useful as on a desktop machine)
Use sdptool to look for a DUN device

$ sdptool search DUN
Inquiring ...
Searching for DUN on 00:0A:D9:DC:A4:36 ...
Service Name: Dial-up Networking
Service RecHandle: 0x10000
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

That basically says that your phone supports dial up networking. Bind your phone to a serial device:

$ rfcomm bind 0 00:02:72:40:63:2 1

$ rfcomm show
rfcomm0: 00:02:72:40:63:02 channel 1 clean

I created two files for pppd:
This is my /etc/ppp/peers/gprs

/dev/rfcomm0 57600
connect '/usr/sbin/chat -v -f /etc/ppp/peers/chat-gprs'
noauth
defaultroute
debug

This is my /etc/ppp/peers/chat-gprs

TIMEOUT         5
ECHO            ON
ABORT           'nBUSYr'
ABORT           'nERRORr'
ABORT           'nNO ANSWERr'
ABORT           'nNO CARRIERr'
ABORT           'nNO DIALTONEr'
ABORT           'nRINGINGrnrnRINGINGr'
''             rAT
TIMEOUT         12
OK              ATE1
OK              'AT+cgdcont=1,"IP","3netaccess"'
OK              ATD*99***1#
CONNECT

Some words about these files:
To use these, you will use

$ pppd call gprs

and then pppd will use the gprs file we make. pppd will then use the chat-gprs file to check the output from the phone so it can decide what to do.

You will need to make sure (probably before you try and connect to the internet via bluetooth) what the Access Point Name (APN) of your provider is. For me, it was just ‘internet’ which you can see on the 2nd last line of the chat-gprs file. If this is wrong, you will probably not be able to resolve an IP address.
You should see something like this in your kernel messages file:

Oct 24 08:05:29 localhost pppd[5101]: pppd 2.4.1 started by root, uid 0
Oct 24 08:05:30 localhost hcid[2355]: link_key_request (sba=27:63:40:72:02:00, dba=36:A4:DC:D9:0A:00)
Oct 24 08:05:31 localhost chat[5102]: timeout set to 5 seconds
Oct 24 08:05:31 localhost chat[5102]: abort on (nBUSYr)
Oct 24 08:05:31 localhost chat[5102]: abort on (nERRORr)
Oct 24 08:05:31 localhost chat[5102]: abort on (nNO ANSWERr)
Oct 24 08:05:31 localhost chat[5102]: abort on (nNO CARRIERr)
Oct 24 08:05:31 localhost chat[5102]: abort on (nNO DIALTONEr)
Oct 24 08:05:31 localhost chat[5102]: abort on (nRINGINGrnrnRINGINGr)
Oct 24 08:05:31 localhost chat[5102]: send (^MAT^M)
Oct 24 08:05:32 localhost chat[5102]: timeout set to 12 seconds
Oct 24 08:05:32 localhost chat[5102]: expect (OK)
Oct 24 08:05:32 localhost chat[5102]: ^MAT^M^M
Oct 24 08:05:32 localhost chat[5102]: OK
Oct 24 08:05:32 localhost chat[5102]:  -- got it
Oct 24 08:05:32 localhost chat[5102]: send (ATE1^M)
Oct 24 08:05:32 localhost chat[5102]: expect (OK)
Oct 24 08:05:32 localhost chat[5102]: ^M
Oct 24 08:05:32 localhost chat[5102]: ATE1^M^M
Oct 24 08:05:32 localhost chat[5102]: OK
Oct 24 08:05:32 localhost chat[5102]:  -- got it
Oct 24 08:05:32 localhost chat[5102]: send (AT+cgdcont=1,"IP","internet"^M)
Oct 24 08:05:32 localhost chat[5102]: expect (OK)
Oct 24 08:05:32 localhost chat[5102]: ^M
Oct 24 08:05:32 localhost chat[5102]: AT+cgdcont=1,"IP","internet"^M^M
Oct 24 08:05:32 localhost chat[5102]: OK
Oct 24 08:05:32 localhost chat[5102]:  -- got it
Oct 24 08:05:32 localhost chat[5102]: send (ATD*99***1#^M)
Oct 24 08:05:33 localhost pppd[5101]: Serial connection established.
Oct 24 08:05:33 localhost pppd[5101]: Using interface ppp0
Oct 24 08:05:33 localhost pppd[5101]: Connect: ppp0 <--> /dev/rfcomm0
Oct 24 08:05:35 localhost pppd[5101]: local  IP address 10.20.54.229
Oct 24 08:05:35 localhost pppd[5101]: remote IP address 10.20.54.228

So, if that all works, you should be away! Happy gprs-ing!

More info about this stuff at:

Sending stuff to your phone

Using the gnome-bluetooth packages, you get a little application called ‘Bluetooth File Sharing’ in your menu. From what I have gathered, it acts like an obex-server, which has a record of which devices are registered.
Using gnome-bluetooth-admin, you can search for your phone and add it to the database.

To send files, you can either use the GNOME menu option ”’Send to Bluetooth”’ and select you device. If you’re using GNOME 2.10, the menu option doesn’t work yet. But, you can use the command line option:

$ gnome-obex-send --dest 00:0A:D9:DC:A4:36 phone/skan-Sexy.thm

I was able to send the theme skan-Sexy.thm to the phone, while the gnome-bluetooth file sharing daemon (or gnome-obex-server) was running.

Links

This report is listed at TuxMobil – Linux on laptops, notebooks, PDAs, mobile phones.

Posted at September 24th, 2006.

Leave a Reply


× 7 = twenty one