Thursday, January 07, 2010

No Nokia PC Suite on the Mac? Try Gammu!

With almost every mobile device I've had, the amount of freedom to run arbitrary software (especially software you've written yourself) has been low. Obviously needlessly low, too.
I once bought a USB datacable for my old Sagem X-5 to upload ringtones and Java programs without having to upload them to a webserver and download them with the Sagem over WAP/GPRS. I got ringtones working, but it turned out that it was impossible to upload Java programs over the cable.
Why? Well, there's no apparent technical reason for it - but it works out in the operator's favour, forcing you to download (from yourself) over their very expensive data service - at that time, it cost €0.02 per kilobyte with Meteor, which works out at €20.48 per megabyte, a shocking waste of money!

Similarly, when I bought my Nokia 6230i back in 2006, I soon discovered that while it could download Java applications with no problem, it was impossible to install them via its MMC card. The JAR/JAD would appear in its filesystem browser, but it would declare it an "unrecognised format".
Nokia did, however, release a package called the Nokia PC Suite, which was a reasonably comprehensive tool for doing lots of different things with the phone, including the installing of Java programs. And it worked via data cable and Bluetooth. Great!

Except that now, I don't have a Windows PC (at least, one with Bluetooth or a data cable). And it only runs on Windows (surprise!). My Macbook has built-in Bluetooth and can send files via the built in utilities, but the same "unrecognised format" issue pops up.

So that was the end of my frustrating search, until yesterday... enter Gammu!

This open-source program comes with a host of features for working with different types of phones, including my 6230i, and I was able to upload and install a Java application to the phone with Gammu over Bluetooth, finally!
What's the catch? Well... Gammu itself is a command-line tool so installing a program looks like:

Jehannum:Downloads oisin$ gammu nokiaaddfile Application Bart1.4
[snip debug warnings]
Searching for phone folder: *********
Information: Declared JAR file size is different than real. Fixed by Gammu.
Adding "Bart" version created by Bart
Writing JAD file: 100 percent
Writing JAR file: 100 percent


And Gammu uses a textual configuration file - mine looks something like:

Jehannum:~ oisin$ cat .gammurc
[gammu]

port = 00:16:BC:xx:xx:xx
model = 6230i
connection = bluerfphonet
synchronizetime = no
logfile = /Users/oisin/gammu.log
logformat = textall
use_locking = no


The port value can be found in Apple's "Bluetooth Explorer" in Devices->Show Device Discovery (cmd-D), under your phone's name (but replace the hyphens with colons).

Also you have to build the program from source which requires installing CMake and MySQL, but these have automated installers which caused no brainache. Getting Bluetooth to work required a small fix to one of the build scripts, but this has since been fixed so the latest version should work out-of-box.

So, if you have a Mac and a phone which requires Windows-only software to install applications, try Gammu.


. o O ( Now if I could only find a simple way to upload programs of my choosing to my iPod Touch without having to jailbreak the thing or pay Apple, again :/)

3 comments:

  1. Hi, did you use the source package to install gammu on the mac. I have been looking for instructions for installing on a a Mac and they are all Linux commands. What commands did you use in the terminal to install gammu? Thanks, Petra

    ReplyDelete
  2. Hi Petra,

    I just followed the Linux commands, IIRC. There were a few problems with missing libraries and tools (probably cmake was the big one), so some had to be installed via MacPorts/Fink and some manually.
    Pity I didn't record the sequence of commands required - but then, I'd have to edit out 90% of it due to my dumb mistakes :D

    It does take a bit of effort to get building, but it's possible!

    ReplyDelete
  3. Just installing the most recent snapshot now (1.27.95):

    Jehannum:x oisin$ tar jxf ../gammu-1.27.95.tar.bz2

    Jehannum:x oisin$ cd gammu-1.27.95/

    Jehannum:gammu-1.27.95 oisin$ mkdir build

    Jehannum:gammu-1.27.95 oisin$ cd build

    Jehannum:gammu-1.27.95 oisin$ ./configure
    Wrapper script for configuring CMake for Gammu.
    [...]
    -- Looking for IOBluetoothDeviceOpenRFCOMMChannelSync in /System/Library/Frameworks/IOBluetooth.framework - found
    -- Using OSX Bluetooth stack
    -- Bluetooth support enabled
    [...]
    -- Generating done
    -- Build files have been written to: /Users/oisin/Downloads/x/gammu-1.27.95/build-configure

    Jehannum:gammu-1.27.95 oisin$ make
    make -C build-configure
    Scanning dependencies of target string
    [ 1%] Building C object helper/CMakeFiles/string.dir/string.o
    [...]
    Linking C shared module _gammu.so
    [100%] Built target python_gammu

    Jehannum:gammu-1.27.95 oisin$ sudo make install
    Password:
    make -C build-configure install
    [ 1%] Built target string
    [...]

    Jehannum:gammu-1.27.95 oisin$ gammu version
    [Gammu version 1.27.95 built 12:23:55 on Jul 11 2010 using GCC 4.0]


    So once all the libraries are installed (I think sqlite3 was enough for database needs - looks like I don't have postgresql or MySQL), compilation should be straightforward enough. Good luck!

    ReplyDelete