Thursday, February 21, 2008

Connecting a Motorola V3xx to Linux

I'm using Gentoo Linux, and I have a Motoral V3xx that I want to manage, so here's what I do. You can't use the same steps you find in other places for V3s and V3xs, because they use the p2k protocol, but the V3xx uses p2k05.

1) Change phone to data connection mode
- Open phone, go to main menu -> Settings -> Connection -> USB Settings -> Default Connection -> Data Connection

2) Download and compile p2k-core. Good luck finding it if that link doesn't work, because it's not a very popular package, but it is the only one I could find that supports p2k05 for Linux (and that support is actually pretty alpha). The author, Sandor Otvos, doesn't appear to be interested in using a Sourceforge or Savanna site. Frankly, his website is barely navigable, so if you can't find it, don't know what to tell you. Hopefully more Linux mobile phone management software will be forthcoming.

3) Create a phone group, if necessary, and add your account to it. This is for security. If you don't care, skip this step, and omit the OWNER and GROUP parts in the next step, and change MODE to "666".

4) Create /etc/udev/rules.d/99-motorola-v3xx with the following content (all on one line):

BUS=="usb" SYSFS{product}=="Motorola*" KERNEL=="ttyACM*" SYMLINK=="mobile" MODE=="660" OWNER=="root" GROUP=="phone"

5) Verify cdc_acm and uhci_hcd modules are either compiled into kernel, or loaded

# modprobe cdc_acm uhci_hcd


6) Plug phone into computer via mini-USB connection

7) Type "dmesg" to verify that phone was detected. Should see this:

usb 4-2: new full speed USB device using uhci_hcd and address 6

usb 4-2: configuration #1 chosen from 1 choice

cdc_acm 4-2:1.0: ttyACM0: USB ACM device

8) Verify /dev/ttyACM0 was created:

# ls -l /dev/ttyACM0


9) Execute p2k-core. If all goes well, you'll see something like this:

# p2k-core
V_1.0 Commands: exit,conn,info,seem,file,fold,mode,help,list
Shell commands and command history (up/down arrows) also works.
---------------------------------------------------------------
Search for Motorola Test Command.
Search for Motorola Data Interface.
Found Interface: Motorola Data Interface
Interface 00 is claimed by kernel driver: cdc_acm
Interface 00 is detached from kernel driver: cdc_acm
Inteface number: 01, Endpoints: 81 01
Switching to P2kmode (cca. 2-3 sec)
Search for Motorola Test Command.
Found Interface: Motorola Test Command
Inteface number: 01, Endpoints: 82 01
This is P2k05 phone.
P2k:>

Good luck. Although I can get connected to the phone, I've not been able to make p2k-core upload files for me. It says it's uploading, but when I rescan the file system, there's nothing new there. Just sending those bits off the end of the plank, I guess.

If you can't get it to connect, try connecting to the phone using simple AT commands in your favorite terminal program (like minicom), and troubleshoot from there as you would a regular modem. If the /dev/ttyACM0 file isn't being created, check that the 99-motorola-v3xx file syntax is correct. If it's off, there will be messages from udevd in /var/log/messages complaining about it. If it's correct, unplug the phone, put udevd into debug mode, tail the messages file, and plug the phone back in:

# udevcontrol log_priority=debug
# tail -f /var/log/messages |grep udev &
(plug in phone)

1 comment:

Mind Booster Noori said...

Hi there, I'm considering buying one of those babies. Did you ever try using it as a modem (connect your computer to your cellphone via bluetooth and use its HDSPA connection)? More generaly, are you happy with this cellphone?

Thanks!