×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Unhappy PyS60 + Location cap + Opensigned help

    Hi all,
    I'm new to PyS60 development. I would like to build a basic GPS Location based application using Google Maps' static API. (Any advice or py resource on this would be awesome by the way) I know I need the Location capability signed on the sis file, and I also need to build a Stand Alone sis, so users don't need to install the runtime first. I built the first sis from the Application Packager.
    I'm developing for S60 3rd Edition and above.

    I supposedly mergesis'd the Python sis and my app. but I'm still getting the following on installation:
    A "Unable to Install. Constrained by the Certificate" error, and also a "Component 'Python Runtime' missing." warning.

    So, I have two questions:
    What could be the problem with the first error?
    If I merged the "PythonForS60_1_4_3_3rdEd.sis" file, shouldn't I avoid the second warning?
    Thanks in advance!

    My testing code:
    Code:
    from httplib import HTTP
    import location
     
    latitude = 0
    longitude = 0
     
    def doLookup(cellId, lac, host = "www.google.com", port = 80):
      from string import replace
      from struct import unpack
      page = "/glm/mmap"
      http = HTTP(host, port)
      result = None
      errorCode = 0
     
      content_type, body = encode_request(cellId, lac)
      http.putrequest('POST', page)
      http.putheader('Content-Type', content_type)
      http.putheader('Content-Length', str(len(body)))
      http.endheaders()
      http.send(body)
      errcode, errmsg, headers = http.getreply()
      result = http.file.read()
      # could need some modification to get the answer: here I just need
      # to get the 5 first characters
      if (errcode == 200):
        (a, b,errorCode, latitude, longitude, c, d, e) = unpack(">hBiiiiih",result)
        latitude = latitude / 1000000.0
        longitude = longitude / 1000000.0
      return latitude, longitude
     
    def encode_request(cellId, lac):
      from struct import pack
      content_type = 'application/binary'
      body = pack('>hqh2sh13sh5sh3sBiiihiiiiii', 21, 0, 2, 'in', 13, "Nokia N95 8Gb", 5,"1.3.1", 3, "Web", 27, 0, 0, 3, 0, cellId, lac, 0, 0, 0, 0)
      return content_type, body
     
    (mcc, mnc, lac, cellId) = location.gsm_location()
    (latitude, longitude) = doLookup(cellId, lac, "www.google.com", 80)
    print latitude
    print longitude
    EDIT: If I redo the whole process, merge with Python .sis and then sign with the Emulator IMEI (00000..), I get: "Certificate Error. Contact the App. Supplier"
    Last edited by kuroizero; 2009-11-04 at 18:31.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: PyS60 + Location cap + Opensigned help

    Hi,

    In what order did you specify the files when you merged them? According to Ensymble's documentation:
    The "mergesis" command takes a set of SIS files and inserts them as unconditional embedded SIS files in the first one. The resulting SIS package is then signed with the certificate provided. None of the certificates of the first SIS file are preserved.
    So you should specify your sis file and then the Python runtime sis.

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Re: PyS60 + Location cap + Opensigned help

    Oops, I was doing it wrong . Thanks for the super quick reply!

    One question, is it mandatory to merge it with PythonForS60_1_4_3_3rd_Ed.sis if my target cellphone is an N95 (Or S60 3rd Edition and above with GPS)? When I try to sign it online, I get "Submitted .sis file uses a UID that is not allocated to the account holder matching this email address (0x2000b1a6 )" from OpenSigned.

    All I need right now are the Location caps and to be able to run it as a stand alone. What would you recommend would be the best sis to merge my app with?
    My apologies if these questions are too basic, I'm still a noob on PyS60 development

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: PyS60 + Location cap + Opensigned help

    Well, in order for any Python application to work the Python runtime has to be present on the phone. It can either be installed separately or, more conveniently if you're distributing the app to other users, as part of your application's sis file. Mergesis is pretty much the only way to combine sis files. The runtime sis file is signed by Nokia with more capabilities than are accessible via Open Signed Online, so all you have to sign is your application. Do you get that "Submitted .sis file uses a UID that is not allocated to the account holder matching this email address (0x2000b1a6 )" error when trying to sign your application (and by that I mean your sis that was previously merged with the runtime sis)?

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Red face Re: PyS60 + Location cap + Opensigned help

    Yes, I tried merging and then signing. I will try the opposite tomorrow at work.

    So, please correct me if I'm wrong. The correct development process for an N95 should be:

    1. develop myApp.py
    2. convert myApp.py to myApp.sis with all the capabilities (--caps=+Location+...), UID, certificate (automatically generated for early stages)
    3. sign myApp.sis from Open Signed Online
    4. merge the signed myApp.sis with PythonForS60_1_4_3_3rdEd.sis with the emu IMEI or my testing cellphones' IMEIs
    5. Try to install onto the target cellphone/emu

    Are 4 and 5 interchangeable? What is the difference?
    Is there a newer Python release I can merge with myApp.sis?

    One final question, in order to deploy my app once it is finished, I need to pay the $300 on Symbian Signed in order to get a valid certificate and UID, right? Is there anything you would recommend for this whole process?
    Thanks for all your help so far! It's been really useful!

  6. #6
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,801

    Re: PyS60 + Location cap + Opensigned help

    Quote Originally Posted by kuroizero View Post
    4. merge the signed myApp.sis with PythonForS60_1_4_3_3rdEd.sis with the emu IMEI or my testing cellphones' IMEIs
    5. Try to install onto the target cellphone/emu

    Are 4 and 5 interchangeable? What is the difference?
    They aren't interchangeable, you mean to merge them after installing it on the phone?
    Quote Originally Posted by kuroizero View Post
    Is there a newer Python release I can merge with myApp.sis?
    There is PyS60 1.9.7 which is the latest one but you might have compatibility issues as your application is written for 1.4.3. However, you could still use the latest in 1.4.x series - PyS60 1.4.5!
    Quote Originally Posted by kuroizero View Post
    One final question, in order to deploy my app once it is finished, I need to pay the $300 on Symbian Signed in order to get a valid certificate and UID, right?
    300$? A publisher id costs 200$ and a content id costs 20$. UID is free but you need to get one for your company/registered account with Symbian Signed.
    Pankaj Nathani
    www.croozeus.com

  7. #7
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: PyS60 + Location cap + Opensigned help

    Quote Originally Posted by kuroizero View Post
    3. sign myApp.sis from Open Signed Online
    4. merge the signed myApp.sis with PythonForS60_1_4_3_3rdEd.sis with the emu IMEI or my testing cellphones' IMEIs
    5. Try to install onto the target cellphone/emu
    Try signing the resulting sis again at Open Signed Online (remember, none of the certificates of the first SIS file are preserved).

  8. #8
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Red face Re: PyS60 + Location cap + Opensigned help

    Hi there, I decided to stop wating time on signing stuff and reinstalled Python on my N95
    PythonScriptShell_1.9.7_high_capas.sis + Python_1.9.7.sis

    I'm now trying to test a basic GPS positioning script, but it stays waiting forever when I call positioning.position()
    It doesn't even leave the try. Any suggestions?
    Thanks!

    Code:
    import positioning
    
    print "LOCATIONING MODULES \n"
    print positioning.modules()
    print "DEFAULT MODULE \n"
    print positioning.default_module()
    print "POSITIONING MODULE INFO DEL DEFAULT MODULE\n"
    print positioning.module_info(positioning.default_module())
    
    # positioning.select_module(positioning.default_module())
    
    positioning.set_requestors([{"type":"service",
    "format":"application",
    "data":"test_app"}])
    
    
    print "GET POSITION WITH A BLOCKING CALL\n"
    try:
        print positioning.position()
    except:
        print "IT DIED ON THE BLOCKING CALL\n"
    
    print "END\n"

  9. #9
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: PyS60 + Location cap + Opensigned help

    Quote Originally Posted by kuroizero View Post
    Hi there, I decided to stop wating time on signing stuff and reinstalled Python on my N95
    PythonScriptShell_1.9.7_high_capas.sis + Python_1.9.7.sis

    I'm now trying to test a basic GPS positioning script, but it stays waiting forever when I call positioning.position()
    It doesn't even leave the try. Any suggestions?
    Thanks!

    Code:
    import positioning
    
    print "LOCATIONING MODULES \n"
    print positioning.modules()
    print "DEFAULT MODULE \n"
    print positioning.default_module()
    print "POSITIONING MODULE INFO DEL DEFAULT MODULE\n"
    print positioning.module_info(positioning.default_module())
    
    # positioning.select_module(positioning.default_module())
    
    positioning.set_requestors([{"type":"service",
    "format":"application",
    "data":"test_app"}])
    
    
    print "GET POSITION WITH A BLOCKING CALL\n"
    try:
        print positioning.position()
    except:
        print "IT DIED ON THE BLOCKING CALL\n"
    
    print "END\n"
    hello Kuroizero

    if you want to use GPS i will suggest you to go through this article at the wiki apart from that do fix your GPS separately atleast once so that you get the co-ordinates quickly.

    Regards

  10. #10
    Registered User
    Join Date
    Oct 2009
    Posts
    7

    Question Re: PyS60 + Location cap + Opensigned help

    1. Sorry about the noobie question, but what do you mean by "fix your gps"?
    I tried the script but I'm only getting the info from the function initialization (0.0 for every variable).
    2. Another question: Do I need to have Internet service (data plan) with my SIM card in order to use this script?

    Thanks a lot for your help!
    Last edited by kuroizero; 2009-11-09 at 17:31.

  11. #11
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: PyS60 + Location cap + Opensigned help

    Quote Originally Posted by kuroizero View Post
    1. Sorry about the noobie question, but what do you mean by "fix your gps"?
    I tried the script but I'm only getting the info from the function initialization (0.0 for every variable).
    2. Another question: Do I need to have Internet service (data plan) with my SIM card in order to use this script?

    Thanks a lot for your help!
    hello kuroizero

    answer to your first question by "Fixing the GPS" i mean before using GPS in your mobile try getting the GPS co ordinates separately in your device using the inbuilt application given by nokia.

    Second question yes AFAIK and i have used that you need to have a data plan to get the GPS coordinates.

    Hope this helps you.

    Regards,

Similar Threads

  1. New to Python for S60 (PyS60)? Read this first!
    By croozeus in forum Nokia N9
    Replies: 2
    Last Post: 2008-10-17, 19:23
  2. s60 3rd ed emulator crash
    By Kimau in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-06-18, 22:12
  3. location and signing pys60
    By jwevandijk in forum Symbian
    Replies: 6
    Last Post: 2007-12-09, 12:00
  4. where is python location on mobile phone
    By lb213_2000 in forum Symbian
    Replies: 1
    Last Post: 2007-11-05, 08:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×