×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    May 2008
    Posts
    53

    avoiding "select access point" message"

    hello, im trying to store my gps data and my ip into a data base on a web server. im using httplib for sending data from my phone to the server.

    conn.request("POST", "/cgi-bin/recibebasedatospython.py", params, headers)

    Each time I send one data group to the server using "request" an annoying "select access point " window appear.
    how can i avoid this? is it possible to have it permanently connected?
    That message would be fine if i would like to send data to the server once in a lot of time.
    but how about if i would like to send constant data to the server?
    i would like to send 20 times in a second my gps data to the server, is this possible? and how can i avoid this mesaage?

    thanks in advance

    oyyky

  2. #2
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    Re: avoiding "select access point" message"

    Take a look into the latest PyS60 Library Reference on Page 86.
    There u'll find everything u need.:

    Code:
    Example 1:
    #access point is selected from the list
    apid = select_access_point()
    apo = access_point(apid)
    set_default_access_point(apo)
    s = socket(AF_INET, SOCK_STREAM)
    print apo.ip()
    s.connect(('www.sourceforge.net',80))
    s.send('GET /\r\n\r\n')
    s.recv(100)
    s.close()
    apo.stop()
    
    
    Example 2:
    #Access point id is already known
    apo = access_point(1)
    set_default_access_point(apo)
    s = socket(AF_INET, SOCK_STREAM)
    s.connect(('www.sourceforge.net',80))
    s.send('GET /\r\n\r\n')
    s.recv(100)
    s.close()
    apo.stop()
    
    
    Example 3:
    #display interface ip.
    #access point is selected from the list
    apid = select_access_point()
    apo = access_point(apid)
    apo.start()
    #Note that ip-address is given by operator, if static ip-address is not defined,
    #when connection is started
    print apo.ip()
    #When connection is closed dynamic ip-address is released
    apo.stop()
    greetings
    novis

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

    Re: avoiding "select access point" message"

    Quote Originally Posted by oyuky View Post
    hello, im trying to store my gps data and my ip into a data base on a web server. im using httplib for sending data from my phone to the server.

    conn.request("POST", "/cgi-bin/recibebasedatospython.py", params, headers)

    Each time I send one data group to the server using "request" an annoying "select access point " window appear.
    how can i avoid this? is it possible to have it permanently connected?
    That message would be fine if i would like to send data to the server once in a lot of time.
    but how about if i would like to send constant data to the server?
    i would like to send 20 times in a second my gps data to the server, is this possible? and how can i avoid this mesaage?

    thanks in advance

    oyyky
    There is also a Wiki article regarding

    Setting default access point in python

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Regular Contributor
    Join Date
    May 2008
    Posts
    53

    Re: avoiding "select access point" message"

    thanks for the reply. it worked fine, now i can avoid those access points messages and send a lot of variables to the database in the server one after one... but i have one new question: what does velocity depend on?
    I made a function that adds data to the database and this function is being called constantly in the main loop of my programm. When i run the script in my phone , i can see it adds, from 1 to 3 new items in the server in one second . Why is this so slow, do this depends on my network? or is there any way of sending for example 10 or more messages in a second? maybe im doing something wrong? any hint?

    bye

    here is the code
    Code:
    import httplib
    import urllib
    from socket import *
    import e32
    
    
    #access point is selected from the list
    apid = select_access_point()
    apo = access_point(apid)
    set_default_access_point(apo)
    s = socket(AF_INET, SOCK_STREAM)
    print apo.ip()
    content = "otomoto" 
    params = urllib.urlencode({'data': content})
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
    conn = httplib.HTTPConnection("www.kplex.net")
    
    def senddata():
             conn.request("POST", "/cgi-bin/recibebasedathon.py", params, headers)
             response = conn.getresponse()
    
        
    def quit():   
            global running   
            running = False
            conn.close()
            apo.stop()
            
    
    import time
    start_time=time.clock()
    n_frames=0
    
    running = True  
    while running:
    
            
        senddata()
        e32.ao_yield()
    
        n_frames+=1
    
    end_time=time.clock()
    total=end_time-start_time

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

    Smile Re: avoiding "select access point" message"

    Quote Originally Posted by oyuky View Post
    When i run the script in my phone , i can see it adds, from 1 to 3 new items in the server in one second . Why is this so slow, do this depends on my network?
    Hi,

    The new frames added in a second depend on your connection speed, Bandwidth as well as on the server speed.

    You may try using a Wifi (Wireless Broadband) connection for better results.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

Similar Threads

  1. How to avoid the question "Select Access Point"
    By jeanmonod in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2008-04-24, 09:45
  2. "Select access point" dialog on Nokia 3250
    By Red Falcon in forum Mobile Java General
    Replies: 5
    Last Post: 2008-03-31, 10:52
  3. how to hide "select access point"
    By vxml team in forum Symbian
    Replies: 1
    Last Post: 2007-10-15, 05:12
  4. Issue with 3650 when canceling "Select access point"
    By joer25 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-04-04, 10:18
  5. Replies: 1
    Last Post: 2004-08-02, 09:08

Posting Permissions

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