maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Connect to Internet on demand & disconnect automatically, particularly for GPRS? (https://talk.maemo.org/showthread.php?t=38832)

fatalsaint 2010-01-28 22:16

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Quote:

Originally Posted by jmk (Post 500077)
So stop this ******** talk and just code disconnect automatically applet and make me really happy. Could be done very easily maybe in one day.

So why haven't you done it yet?

stopgap 2010-01-29 13:28

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
In my opinion the N900 should offer the best of both worlds, not force "always on" as the only option.

I don't use Skype; it's not crazy to think people might only wish to initiate a call out on Skype and never receive incoming calls (from their mobile at least). I have a Skype account and I know that there's the odd friend who one day I might want to call via it, but even having it on sending minimal data and using battery however small is still a waste.

I don't have any live widgets that use the net - tried Foreca and Facebook but took them off when they proved not to be that useful. As such, I just don't need a connection there for that.

Here however is where my problem actually lies and stops me from just being a run-of-the-mill "battery Nazi" ;) The main thing I use it for, apart from web browsing is email. The email client has no options for "download headers only" or really any options of any sort that a modern email client should feature. I get sometimes 100 emails a day with big attachments from clients. Last week alone I was sent nearly 800MB in attachments which is 300 more than my allowance for a month. Because the N900 downloads these without asking first, I can't leave it on mobile data because it'd cost me a fortune in data charges (for no good reason!). I still want and need my emails on auto-check (as my N95 managed perfectly) so it has to be wifi - which does use a lot of power when idling. It also annoyingly means I can't get email automatically when out and about - grr!

So here is at least one good reason for auto disconnecting after use. I don't need my connection on always, only when I'm using it and Nokia should never have provided this phone with its limited power without at least the option to be sometimes on".

Someone mentioned Nokia are releasing a version of N900 with bigger battery - is there any repeatable evidence for this or is it just from one of the numerous speculation sites around the net?

Finally - I've nearly finished my disconnect script... just been too busy this week to work on it properly - as almost everything I'm doing is new (I'm a PC programmer... just getting in to linux due to this phone) so it takes longer. At the moment I'm just overcoming problems of too many instances of the script being loaded and delaying of a connection being made due to stuff I was doing (wrong no doubt!) :)

slender 2010-01-29 13:40

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Quote:

Originally Posted by jmk (Post 500077)
I can get 3-4 day battery life when using 2g/3g switcher and wifi-switcher on/off.'

So stop this ******** talk and just code disconnect automatically applet and make me really happy. Could be done very easily maybe in one day.

Things like $, £, € will probably help.

stopgap 2010-01-29 14:00

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Quote:

Originally Posted by farnwomt (Post 499471)
Just a couple of other points

1) phonet is interesting, but I am not entirely sure if it is the best device to check for activity. In my experience it handles packets even when there is no connection in place. It may be that it is better to look at something like gprs0 (or whatever device is created when you are connected) as that will definitely relate to genuine traffic.

2) Using ifconfig is ok, but it is probably slightly more demanding than it needs to be. You can get the same result from the file /proc/net/dev, using something like

c=`grep wlan0 /proc/net/dev | awk '{ print $10 }'`

One of the joys of this option is that if you want to look for something like gprs devices it doesn't matter if they don't exist as you won't get an error.

3) The original script attempted to disconnect even if there was no current connection. I would consequently suggest that you could find out how you are currently connected by doing this ...

connection=`tail -1 /proc/net/route | cut -f1`

This would set the variable connection to be 'wlan0' or 'gprs0' or whatever you are using, or 'Iface' if you aren't connected. You could use this information to only look at the live connection for new packets. I am assuming in writing this that only one interface will be active at a time, so if you use something like 'openvpn' you would have an issue. Having said that products like openvpn tend to send regular packets anyway so you wouldn't be able to close your connection very easily.

Hopefully this information will be of help?

Thanks farnwomt, that looks very helpful indeed. I'm taking a look at those things now - cheers :D

jmk 2010-01-29 21:12

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
So anyone working on this idle disconnect applet now really hard? That should not be really hard to do.

Just simple shell script and control panel applet that can turn off/on 3G/WIFI idle disconnect script.

Everybody needs this feature and no one wants always online device so hurry up!

fatalsaint 2010-01-29 21:25

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Quote:

Originally Posted by jmk (Post 501646)
So anyone working on this idle disconnect applet now really hard? That should not be really hard to do.

Just simple shell script and control panel applet that can turn off/on 3G/WIFI idle disconnect script.

Everybody needs this feature and no one wants always online device so hurry up!

And I'm still waiting for your app.... once it's in extras-devel I'll be sure to paste it anywhere I see people ask.

stopgap 2010-01-29 23:29

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Quote:

Originally Posted by jmk (Post 501646)
So anyone working on this idle disconnect applet now really hard? That should not be really hard to do.

Just simple shell script and control panel applet that can turn off/on 3G/WIFI idle disconnect script.

Everybody needs this feature and no one wants always online device so hurry up!

You know what to do then... if it's so quick and easy to do why not do it yourself rather than wasting time here complaining.

pillar 2010-01-30 08:05

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Of course it would be nice to have 'always online' device, but with this kind of battery and for some the costs, it's not feasible option. If it works for you - then be happy. If not - let us figure out another way to use this great device. Isn't that the idea of an open device anyhow?

This is the functionality that would fit me the best:

- If the device is not connected to 3G / Wlan and some application requests a connection - instead of popping up a dialog, it would automatically look for 1) Wlan connections already setup and working 2) 3G and activate the either one - Wlan preferably.

- If the device is connected, it would look for a setting, which would define an idle time limit and disconnect after the said time limit has been reached. This idle limit could be different for Wlan and 3G.

This way - I can be 'online when it matters' but not worry that my battery is wasted and then when I really need to go online, I cannot since the battery has died on me.

I don't see any drawbacks in this kind of behavior either. If you want to be always online, fine. If you want to connect and disconnect after 5 minutes, fine. If you want to disconnect after 30 minutes, fine too. Each for his/her own.

Thanks to all of you that are working towards making these kind of use cases possible.

egoshin 2010-01-30 23:12

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
The problem is an incoming traffic. For exam - somebody calls YOU via skype. If device shut down connection then... well, Telco can do it for MMS, but they don't like Skype/SIP/GTALK/etc - you don't pay THEM.

So, if you want to have connection to world, you can't disconnect from it.

pillar 2010-01-31 14:00

Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
 
Well, if I want to be available in skype then I put that online and the idle timeout never occurs. I don't see the problem. And again, if you want to be online all the time, be my guest. All I'm saying is that there might be other use cases and a support for those would be nice as well.


All times are GMT. The time now is 20:47.

vBulletin® Version 3.8.8