Wednesday, December 29, 2004

Mobile Python under Mac OS X

Well I've been playing with Python for Series 60 for a couple of hours now, and I'm in love. It is so much easier to use than Java ME to do the stuff I want to do that I've already hacked up a couple of quick useful applications, and I can see possibilites for eSTAR as well. After using the application I'm guessing the reason that Nokia went with Python rather than Perl is the console, it seems to make sense to have it around. Apart from PDL Perl doesn't really have a console, although it'd be pretty trivial implement one...

For those of you who might be interested in developing on Mac OS X, it looks like the only useful thing we're missing is the py2sis application from the SDK which is a Windows only tool.

If you're interesting in using the Bluetooth console facility to develop directly on the phone under Mac OS X, this is fairly trivially done. First of all you need to create a serial port that the bt_console.py script on the phone can connect to using the Bluetooth Serial Utility which is found in Applications > Utilities. Then you need to run a terminal emulation program on you Mac to monitor your newly created port, I'm using ZTerm to do that. Then just run the bt_console.py script on your phone as normal.

Update: I've now got xmllibrpc.py and PyBlogger working under Python for Series 60. Wasn't particulaarly hard to do either, which suprised me...

Update: A version of Perl for Symbian/Series 60 has now been released...

8 comments:

  1. Woot! Thanks a lot for the Zterm pointer, I had looked everywhere and couldn't find a good terminal emulator for Mac. Now I can develop on the Mac as easily as I can on the PC! Hooray!

    ReplyDelete
  2. Anonymous12:31 am

    ZTerm will work, but you can use bt_console with the standard Terminal.app by redirecting the port using 'screen'. The short explaination is that you set up a Serial Port, give it a name (like 'foo'), open a Terminal, and run this: "screen /dev/tty.foo". Use "control-d" to quit, and "control-a control-\" to close 'screen'.

    I posted a short summary on setting it up here: http://www.eriksmartt.com/blog/archive/2005/01/02/115.html

    Cheers!

    ReplyDelete
  3. Anonymous1:23 am

    Thanks for a nice post, it really made my day. No searching for terminal software, more fun with python

    -- Jussi

    ReplyDelete
  4. Anonymous1:37 am

    I didn't need to use Bluetooth Serial Utility - I already have /dev/cu.Bluetooth-PDA-Sync, and that's wher the bt_console connection shows up. I don't know if that's due to having prior PDA configuration done, though.

    Another option for serial support is the unix verison of Kermit - might be more useful than zterm or screen for talking to the session under emacs, for example. (Uisng screen is a neat trick, though :-)

    ReplyDelete
  5. Tiger doesn't include Bluetooth Serial Utility. The solution I've found that works is using kermit instead. It's freely available.

    ReplyDelete
  6. Anonymous2:44 am

    True, Bluetooth things in Tiger are in a bit different place than on Panther, but all the functionality is still there. Just take a look at the System Preferences > Bluetooth.

    The screen trick still works as using the cu.Bluetooth-PDA-Sync, if available. Now there's a even a new alpha of the s60-python, happy happy, joy joy. :)

    -- Jussi

    ReplyDelete
  7. For that windows only app of the python set, take a look at

    http://darwine.opendarwin.org/index.php

    It RUNS windows apps, without that emulation thinggy of Virtual PC

    ReplyDelete
  8. Erik's post about using the bluetooth console with Mac OS X seems to have changed its URL...

    http://www.eriksmartt.com/blog/archives/55

    ReplyDelete