You can find here some open-sources, free modules for PyS60, a S60 version of the Python interpreted language.



The source code of all these modules is available here

The extended gsm location extension is now available for 1.9.x version thanks to the86hitman (Forum Nokia member). See elocation download section.

Important note: Due to platform security restrictions on Symbian S60 3rd edition devices, you need to sign these packages before installing and using them on your phone. To sign them, please use the Symbian Signed Open Signed Online-method. More help about signing process on Patrick Frei website



Wlan Scanning module

List WLAN (WiFi) networks in Python from your phone

>>> import wlantools
>>> wlantools.scan()
[{'Capability': 1073, 'BeaconInterval': 100, 'SecurityMode': 'Wep', 'SSID': u'MESHDV_CLIENT', 'BSSID': u'00:20:A6:58:0F:9E', 'ConnectionMode': 'Infrastructure', 'InformationElements': {32: u'00', 42: u'00', 221: u'00037F010100240000', 50: u'3048606C', 7: u'4E4149010B1B'}, 'SupportedRates': u'82848B0C12961824', 'Channel': 8, 'RxLevel': -48}]
>>>
>>> # To ignore Information Elements present in beacon frame use:

>>> wlantools.scan(False)
[{'Capability': 1073, 'BeaconInterval': 100, 'SecurityMode': 'Wep', 'SSID': u'LIP6-guest', 'BSSID': u'00:19:A9:FE:09:A0', 'ConnectionMode': 'Infrastructure', 'RxLevel': -63, 'SupportedRates': u'82848B0C12961824', 'Channel': 1}]
>>>

Some help about the data returned:

  • Capability: Capability field of the IEEE802.11 beacon frame, please read IEEE 802.11 Standard
  • SupportedRates: Supported Rates Information Element of the IEEE802.11 beacon frame, please look at IEEE 802.11 Standard: 7.3.2 Information elements
  • Channel: DS Information Element of the IEEE802.11 beacon frame. It represents the channel (1-14) on which access point operates. Please look at IEEE 802.11 Standard: 7.3.2 Information elements
  • BeaconInterval: Interval in miliseconds between two beacon frames
  • SecurityMode: Open, Wep, 802.1x, Wpa, WpaPsk or Unidentified
  • ConnectionMode: AdHoc, Infrastructure, SecureInfra, Unknown
  • SSID: ESSID of the access point
  • BSSID: MAC address of the access point
  • RxLevel: Reception level in dBm
  • InformationElements: If True or nothing passed to the scan() function, this field contains a dictionary. key is the Element ID and value is the hexadecimal payload.

Projects using this module :

Extended GSM location module

Location module from PyS60 does not give enough informations about the CelId the phone is locked on, here is an improvement to get more informations (Technology used, Name of the operator...)

This modules needs to be signed with, at least, the capabilities: ReadUserData, ReadDeviceData, Location.

>>> #Phone in GSM mode
>>> elocation.extended_gsm_location()
{'NetworkId': u'10', 'NetworkAccessTechnology': 'GSM', 'NetworkStatus': 'Current', 'NetworkMode': 'GSM/GPRS or DCS1800 network', 'CountryCode': u'208', 'AreaCode': 4101, 'ShortName': u'', 'LongName': u'F SFR', 'CellId': 15742, 'DisplayTag': u'SFR'}
>>> #Phone in UMTS (3G) mode
>>> elocation.extended_gsm_location()

{'NetworkId': u'10', 'NetworkAccessTechnology': 'UMTS', 'NetworkStatus': 'Current', 'NetworkMode': 'WCDMA', 'CountryCode': u'208', 'AreaCode': 5400, 'ShortName': u'', 'LongName': u'F SFR', 'CellId': 7547952, 'DisplayTag': u'SFR'}
>>>
>>> elocation.get_registration_status()
'RegisteredOnHomeNetwork'
>>>
>>> elocation.get_imsi()
u'20801000000000100'
>>>

Some help about the data returned:

by the function elocation.extended_gsm_location()

  • NetworkStatus: Indicative (you cannot acces other networks seen by the phone currently, the network seen is the onne you are locked on)

    • Unknown: Status is unknown
    • Available: A network that the mobile device is allowed to register to
    • Current: Currently registered network
    • Forbidden: A network that the ME is not allowed to register to
  • Network Mode: CTelephony::TNetworkMode

    • Unregistered: Mobile device is not registered
    • GSM/GPRS: GSM/GPRS or DCS1800 network
    • AMPS: AMPS network
    • IS-95: CDMA (IS-95) network
    • CDMA2000: CDMA (cdma2000) network
    • WCDMA: WCDMA (UTRA Frequency Division Duplex (FDD)) network
    • TD-CDMA: TD-CDMA (UTRA Time Division Duplex (TDD)) network
    • Unknown: Network mode is unknown
  • NetworkId: Identification number of the network operator (The network identity, NID in CDMA and MNC in GSM)

    • Example: in France, SFR is 10, Orange is 1
  • CountryCode: Identification number of the country (network MCC)
  • AreaCode: Location area code, (can be different for each operator in the same area)
  • DisplayTag: The alpha-tag of the network operator
  • For GSM/WCDMA Networks:

    • Network Access Technology: CTelephony::TNetworkAccess

      • GSM: The access technology is GSM
      • GSM COMPACT: The access technology is GSM COMPACT. However GSM COMPACT systems which use GSM frequency bands but with the CBPCCH broadcast channel are considered as a separate access technology from GSM
      • UMTS: The access technology is UTRAN (UMTS Network)
      • Unknown: This is used when there is no network activity and therefore no RAT active
    • CellId: The cell identity code
    • ShortName: The short name (up to 8 characters) of the network operator
    • LongName: The long name (up to 16 characters) of the network operator
  • For (Td)CDMA Networks:

    • BandInfo: Mobile phone network band information. Example: 800MHz Band C
  • For AMPS and (Td)CDMA Networks:

    • CdmaSID: On CDMA networks, the system identity (SID) of the CDMA or AMPS network

by the function elocation.get_imsi()

Returns a string composed of the International Mobile Subscriber Identity of the SIM card in the phone.

by the function elocation.get_registration_status()

Return a string indicating the status of the phone registration on the cellular network. See Symbian documentation CTelephony::TRegistrationStatus.

  • ERegistrationUnknown: Registration status is unknown.
  • ENotRegisteredNoService: Not registered. The ME can not detect any other networks and is not currently searching a new operator to register to.
  • ENotRegisteredEmergencyOnly: Not registered. The ME can detect other networks on which it is possible to make emergency calls only.
  • ENotRegisteredSearching: Not registered, but the ME is currently searching a new operator to register to.
  • ERegisteredBusy: Registered, network busy.
  • ERegisteredOnHomeNetwork: Registered on home network.
  • ERegistrationDenied: Registration denied.
  • ERegisteredRoaming: Registered, roaming.

GPS module

Easy way to get data from an internal GPS on Nokia platforms (S60)

This modules needs to be signed with, at least, the capabilities: Location.

Note: This module is deprecated since Nokia released an official positioning module.

Please refer to the Forum Nokia discussion board for more details (Thread about location API).

Help: get and build the sources

    Sources are either available as a mercurial repository of a compressed archive (repository snapshot).

Getting the SDK and plug-ins

To build a module you need the Nokia S60 SDK fitting to your phone (please look here and PyS60 sources.  .
Moreover, if you want to build the wlan scanning module you will need to download the SDK API Plugin to get the headers of the Wlan Management API.

Building the sources

The next step is to move the modules sources into the PyS60 sources and build them using the example batch file given in the repository.
Feel free to contact me if you encounter any problem.