Installing PyS60
From OpenSource
Python for S60 can be installed both in your phone and in the S60 emulator environment.
The instructions on this page assume you want to install the latest testing version of PyS60. Version 1.2.0 has a different installation procedure. You can download it from this page in Forum Nokia. A "Getting Started" guide for that version is included.
Contents |
Determining the S60 version
Installable binary PyS60 packages have two version numbers:
- version of the PyS60 release (e.g. "1.3.1")
- version of the S60 platform the package is intended for (e.g. "2nd Edition Feature Pack 2")
Different releases of the S60 platform require different builds of PyS60. You must use a build of PyS60 that is compatible with the S60 version of your phone and your S60 SDK.
See this page to determine which version of S60 your phone runs. This visual guide to recognizing the correct version is also nice, but not up to date for 3rd Edition devices.
Phone installation
For pre-3rd edition phones
- Download the latest PythonForS60 and PythonScriptShell package from the SourceForge project page or maemo garage. Make sure you get the correct versions for your S60 version.
- Install first the PythonForS60 package and then the PythonScriptShell package.
For 3rd edition phones
- Download the latest SIS packages of the Python for S60 runtime and the PyS60 Script Shell from the SourceForge project page or maemo garage.
- Install first the PythonForS60 package and then the PythonScriptShell package.
- The Python script shell for 3rd edition will list anything it finds in a "Python" folder on C: or E: drives in the "Run Script" list. Luckily, you can write the E: drive directly from a Mac or a PC. So here are step-by-step instructions:
Via USB cable (PC or Mac)
- Put a memory card in the phone
- Connect phone to computer with cable.
- KEY STEP Select the "Data Connection" mode on phone screen.
- On a Mac the contents of the memory card are now mounted. On a PC, Win XP, you need to choose to see the card with Explorer.
- KEY STEP You're now in fact on the phone's E: drive. Create a "Python" folder.
- Put any .py files in the Python folder you now have, unmount the filesystem cleanly and detach the cable.
- Open Python application, and choose Options. "Run Script" command will see the uploaded script.
Via Bluetooth (Mac only tested so far)
Switch on Bluetooth on the Phone. Launch the "Bluetooth File Exchange" utility application on the Mac. Pair with the phone, and test the Bluetooth connection by pushing over some small text file or sound. Then choose the "Browse Device" command, and browse drive E: on the phone. You can now use the utility to create a "Python" folder on the Phone's E: drive and then to push your .py source files to the phone.
Via Bluetooth (NOKIA E70, and maybe other 3rd edition phones. Mandriva Linux/Gnome)
Problems are : no "browse device" capability (maybe I don't know how), and the phone don't recognize .py send over bluetooth as a special file. You can not specify neither where the message will be stored, nor what to do whith it.
Solution : use a file format which allow you to do that sort of thing.
Steps (Mandriva/Gnome using standard Gnome config: nautilus, file-roller, gnome-bluetooth) :
1. on the phone, create a "Python" folder on the memory card (phone's E: drive) with the phone's file manager;
2. on the computer, compress your '.py' file as a ZIP file (nautilus: just right click on the file and choose the 'compress' menu entry; default parameters should be ok);
3. send the zip to your phone (nautilus: right click, choose "send to", then select your phone in the bluetooth part);
4. on the phone, open the message. "ZIP Manager" application automatically handles it: "open"/"copy". Choose "open", select you .py in the uncompressed archive, and use the nokia "option" key to display the contextual menu : use the "extract" menu entry. You can now browse your phone's folders, to save the file in your "Python" folder.
That's it (and you can now suppress the bluetooth message).
Via Memory Card
Connect the miniSD card to a PC (windows or Mac). Create a directory, such as Python or Python/Libs or whatever. Copy python scripts (and libraries) to the directory. Put card in phone. It will show up as e: drive. In python, add the directory to the search path:
import sys
sys.path.append('e:\python\libs')
These scripts can be used as libraries and imported as usual.
The miniSD cards can be placed into the miniSD to SD holder and this can be placed in a USB compact flash card reader, or one can get a usb dongle that directly takes a miniSD card (I got one from ATP -- it also came with a 1 GB miniSD card and the USB reader)
Direct download
You can also directly download the software on your phone and install it without using a PC. The steps are as following:
Phones tested with direct download : Nokia E90, N73
1. Download Python runtime for S60. Installation will start automatically
2. Choose if you want to install on the phone memory or memory card
3. Download PythonScriptShell package. Again, intallation will start automatically.
4. Choose the same media (phone or memory card) as for the runtime package.
5. Enjoy Python on your S60!
Important note for 3rd edition phone users
Certain PyS60 services (such as the location service, which require the Location, ReadUserData and ReadDeviceData capabilities) are capability-dependent, which means that all applications using these services must inherit the capabilities themselves. In other words: if the location.gsm_location() call keeps returning "None" when using the PyS60 Script Shell in a 3rd edition phone, please consider using a SIS signing service such as the Symbian Signed.
- Download the SIS packages as described in this Section.
- Sign the SIS package of PythonScriptShell for your phone, and install this instead of the (unsigned) package. Please note that, if you've signed the PythonScriptShell package Open Signed Online service, the signed file will only install in the phone with the IMEI code you've specified in that page form.
Emulator installation
Typically you would want to install the SDK for the same S60 version as your phone runs, but if you want to experiment you can install any version of the SDK you want (as long as PyS60 supports it, that is).
- Download and install the S60 C++ SDK from Forum Nokia. Here's a direct link that may or may not still work.
- To install the 3rd Edition SDK (and possibly previous versions) you need to have installed Active Perl and have a newish Java Runtime installed as well JRE
- After unzipping the downloaded S60 SDK (S60_3rd_Ed_SDK_FP2_Beta_b.zip at this time) run setup.exe in the root directory of the unzipped file. After the core install it asks if you want to install CSL ARM Q1C Toolchain if you don't have it installed.
- Download the latest PyS60 SDK ZIP package that matches your S60 C++ SDK version from the SourceForge project page or maemo garage. E.g. if you installed the 3nd Ed FP2 SDK download PythonForS60_1_4_1_SDK_3rdEd.zip.
- Unzip the package. It contains another zip package: sdk_files.zip and an uninstaller script. The sdk_files.zip package file structure maps to the Emulator install file structure you previously installed and just needs to be unzipped and placed in the corresponding directory detailed below.
- You must not use Cygwin unzip to extract files from sdk_files.zip. Otherwise, trying to open the Python application may result in "System Error (-23)" message. I would suggest you unzip sdk_files.zip into a temp directory using Windows Explorer, then moving the contents to directory that contains the epoc32 directory of your S60 C++ SDK. E.g. for 2nd Ed FP2 you would unzip sdk_files.zip in the directory "c:\symbian\8.0a\s60_2nd_fp2\epoc32", for 3rd Ed FP2 the default directory is "c:\Symbian\9.3\S60_3rd_FP2_Beta\epoc32".
- Start the S60 Emulator "All Programs > S60 Developer Tools > 3rd Edition FP2 SDK > C++, Beta > Emulator"
- Wait..... It takes a while to start up the first time your firewall may pick up the epoc.exe process asking for server rights as well, that is to be expected. Eventualy you will see the main Phone screen and Icons, you can watch the epoc.exe process bouncing about if you get bored while you wait, don't be tempted to click on the power switch of the phone until all the icons are there, just wait.
- Click on the Phone Menu key on the left, use the cursor keys or click on the phone GUI to highlight Installations, click on the center phone button, highlight the Python application, Click Open, you should get a splash screen giving the version.
- Click on Options > Run Script c:ball.py, the demo should run!
- The sample scripts are located in "C:\Symbian\9.3\S60_3rd_FP2_Beta\epoc32\winscw\c\python" this is where you can put your scripts and they will appear in the Emulator.
- You can create a sub directory called "lib" under the python directory and this will get picked up in the search path if you have modules to add.
- NOTE: From experience so far, although the Emulator picks up new files without having to restart the whole emulator I have found it best to restart the Python application to make sure changes to existing scripts are picked up.
Installation troubleshooting
If you run into problems and solve them, please write about it here!
"Certificate error. Contact the application supplier"
Your phone may not be configured to accept installation of self-signed SIS packages. See this page for details on how to fix it. Note that some operators have disabled the installation of self-signed apps so you may not be able to change those settings.
"Check if the following components are installed: Python Runtime and PIPS Library"
You need to install the S60 SDK add ons Open C/C++ Plug-ins for S60 3rd Edition. If you do not have the SDK installed, find pips_nokia_1_3_SS.sis on the Internet, for example here.
Setting up the Bluetooth Console
More info
If you have any installation tips to share or useful discussion board links, then please add them here!
- Information and experimentation in spanish: http://django.cjbarroso.com.ar/
