Nokia 3120 with Gnokii

Posted: Sun, 16 October 2005 | permalink | No comments

Holy $DEITY! A technical post!

So, I've finally broken down and gotten a USB data cable for my Nokia 3120, after a brief scare where I thought I'd lost the phone (along with the voluminous phonebook therein), and a desire to see if I could get a bit of GPRS narrowband data love happening.

Not wanting to boot the 4GB virus, I turned to gnokii for help. I got it working, but it was a bit of a trial.

The first thing to consider is the cable. As far as I can tell, a lot of phones aren't really capable of talking USB directly to the PC -- they're wired for (presumably) RS-232 (or some other primitive serial protocol). So, the USB cable that you get will quite possibly have a USB-to-serial chip built in to it. The popular DKU-5 cable supposedly has a pl2303 chip in it (supported by the module of the same name), but the "current model" cable is the CA-42, which has a chip supported instead by the cdc_acm module in Linux 2.6 (2.6.10, at least, which is what I'm running). I've got the CA-42 cable, so these instructions are based on that, but I'm led to believe that the DKU-5 is somewhat similar.

A side-effect of having hardware in the cable itself is that the cable is detected as soon as you plug it in to the computer, even if there's no phone connected. This weirded me out for a bit, but is nothing to worry about.

So, you plug in the cable, and it should be autodetected. The dmesg command will tell you exactly what went on. The cdc_acm module should create a ttyACM0 (or ttyACMN, anyway) device node for you in /dev. Remember this -- you'll be seeing this material again.

So now the time comes to play with Gnokii. I installed the version from Ubuntu Hoary, which I'm running on my desktop, but quickly gave that away as Google told me that much better support was to be had in newer versions (0.6.8 being the latest and greatest). I was persuaded, and whipped up a quick backport from the current Debian sid package.

Next, we configure Gnokii. Despite having plenty of comments, the example config file is a little short on useful tips for a complete ph0ne n00b like me, but after a fair bit of trial and error, I got things sorted out. Relevant settings in my ~/.gnokiirc:

port = /dev/ttyACM0
model = 3120
connection = dlr3p

That's pretty short configuration-wise, but let me tell you it was a trial to get those two settings sorted out.

To take the third setting first, the connection setting is more than a bit weird. The default is serial, which I suspect is only for rooly trooly 9-pin D-connector serial ports -- not pseudo-serial USB cables. There is a huge comment block above this setting in the config file, and none of it made the slightest sense to me, so I just played until I got it right. I suspect that dlr3p is the setting to use for all USB cables, but I can't be sure.

The second setting (model = 3120) won't actually work unless you patch your Gnokii with the patch I just submitted to Debian. (Presumably this patch will end up in Gnokii upstream at some stage). It's a fairly trivial patch. Practically, I think you could put another compatible model number (like 5140) in the config file and it'd work OK, but I'm a neat sort of person.

The port setting is a simple derivation from the device file created when the USB cable was plugged in. If you're using a DKU-5 cable, I think you'll need /dev/ttyUSB0 instead.

Post a comment

All comments are held for moderation; markdown formatting accepted.

This is a honeypot form. Do not use this form unless you want to get your IP address blacklisted. Use the second form below for comments.
Name: (required)
E-mail: (required, not published)
Website: (optional)
Name: (required)
E-mail: (required, not published)
Website: (optional)