You Are Here:

Community: Developer Discussion Boards

#1 Old Exclamation PyS60 GPRS connectivity issue - 2008-01-31, 21:18

Join Date: Jan 2008
Posts: 10
dani2mobile
Offline
Registered User
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...
Reply With Quote

#2 Old Re: PyS60 GPRS connectivity issue - 2008-02-01, 15:33

Join Date: Jan 2004
Posts: 369
Location: Helsinki
Send a message via Skype™ to miohtama
miohtama's Avatar
miohtama
Offline
Regular Contributor
Probably you need to set default access point before using socket functions outside localhost. Please refer to PyS60 documentation.


Mikko Ohtamaa
Twinapex Research
http://www.twinapex.com
Reply With Quote

#3 Old Re: PyS60 GPRS connectivity issue - 2008-02-02, 07:45

Join Date: Jan 2008
Posts: 10
dani2mobile
Offline
Registered User
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}
Reply With Quote

#4 Old Re: PyS60 GPRS connectivity issue - 2008-02-02, 12:45

Join Date: Jan 2004
Posts: 369
Location: Helsinki
Send a message via Skype™ to miohtama
miohtama's Avatar
miohtama
Offline
Regular Contributor
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
Twinapex Research
http://www.twinapex.com
Reply With Quote

#5 Old Re: PyS60 GPRS connectivity issue - 2008-02-02, 17:42

Join Date: Jan 2008
Posts: 10
dani2mobile
Offline
Registered User
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
Reply With Quote

#6 Old Re: PyS60 GPRS connectivity issue - 2008-02-03, 07:33

Join Date: Jan 2008
Posts: 9
dumpling.ch
Offline
Registered User
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
Reply With Quote

#7 Old Re: PyS60 GPRS connectivity issue - 2008-02-03, 12:36

Join Date: Jan 2008
Posts: 10
dani2mobile
Offline
Registered User
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
Reply With Quote

#8 Old Re: PyS60 GPRS connectivity issue - 2008-02-04, 16:12

Join Date: Jan 2008
Posts: 9
dumpling.ch
Offline
Registered User
Can you use your serve browser goto google.com ?

Maybe change a website and try ...
Reply With Quote

#9 Old Re: PyS60 GPRS connectivity issue - 2008-02-04, 18:42

Join Date: Jan 2008
Posts: 56
roidayan
Offline
Regular Contributor
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()
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
GPRS Support in Nokia PC Suite Connectivity API 3.0. sspiffusa PC Suite API and PC Connectivity SDK 1 2007-11-02 19:16
Problem with GPRS connectivity corej2me Mobile Java Networking & Messaging & Security 0 2005-08-21 16:18
Nokia PC Connectivity能否链接到cdma手机上发送短信和其他操作? bborn Web Technologies and Multimedia Content- Web 技术和多媒体内容 2 2004-05-04 12:06
Emulator connectivity issues (GPRS) nikola_mitrovic Mobile Java Tools & SDKs 4 2003-09-26 21:18
Connectivity between a websever and GPRS Modem akj_77_mobile PC Suite API and PC Connectivity SDK 0 2003-04-08 07:39

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia