×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    Question Getting GPS coordinates

    Hi,

    I'm trying to make a python script run on PAMP, I installed the latest version yesterday on my N95 8GB.

    The script should fetch the positioning data and output it either in JSON or XML.

    My test code looks like this:

    Code:
    "file test.py"
    def handler(req):
    from mod_python import apache, util
     import positioning
     req.content_type = 'text/plain'
     req.encoding = "UTF-8"
     request_data = util.FieldStorage(req)
     try:
      positioning.set_requestors([{"type":"service","format":"application","data":"test"}])
      req.write( positioning.modules() )
      
     except KeyError:
      req.write("failed")
    
     return apache.OK
    Running on the server produces this output:

    Code:
    <pre>
    Mod_python error: "PythonHandler test"
    
    Traceback (most recent call last):
    
      File "c:\resource\mod_python\apache.py", line 395, in HandlerDispatch
        result = object(req)
    
      File "E:/data/apache/htdocs/PAMP/test.py", line 16, in handler
        positioning.set_requestors([{"type":"service","format":"application","data":"test"}])
    
      File "c:\resource\positioning.py", line 74, in set_requestors
        _positioner.set_requestors(requestors)
    
    SymbianError: [Errno -46] KErrPermissionDenied
    
    </pre>
    I have browsed through a lot of documentation, but without getting the help I need, so I hope someone in here might help me out. I guess the application has to be signed, but how do I do that with a python script on PAMP?

    BR Xotonium

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Getting GPS coordinates

    Hi
    Quote Originally Posted by xotonium View Post
    I have browsed through a lot of documentation, but without getting the help I need, so I hope someone in here might help me out. I guess the application has to be signed, but how do I do that with a python script on PAMP?
    It's the web-server that needs more capabilities than what is available to an application signed with a self-signed certificate.

    Currently there are no unsigned pre-built binaries with more capabilities that could be signed directly and even building the software yourself is non-trivial since there are no proper releases, but you just have to pull the source directly from SourceForge.

    A crude but simple workaround is to create a separate "location-server" application from which the Python script can ask the location.

    Johan

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    Re: Getting GPS coordinates

    Thanks for your reply!

    I have been reading your other posts about PAMP and PHP, maybe I could use these PHP modules instead? I have tried making a small php-script, but no luck.

    Code:
    <?php
    
    $pos = s60_loc_available();
    print_r($pos);
    
    ?>
    How do I ensure that I have the "Location Acquisition Daemon" on my server?

    I'm not interested in having yet another step in my line of data. I'm trying go make a widget (widsets), but if I need to get the GPS coordinates from a php-page, which is getting them from a program, then that's too much I guess. The best way would be if the widget itself could get the GPS coordinates, but that's unfortunately not possible yet.

    I have seen an example of installing a .py script from a .sis file onto the PAMP making it possible to fetch the coordinates. Unfortunately I haven't been able to figure out how to easily build a .sis file (even after hours of searching...) and how to get it working. Hopefully someone can help me out.

    BR Xotonium

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Getting GPS coordinates

    Quote Originally Posted by xotonium View Post
    How do I ensure that I have the "Location Acquisition Daemon" on my server?
    You can't, because currently it's not included in the PAMP package. I fixed that by added a comment of that to the wiki page Sorry about the oversight.

    But, since you are working with Python, perhaps you could use MWS instead of PAMP? MWS has the location capability and is signed with a "real" certificate, so the GPS location should be directly accessible from a script

    Johan

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    Re: Getting GPS coordinates

    Thanks a lot, Johan.

    I will try that as soon as I get home. I guess that's the solution. I'll post back if that's the solution.

    BR Xotonium

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Posts
    115

    Re: Getting GPS coordinates

    Hi all,

    The "easy" way out is to create a C++ app that posts location data to a folder under the web server's htdocs folder.

    Unfortunately you need the Location capability in your C++ app, meaning your C++ app would have to be Symbian Signed.

    I'll write a wiki entry about this early next week.

    petro

  7. #7
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    Re: Getting GPS coordinates

    I have found a solution for my problem.

    I have installed MWS and made a small python script doing the magic. MWS of course needs to be running on the phone, and have a static global domain name due to the fact that all traffic is routed through the Nokia Widsets gateway, but the static domain name is handled by MWS - you choose one during the signup process.

    I have written a blog post about my findings: http://www.oxpatio.com/default.aspx?id=253

  8. #8
    Registered User
    Join Date
    Mar 2008
    Posts
    12

    Re: Getting GPS coordinates

    Quote Originally Posted by jhnwkmn View Post
    Hi

    It's the web-server that needs more capabilities than what is available to an application signed with a self-signed certificate.

    Currently there are no unsigned pre-built binaries with more capabilities that could be signed directly

    hello johan,

    according to symbiansigned.com, the location cap is available. is there any plan to enable it in a PAMP package?
    it would be great to use the internal GPS from a php script...

    thanks, uno

  9. #9
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Getting GPS coordinates

    Quote Originally Posted by unoll View Post
    according to symbiansigned.com, the location cap is available.
    Yes, the location capability has recently been made grantable also to an application signed with a self-signed certificate. However, that only applies on forthcoming devices and will - to the best of my knowledge - not be made available retroactively on older devices.

    is there any plan to enable it in a PAMP package?
    Now that the whole signing process has been streamlined I will look into whether I could start using something else but a self-signed certificate for signing the pre-built binaries. Not only would that make the location capability available, but the endless number of warnings at installation time would also be gotten rid of.

    it would be great to use the internal GPS from a php script...
    Oh yes, being able to access location information on a site that is mobile is pretty crucial.

    Johan

  10. #10
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Getting GPS coordinates

    Hi,

    I have MWS installed on my phone, but when I try the racoonloc.py script I always just get a output like this

    Code:
      <?xml version="1.0" encoding="UTF-8" ?> 
    - <response>
      <lat /> 
      <lon /> 
      <accuracy /> 
      <speed /> 
      <course /> 
      <debug_gps_count /> 
      <mcc>0</mcc> 
      <mnc>0</mnc> 
      <lac>0</lac> 
      <ci>0</ci> 
      <debug_cell_count>6</debug_cell_count> 
      <id>raccoonloc_s60v3.0</id> 
      <battery_level>100</battery_level> 
      <signal_strength>7</signal_strength> 
      <profile>general</profile> 
      <calendar>free</calendar> 
      </response>
    GPS output is expect able since I am trying this inside, however I am surprised to only get zero's in mcc, mnc, lac, ci. It is my understanding that MWS should have all the required capabilities.

    I also have PAMP installed on my phone but it's not running and I haven't started it since last rebooting.

    best regards,
    Magnus

  11. #11
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Getting GPS coordinates

    Quote Originally Posted by maggias View Post
    GPS output is expect able since I am trying this inside, however I am surprised to only get zero's in mcc, mnc, lac, ci. It is my understanding that MWS should have all the required capabilities.
    Unfortunately no. Obtaining the cell-id requires the ReadDeviceData capability, which MWS does not have.

    Johan

  12. #12
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Getting GPS coordinates

    hi Johan,

    I was wondering if its possible to install the Location Acquisition Daemon (LAD) separately. Is it available as a signed .sis from somewhere? If so where can I download it? I haven't been able to find it my self.

    best regards,
    Magnus

  13. #13
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Getting GPS coordinates

    Hi Magnus,

    Quote Originally Posted by maggias View Post
    I was wondering if its possible to install the Location Acquisition Daemon (LAD) separately. Is it available as a signed .sis from somewhere? If so where can I download it? I haven't been able to find it my self.
    No, unfortunately it's not available at the moment. It obviously must be signed with something else than a self-signed certificate but having it officially signed with the Nokia certificate is not quite as straightforward as one might think, and making it available as a built but unsigned SIS does not help that much, as SymbianSigned's Open Signed Online signing procedure requires that you own the used UID.

    Br,
    Johan

Similar Threads

  1. Bluetooth GPS simulator for j2me phone
    By vgps in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-02-09, 04:30
  2. Replies: 0
    Last Post: 2003-09-24, 15:17
  3. Replies: 0
    Last Post: 2003-09-24, 15:15
  4. Display GPS coordinates on e911 capable phones
    By ulocate in forum Mobile Java General
    Replies: 0
    Last Post: 2003-09-24, 15:14
  5. GPS Lat/Long Coordinates
    By psamson in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2003-09-15, 19:50

Posting Permissions

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