SonyEricsson P800 and Linux:

OVERVIEW:

I have seen a lot of people having troubles connecting their P800 to their Linux computer.. I therefore put together this page with information on the matter. Hope this helps someone.

The P800 uses a protocol called mRouter to connect to computers. mRouter was developed by a company called Intuwave. The mRouter protocol is based on TCP/IP and can be connected to using a standard PPP daemon on *nix.

Remember, that if you want your P800 to be able to surf the net, you might need some iptables stuff, depending on your setup. For whatever reason, the P800 wants to resolve the host wsockhost.mrouter. Using Windows this host resolves to the ppp-address your computer gets (in my examples 192.168.0.4), but I have found out that it doesn't matter what address it resolves to. The P800 is happy just to get it resolved. If it can't resolve it, it disconnects after about 90 seconds. So, if you are experiencing that your connection discards after about 90 seconds, you can try to check that it resolves to the correct address, even though I'm not having problems using other ip's.

I'm running Bind on my server, but I have been told that if you run it locally, it won't listen to interfaces that do not exist during startup, so you'll have to restart Bind after ppp0 is up if you're running Bind locally.

There are three different ways connecting your P800 with your Linux-box. Cable, infrared and bluetooth.

Cable

There are at least three different cables available.

DRS-11 is a normal RS-232 cable, which is connected to /dev/ttyS*

DCU-10 is a USB->RS-232 adapter, which is supported by the pl2303 driver in kernels >=2.4.21-pre7 and >=2.5.65. This is also the chipset used in the DCU-11 early syncstation for the P800.

DSS-20 is also a USB->RS-232 adapter, and is the syncstation bundled with newer P800's. It is supported by the ftdi_sio driver in kernels >=2.4.22-pre6 and >=2.6.0-test2

Here is my /etc/ppp/peers/p800-usb:

connect "/usr/sbin/chat -v -f /etc/ppp/peers/p800.chat"
noauth
user ppp
crtscts
lock
local
proxyarp
passive
115200
/dev/ttyUSB0
192.168.0.3:192.168.0.4

And here is /etc/ppp/peeers/p800.chat:

"" "." "Are you there?~" "~mRouter - I'm here~"

You now connect to your P800 by executing:

pppd call p800-usb

Infrared

Infrared works the same way as cable in this regard, as long as you have infrared working on your computer. You just replace your device name with /dev/ircomm0 (or whatever number it has), and delete the first line. Infrared doesn't need the chat-script. Here is my /etc/ppp/peers/p800-irda

noauth
user ppp
crtscts
lock
local
proxyarp
115200
/dev/ircomm0
192.168.0.3:192.168.0.4

Connect to you P800 by running:

pppd call p800-irda

Bluetooth

Update: 2003.12.12 - I have now updated the BT part with a lot simpler way, shamelessly stolen from Edd Dumbill's weblog.

First of all, I have heard several people complain about the BlueZ stack, and are recommending Affix instead. I have never had any problems with BlueZ (but that said, I have never tried Affix). I have never used any particular patches neither. Just using a recent kernel (2.4.20 or later) seems to be good enough. I presume that people reading this already have a working bluetooth setup.

You have to have paired the pc and P800 first. When you try to connect to the P800 serial profile, the P800 will immediately disconnect. Then the P800 will try to connect BACK to your linux-box. Thus, you have to add a serial-port profile for dund to use. This is done like this (remember that your phone must be discoverable during this procedure):

hcitool inq

You will now get your P800's bt-address. Check which port is the serial profile with:

sdptool browse <bt-address>

Usually the Serial Port-profile is port 3, but not always. Then you bind it to a rfcomm-port. I have used /dev/rfcomm1.

rfcomm bind /dev/rfcomm1 <bt-address> <serial-profile port>

You have to add a Serial Port profile on your computer, so that the P800 can connect to the pc.

sdptool add --channel=3 SP

Now you have two different aproaches. You can either start dund with the pppd options last on the command-line, or you can have the pppd options in /etc/ppp/options. I have chosen the last approach, but both works equally well.

Then dund have to be started with these options:

dund --listen --channel 3 <eventually put pppd options here>

At least with Debian, both the dund and rfcomm stuff is run by init, so if you set it up there, you don't need to run it your self. (which is the reason I have chose to put the pppd options in a file, and not on the command-line).

and here is my /etc/ppp/options (for the incoming connection):

noauth
crtscts
lock
local
proxyarp
passive
silent
192.168.0.3:192.168.0.4

Connect with:

echo > /dev/rfcomm1

That should be all :) You can now surf with Opera on your phone using your computer's internet connection, or you can sync your phone against Evolution using the SyncML plugin from MultiSync. Good luck!

Stian Jordet, 2003.08.15

Last updated: 2003.12.12

Valid XHTML 1.0!