×

Discussion Board

Results 1 to 3 of 3

Thread: gps help

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    13

    gps help

    i am using nokia 5800
    on that i am using python script shell 2.0
    when i run the code mentioned below on script shell it works perfectly
    Code:
    import e32, appuifw, positioning
     
    def initialize_gps():
    	'''This function initializes the GPS. The select_module(module_id) can be used to select the GPS module in this function. 
    	In this case we are using the default GPS (integrated GPS) hence we do not need to select it.'''
    	appuifw.note(u'Intializing GPS')
    	global gps_data
    	#Intitialize the global dictionary with some initial dummy value (0.0 in this case)
    	gps_data = {
    	'satellites': {'horizontal_dop': 0.0, 'used_satellites': 0, 'vertical_dop': 0.0, 'time': 0.0,'satellites': 0, 'time_dop':0.0}, 
    	'position': {'latitude': 0.0, 'altitude': 0.0, 'vertical_accuracy': 0.0, 'longitude': 0.0, 'horizontal_accuracy': 0.0}, 
    	'course': {'speed': 0.0, 'heading': 0.0, 'heading_accuracy': 0.0, 'speed_accuracy': 0.0}
    	}
    	try:
    		# Set requesters - it is mandatory to set at least one
    		positioning.set_requestors([{"type":"service","format":"application","data":"gps_app"}])
    		# Request for a fix every 0.5 seconds
    		positioning.position(course=1,satellites=1,callback=cb_gps, interval=500000,partial=0)
    		# Sleep for 3 seconds for the intitial fix
    		e32.ao_sleep(3)
    	except:
    		appuifw.note(u'Problem with GPS','error')
     
    def cb_gps(event):
    	global gps_data
    	gps_data = event
     
    def stop_gps():
    	'''Function to stop the GPS'''
    	try:
    		positioning.stop_position()
    		appuifw.note(u'GPS stopped','error')
    	except:
    		appuifw.note(u'Problem with GPS','error')
     
    #initialize GPS
    initialize_gps()
     
    #Set time for the script to run. 10 minutes in this case.
    time_to_run=10
    minutes=time_to_run*60
     
    # Print the GPS data for 10 minutes.
    while (minutes > 0):
    	print gps_data['satellites']['used_satellites'], gps_data['position']['latitude'], gps_data['position']['longitude'], gps_data['course']['speed']
    	minutes=minutes-1
    	e32.ao_sleep(1)
     
    # Stop the on-going request
    stop_gps()
    but when i convert this py file to sis file using python application packager it shows error message Problem with GPS
    and gps indicator will not come on cell
    but when i run as py file it shows gps indicator & works well


    whats the problem
    plz help


    thanks in advance

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    Re: gps help

    Might be a capabilities problem! Check if your sis application is signed or not. Or even better - check for the "Location" capability inside your code:

    if not e32.has_capabilities(['Location']):
    print "The system lacks of the needed capabilities.Sorry!\n"

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    37

    Re: gps help

    You have to set the correct capabilities.
    After that i had not to selfsign anything.

    Code:
    cd C:\Programme\PythonForS60
    C:\Programme\PythonForS60\ensymble.py py2sis D:\python\IGCLogger.py  -caps=Location+ReadUserData+WriteUserData+NetworkServices+UserEnvironment
    Last edited by telemaxx; 2011-04-03 at 09:47. Reason: quoting

Similar Threads

  1. Help Getting GPS
    By snarbay in forum Symbian
    Replies: 3
    Last Post: 2010-08-02, 20:05
  2. FLASH LITE GPS HELP!
    By echiro in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2009-12-03, 12:11
  3. Replies: 3
    Last Post: 2009-09-24, 10:34
  4. n95 gps help
    By slevin77 in forum Mobile Java General
    Replies: 4
    Last Post: 2007-10-23, 16:10
  5. GPS help me
    By kokoadi in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-24, 17:32

Posting Permissions

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