![]() |
Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Hello,
is it somehow possible that internet connections are only established on demand? -> i.e. when email sync starts or the browser launches. After the task completes, the connection should be automatically closed again. On my Symbian phone this was the default setting and I liked it. I do no want to manually connect/disconnect all the time nor a permanent connection. Thanks, #9370 |
Re: internet connection on demand
I'd like that too. To be precise i'd like a staged connection, meaning i'm always connected to 2g network for im/mail, if i open an app which needs more bandwidth (browser, netradio, etc...) it first looks for known wifi and if none available connects via 3g. After i close the app it should automaticall switch back to 2g.
That's kinda how i do it now manually to get the most out of the battery and am still online most of the time, but that's kinda invonvenient. |
Re: internet connection on demand
This used to be the way things worked in Diablo, auto-connect then disconnect after some period of inactivity.
I'd also like this to be a possibility on Fremantle, however I think the designers' idea is that it should always be connected, not sure if we'll be able to do much to change their minds (other than install and use our own program/daemon to monitor network activity and perform the disconnection for us) |
Re: internet connection on demand
Well at least make it so that if an application you are going to use wants to access the internet, it comes up with 'Establish internet connection' just like S60v5 does.
It is annoying to have to go to connection each time, open the connection and then open the application. |
Re: internet connection on demand
You can find out when an application starts and stops, by listening to NameOwnerChanged signal on dbus, so it is really easy to use dbus-scripts to start a specific connection when an application starts, and disconnect from network when the application stops. Adding reference counting is less trivial, but not too hard.
For applications that keep running but need to connect only once in a while (such as mail) it is harder, probably needing some ip tricks - have a default route to some dummy interface when not connected, and initiate a real connection when something uses this interface, for example. |
Re: internet connection on demand
I was in some application (zoutube? evernote mobile?) and when I tried to use it it said that I had to be on the Internet. I knew that, but I am in my house and my WiFi is always on, my setting is Always Connect to WiFi.
So to fix it I opened up a browser or something and it then figured out I was on the Internet and let me run the application! |
Re: internet connection on demand
There are at least two bugs open to bring back disconnect-on-inactivity. Go vote for one !
|
Re: internet connection on demand
I wonder what would be considered inactivity? It seems like better control is needed over the packet network connection for sure.
But I have IM, RSS, email, weather, sip all wanting to access the internet, and so triggering "activity". None of these require 3g most of the time. The ideal management tool would allow you to define the networks that each application could run on. Wifi only, wifi+gsm, wifi+3g. This doesn't seem likely to happen so I would settle for a manual switch between packer data off, packet data gsm only, and packet data 3g (from an icon on the desktop or via status). Can this be changed from the command line - perhaps via dbus? |
Re: internet connection on demand
Quote:
Thanks, #9370 |
Re: internet connection on demand
Just set the "always ask" in the Internet connection settings and I'll ask you when you start and application that needs to be connected. You'll still need to manually disconnect.
|
Re: internet connection on demand
I would be very interested in this feature as well, if only on GSM/3G. Battery life takes a huge hit when I remain connected to the network, likely due to the radio constantly searching for signal.
|
Allow widgets/apps to automatically connect and then automatically disconnect internet connection. Possible?
Hi
I noticed that leaving my GPRS (2G EDGE, no 3G) connection on all the time drains the battery faster than when it is always off. For the widgets such as the weather application, it will only update every 4 hours when there is an active internet connection. Is there a way to set the phone to auto connect to gprs when a widget/app requests it and then automatically disconnect after transfer is complete? This would significantly improve my battery life instead of leaving gprs connected all day when it is not in use. |
Re: How to connect to the internet only when needed?
As far as I know.. There's no such thing.. I might be wrong though! :/
|
Re: How to connect to the internet only when needed?
This does not seem to be a usecase - and for sure our battery life would improve a lot or we had to click less - Nokia had in mind with this communication/facebook/youtube/flash enabled device.
But now being in the hands of real world users taking care about connection costs/battery life they might re-thing - hopefully... |
Re: How to connect to the internet only when needed?
Quote:
Go to settings, internet connections, choose "always ask", then save. To manually connect to the web, you can either tap on the web "globe icon", any bookmark site,etc. It will prompt you to connect to internet or GPRS. To connect or disconnect just tap the top screen icons (battery or 3g/2G network icon). A drop down menu will appear. Info about battery, profile, clock.alarm, internet connections, bluetooth, usb. Tap the internet connection and will give you options/selections. from there you can connect or disconnect from internet. I wish I could show you screen shots but don't know how to do screen shots. |
Re: How to connect to the internet only when needed?
Quote:
To take a scr shot, the image file is saved in /home/user/MyDocs/.images/Screenshots/ /Wheatbisc |
Allow widgets/apps to automatically connect and then automatically disconnect internet connection. Possible?
Quote:
|
Re: How to connect to the internet only when needed?
As stated many times before putting the Phone settings to GSM (2G) really is good for the battery and is good enough for calling/im.
It would be great to have an easy way to switch between 2G/3G. so you can activate 3G when needed. |
Re: Allow widgets/apps to automatically connect and then automatically disconnect internet connection. Possible?
Quote:
heres a good overview. http://www.csee.umkc.edu/csee-semina...377,6,Overview I find that my wifi consumes more power when I am out and about if I leave it on autoscan as its alwas hunting for wifi connections. |
Allow widgets/apps to automatically connect and then automatically disconnect 2G internet connection. Possible?
I should have specified, I do not have 3G only 2G edge service. Phone is set to 2g only, does not seem to automatically disconnect after weather updates etc. I can confirm that leaving my 2G EDGE connected all day reduces battery life even when not in use.
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Threads merged.
|
Re: internet connection on demand
Quote:
https://bugs.maemo.org/show_bug.cgi?id=5422 https://bugs.maemo.org/show_bug.cgi?id=6627 |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Thank you for the links.
/#9370 |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
I now created a brainstorm item for this:
http://maemo.org/community/brainstor...automatically/ Please vote for it! /#9370 |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
This would definitely improve battery life for those who only use applications that need periodic updates...
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Before I start, let me just say that I love this phone. It does however need some significant fixes and automatic connection/disconnections is certainly one of them.
I have come from an N95 and on that I had several connections defined. I had various wifi points, including my home ones and I had two 2G connections (bad 3G signal where I am). One went ahead and connected without prompt, the other I had set to ask for a password. Anything like weather, email etc. that was to be "always on" used the unrestricted internet connection. Everything else I chose how to connect, be it wifi or 2G (using the passworded connection). The phone checked my emails and whatnot and closed the 2G connection automatically. After using any other application, the connection was also closed obviously on all other wifi/2G connections. The only thing it didn't do right was to allow a connection priority profile thing (which I think the N97 does allow...?) whereby you choose wifi a, then b, then blah, then 3G then give up. The N900 should be so much more advanced at handling connections - to simply come on and stay on is really beyond basic and I can't imagine why this route was chosen. At least an inactivity auto-disconnect timer OPTION should be included. I also don't want to trust the phone to handle my 2G/3G connection as if something goes wrong and starts downloading lots of data (due to a bug/bad design/whatever) I could end up with a huge bill. I'm on a data plan but the recent firmware updates used up over 20% of my monthly allowance - all it would take is for my home wifi connection to drop out for a moment (or longer) and the phone would decide to use 3G (if the setting to allow this is ticked of course). It's not always obvious that it is happening either. The email application seems to just download emails and attachments automatically - I see no option to turn it off. I regularly get emails from clients with truly massive attachments *sigh* (100MB+). On my N95 I would just choose not to download those but have no choice on the N900 for such things - except to turn off automatic email checking - and then what's the point in the phone really? At the moment my data connection is pretty much useless when I'm out and about - there's just too little control to trust the phone with it. An OS like this should be promoting more complex options, more power to control power usage and more granular control over scenario/use profiling of ALL features. In these respects the N900 is far inferior to Symbian on the N95/N82 etc and I assume 5800/N97 and so on. This REALLY needs fixing (and yes I have voted on the bugs - can't log onto brainstorm to vote there). |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
This script should disconnect from network (wlan or GPRS/UMTS) after 5 to 10 minutes of no received packets:
Code:
#!/bin/sh |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Hmm gotta go on google to try and figure out how to use this on my n900.
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
That said, I have no idea where one would put this to be executed... on the router I have a nice simple web interface (although I've used the busybox telnet access too) for Cron Jobs and startup scripts etc. Could you help me and others out with how to install this script and also exactly which variables to change to alter settings... As far as I can tell the "sleep 300" gives the 5 minute interval... where does the 10 minute upper range come into things, or is that just assuming two loops of 5 minutes each and data occurring between minute 1-5? You're grep-ing RX.p - I assume this is received packets. Could you similarly do TX.p for transmitted to add to this script... in fact, is there somewhere you could point me like a wiki on this - I'd be interested to know more about the output from ifconfig and what you can do with it. Thanks for your help :D |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
OK, I've actually gone into this on my router now and having seen the output from ifconfig, and looked at a few guides on the web, I think I now understand the basics of grep, cut and how that's all being done. I assume the output from ifconfig is always rigidly formatted enough to rely on that then?
I'm still not sure how to get this running on the N900 though, I have not installed the thing to allow sudo gainroot yet... I'm guessing that's necessary as a first step. Where from there? |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
You create a file (say /usr/local/bin/scriptname) with this content, make sure it is executable (with a command like)
chmod a+x /usr/local/bin/scriptname First, you should run it to see if it does what you want. If you are sure you want it to start at boot time, the easiest way is probably to create a file /etc/event.d/autodisconnect, containing: Code:
description "Run a script to disconnect idle networks" It can be up to 10 minutes, if last transfer happens a few seconds after the sleep starts, because the next check will see this transfer. I believe using received makes more sense, since sometime the network appears up, but the other side is not there. In that case applications might continually send data, but nothing will be received. I don't know of a wiki explaining all this, but you seem to be on the right track for understanding. I can think of no better way to do it than looking at simple scripts, and playing with them. If you don't have a Linux desktop, search for "manual page" of each command you need to learn. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Ok, so I've gotten quite far acutally. I have tailored the script a little and after testing that it worked, have now got it installed as a startup, as per your instructions above.
Should I wish to terminate this script - what would I need to do? I have HTOP installed and was poking around with that. I'm also aware of kill and ps now, but don't know what it is I'm supposed to be killing. Should the process be listed in there with a PID? Thanks again for your help here, you've really opened up the gateway here re: linux scripting. I never knew where to start and this has been a brilliant introduction. Cheers :D ** EDIT Ok, so it didn't run. Did I need to CHMOD the file which ran the script file in the same way too? That's the only thing that I didn't do... |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Let us know if your battery life has improved with everyday usage after using the script.
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Do you mean that the script runs when you run it manually, but does not start automatically? I am not sure about the operation of the upstart system. Perhaps you need to add an ampersand after the call to the script, so the line should be:
/usr/local/bin/scriptname & Also /usr/local/bin/scriptname needs to be executable, not the file in /etc/event.d |
Re: Allow widgets/apps to automatically connect and then automatically disconnect internet connection. Possible?
Quote:
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Yes... the script runs fine manually. I can't get upstart to start it - it just doesn't work. Is there some way I could get my script to set a variable or something to show it is running? I tried using export to set a global variable but it seems to be limited to the shell in which the script is running... unless I misunderstanding (this is only my second day writing shell scripts so it could well be that! ;)
How would I go about piping the time to a text file for example, or is there a way to set a variable that I could check this way? Thanks again for your help :D |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Use something like
date >> /tmp/a.log |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
This is an interesting idea, I hate to forgetting turning wifi off before going to bed and find my phone dead in the morning.
Installed script and it works fairly good for 3G. Seems like wlan keeps sending packets although the device is idle. A more accurate way to turn connections off would be to check for user inactivity but I have no idea how to check that via a shell script. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
As it stands I have an executable script which disconnects properly and logs startup and disconnections to a text file. It executes manually without error but I just cannot autostart it. Also, does anyone know if there's a way to send a notification message from a script? I'm talking about the notifications which confirm an SMS delivery or a website's security or "code accepted" when you unlock - the pop up ones which fade & slide away automatically. Thanks again for all the help! |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Code:
run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Message goes here" |
All times are GMT. The time now is 16:58. |
vBulletin® Version 3.8.8