Python For Symbian: PyS60usb

Improved PyS60usb module 

This is improved version of pys60usb made by Simo Salminen so all thanks goes to him. I only added new parameters to connect() -function. This is based on the version 20060101.  If you find bugs from this version, post them here.


Well, now I can connect to PC with my N70 using the same port used by PC-Suite. This was not possible previously without killing the FaxModem process from the device. The connection also caused exceptions all the time when it checked the connection status. Usually the status indicates something that is really not an error so it was hard to use it with I did only small changes and it seems to work nicely now. It should raise exception only when cable is disconnected. Should work on both S60 and UIQ.

Note: It seems that with UIQ devices the mRouterRuntime sometimes messes things up and the COM ports are not available on the PC. Try to kill the mRouterRuntime process using task manager.



Grab the sources here.

Changed files

  • python/phone/
    • Tries to find a working access method

  • Readme.txt
  • symbian/src/bld.inf
  • symbian/src/ConnManager.cpp
  • symbian/src/ConnManager.h
  • symbian/src/pys60usb.cpp


Symbian 70s


    Just unzip, send to phone and copy the pys60usb.pyd to c:\system\libs\ using FExplorer or some other filemanager. Contains updated


Only new stuff here 


New attributes for defining access mode and connection role see TCommRole and TCommAccess.

  • From TCommAccess
    • ECommExclusive, ECommShared, ECommPreemptable
  • From TCommRole
    • ECommRoleDCE, ECommRoleDTE

USBConnection::connect( port=0, port_type=u"ACM", mode=ECommShared, role=ECommRoleDCE )

Previously connect() didn't take any parameters and 'mode' was ECommExclusive.

  • port
    • Used port number. Some devices have more ports available than others.
    • Type: int
  • port_type
    • Type of the port. I don't know if there are any other than ACM but I parametized it anyway.
    • Type: unicode
  • mode
  • role
    • Role of the connection. See TCommRole
    • Type: int


import pys60usb
usb = pys60usb.USBConnection()

# Connect to port 1. Works with most S60 3rd devices.
usb.connect( port = 1, mode = pys60usb.ECommExclusive )