×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    10

    Exclamation PyS60 GPRS connectivity issue

    Hi .. is this a bug or my code is buggy ???
    This is my code:

    Code:
    import os
    import appuifw, socket
    import e32
    import httplib, urllib
    
    filename = u'c:\\goal.txt'
    urllib.urlretrieve(u'http://www.danihome.dnsalias.org',filename)
    data = file(filename)
    f = data.read()
    data.close()
    appuifw.app.title = u'go4it on Mobile'
    appuifw.app.body = appuifw.Canvas()
    i = f.find('title')
    while i != -1:
    j = f.find('title',i + len('title') + 1)
    k = f.find('reminder_type',i)
    l = k + len('reminder_type') + 1
    str = f[i+ len('title') + 1:j-2] + ' is ' + f[l: f.find('/>',l)]
    appuifw.note(unicode(str), 'info')
    i = f.find('title',j + len('title') + 1)
    
    os.remove(filename)

    I am running it as script in my pys60 interpreter [pyS60_1_4_1 on Nokia N73] ...
    I am getting 'Connection Timed out Error' always even for google.
    However I am able to access the URL {even the one in my code} via web browser

    Whats the issue ...???
    Thanks in advance...

  2. #2
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: PyS60 GPRS connectivity issue

    Probably you need to set default access point before using socket functions outside localhost. Please refer to PyS60 documentation.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    10

    Re: PyS60 GPRS connectivity issue

    Hi .. I tried running the same script in S60 emulator with pys60 installed ... My script works perfectly fine in it ... So I think I must configure my N73 in some way to allow GPRS access for applications. My N73 device is able to access url through it web browser. Any ideas ???

    When I run the script on device it asks me to choose an access point .. So probably setting it as default may not solve the issue i guess {maybe i am wrong anyways gonna give a try}

  4. #4
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: PyS60 GPRS connectivity issue

    Quote Originally Posted by dani2mobile View Post
    Hi .. I tried running the same script in S60 emulator with pys60 installed ... My script works perfectly fine in it ... So I think I must configure my N73 in some way to allow GPRS access for applications. My N73 device is able to access url through it web browser. Any ideas ???
    You need NetworkServices capability to make outgoing connections from your phone. But that shouldn't be problem if you run your app through Python shell.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    10

    Re: PyS60 GPRS connectivity issue

    Quote Originally Posted by miohtama View Post
    You need NetworkServices capability to make outgoing connections from your phone. But that shouldn't be problem if you run your app through Python shell.
    Hi ... I had run the script from my python shell only and moreover even urllib.urlopen(u'http://www.google.com') fails in the python shell ... same 'connection timed out' error ... well of course the url is accessible from device browser

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    9

    Re: PyS60 GPRS connectivity issue

    wap2net need a proxy, first u may know your wapgate, and do not use urllib.

    Code:
    r=urllib.FancyURLopener(proxy).open(url).read()
    buc'z it's too slow!

    if u want to download a file, u may try httplib 'GET'
    this's what u want:
    http://discussion.forum.nokia.com/fo...ad.php?t=77722

  7. #7
    Registered User
    Join Date
    Jan 2008
    Posts
    10

    Re: PyS60 GPRS connectivity issue

    Quote Originally Posted by dumpling.ch View Post
    wap2net need a proxy, first u may know your wapgate, and do not use urllib.

    Code:
    r=urllib.FancyURLopener(proxy).open(url).read()
    buc'z it's too slow!

    if u want to download a file, u may try httplib 'GET'
    this's what u want:
    http://discussion.forum.nokia.com/fo...ad.php?t=77722
    Hi ... I have used the code given here
    http://discussion.forum.nokia.com/fo...ad.php?t=77722[/QUOTE]
    but no luck again ...

    getting the following error
    Code:
    connect: (10.10.1.100, 9401)
    send:u'POST http://www.google.com\r\nAccept-Encoding: identity\r\n\r\n'
    reply: 'HTTP/1.0 503 Service Unavailable\r\n'
    header: Content-Type: text/vnd.wap.wml
    header: Proxy-Connection; close

  8. #8
    Registered User
    Join Date
    Jan 2008
    Posts
    9

    Re: PyS60 GPRS connectivity issue

    Can you use your serve browser goto google.com ?

    Maybe change a website and try ...

  9. #9
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    56

    Re: PyS60 GPRS connectivity issue

    if you want to use the wap/3g portal access then the connection needs to use the proxy server of your operator.
    i use:
    con = httplib.httpconnection("my.operator.proxy",8080)
    con.request("get","http://some.site.i.want.com")
    res = con.getresponse()
    data = res.read()
    con.close()

Similar Threads

  1. GPRS Support in Nokia PC Suite Connectivity API 3.0.
    By sspiffusa in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2007-11-02, 18:16
  2. Problem with GPRS connectivity
    By corej2me in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-08-21, 15:18
  3. Emulator connectivity issues (GPRS)
    By nikola_mitrovic in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2003-09-26, 20:18
  4. Connectivity between a websever and GPRS Modem
    By akj_77_mobile in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2003-04-08, 06:39

Posting Permissions

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