User Tools

Site Tools


balloon:cellphone
Untitled Document

Cellphone Model: Using Nokia 6210 Navigator

Download

Install

1. Install Nokia PC Suite 2. Install PythonForS60_2.0.0_Setup.exe 3. After install PythonForS60_2.0.0_Setup.exe, check “C:\Program Files\PythonForS60\PyS60Dependencies” directory and then click below files to install.

  • Python_2.0.0.sis
  • pips.sis
  • PythonScriptShell_2.0.0_high_capas.sis

Packaging

Python script can execute on the python interpreter from cellphone. If you want to make sis package, use Pys60 Application Packager program.

sign application: http://library.developer.nokia.com/Community/Wiki/How_to_sign_an_unsigned_application

Manual

Get my gps information

http://pys60.garage.maemo.org/doc/s60/position-example.html

# note: your phone must have the 'Location' (GPS data /position) application on, 
# and receive satalite data in order to make this script work. (can be problematic indoors).
import messaging
import positioning

positioning.select_module(positioning.default_module())
positioning.set_requestors([{"type":"service",
                             "format":"application",
                             "data":"test_app"}])

def send_sms_myposition(phone_number):
    result = positioning.position()
    #print 'all gps data: ', result    
    coordinates=result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    print 'mylatitude: ', mylatitude
    print 'mylongitude:', mylongitude
    messaging.sms_send(phone_number, str(mylatitude) +' '+ str(mylongitude))
    
send_sms_myposition("01094378282")
# Example 2. Non-blocking call
def cb(event):
    print "---"
    print event
    print "---"

print "***starts the position feed***"
print positioning.position(course=1,satellites=1,callback=cb,interval=500000, partial=0)
import positioning
import messaging
import httplib, urllib
import time
import e32
import sysinfo
 
NOSIGNAL = 0
PHONE = "01094378282"
position_queue = []
 
 
integrated_gps_module = positioning.modules()[2]['id']
positioning.select_module(positioning.default_module()) # Assisted GPS
#positioning.select_module(integrated_gps_module)
positioning.set_requestors([{"type":"service",
                             "format":"application",
                             "data":"test_app"}])
 
def send_position(result):
    print "sending position"
    coordinates=result["position"]
    mylatitude = coordinates["latitude"]
    mylongitude = coordinates["longitude"]
    myaltitude = coordinates["altitude"] or '0'
    #current_time = time.ctime()
    satellites = result["satellites"]
    current_time = satellites["time"]
    print "--------------"
    print satellites
    print 'current time: ', current_time
    print 'mylatitude: ', mylatitude
    print 'mylongitude: ', mylongitude
    print 'myaltitude: ', myaltitude
    messaging.sms_send(PHONE, str(current_time) +' '+ str(mylatitude) +' '+ str(mylongitude) + ' '+ str(myaltitude))
    params = urllib.urlencode({'time': str(current_time), 'latitude': str(mylatitude), 'longitude' : str(mylongitude), 'altitude' : str(myaltitude)})
    headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
    conn = httplib.HTTPConnection("donghee8.com:4567")
    conn.request("POST", "/", params, headers)
    conn.close()
    e32.ao_sleep(10)
 
def callback_position(result):
    print "occur callback"
    if sysinfo.signal_bars() != NOSIGNAL:
        while position_queue:
            _result=position_queue.pop(0)
            send_position(_result)
        send_position(result)
    else:
        print "queuing result"
        position_queue.append(result)
 
def get_ballon_position():
    #result = positioning.position(callback=send_position, interval=2000000) # 2 sec
    positioning.position(course=1, satellites=1, callback=callback_position, interval=60000000, partial=0) # update rate 60 sec , partial=0 is using fixed location.
 
print "OSSI High Altitude Ballon!"
get_ballon_position()

Reference

balloon/cellphone.txt · Last modified: 2012/01/20 01:59 by dongheepark