| Reply | « Previous Thread | Next Thread » |
|
My application gets data from remote server with urllib:
Code:
usock=urllib.urlopen("http://111.10.12.12/chk.php?imei="+imei)
us=usock.read()
However when I run this app a few times screen goes black and phone reboots. After commenting out the above lines everything works with no problem. Tested on two phones: E51 and E90. |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi pantomas
can you tell the dibo what you are trying to read using Code:
usock.read() waiting for your reply Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
I tried to open this http://111.10.12.12/chk.php?imei=123456789012345 I think you want to do a similar thing where the IMEI would be the last 15 digits in the URL. My PC browser gives me the error Quote:
Quote:
Croozeus |
|
As I said it works fine. I can read data from server many times when this application is running. When I exit app and start it again it works fine again. I exit it and start again ad still it is working fine. Then I exit it and everything goes black and the phone reboots.
Exit means I exit the app and then I exit the python shell. Python 1.4.2 croozeus: sorry I didn't mention it, this url is not real, I didn't want to expose real address gaba88: I tried three different codes (below) for data reading, they are working fine and as a result I get exactly the data the server is responding (it is a list: [21,122] ) The problem arise when I quit and run the app again Code:
url="http://190.22.22.22/chk.php?imei="+imei file="E:\\Python\\urltemp" urllib.urlretrieve(url,file) ff=open(file) us=ff.read() ff.close() Code:
parms = urllib.urlencode({'param_1': 'value_1', 'param_2': 'value_2'})
# form contents
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
conn = httplib.HTTPConnection("190.33.33.33")
conn.request("POST", "/chk.php", parms, headers)
response = conn.getresponse()
us = response.read()
conn.close()
|
|
I can't really think of something that your doing, which makes the phone to reboot after several launches.
What else does your script contain? or only this code? Best Regards, Croozeus |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi pantomas
sorry but i am also confused i am not getting the point why are you restarting the application. or is it like your application runs only for one time and when you try to run it again it gets blank. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
In everyday use one don't keep applications running all the time. Say, web browser. When I want to check something on the web I start up browser but usually i quit it when it is no longer needed.
So in my case, this app I am working on allows you to be run three times and then for unknown reason your phone reboots. Well, I am very surprised, it is not my first Symbian app. The answer for croozeus question: This is small business application that allows user to access some data from server to be edited on the phone. Really, nothing very complicated. Some menus, selection lists, local database. As I said, when I remove the urllib code this problem doesn't show. Maybe it has something to do with internet connection. There is no option to close it after retrieving data and it closes when I exit shell.
Last edited by pantomas : 2008-06-26 at 19:26.
Reason: croozeus answer
|
|
This problem appears when using wlan connection.
With GPRS connection everything works fine. Maybe it is some general problem in Symbian or in Python? |
|
Yeah. Sounds like a firmware bug. No Python application should be able to cause a device reset. Or it could be a massive memory leak in one of PyS60 modules, although Symbian OS usually catches those.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Cannot upload via urllib and read from bluetooth | tristanr | Python | 2 | 2008-04-27 15:49 |
| Sending a file from phone to webserver | wissamch | Python | 3 | 2006-10-12 10:55 |
| Memory leak within urllib, httplib and raw socket communications | _welho_ | Python | 0 | 2006-02-20 12:51 |
| Urllib | petrikoppinen | Python | 1 | 2005-04-28 23:29 |