![]() |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
See here: http://wiki.maemo.org/User:Jebba/DBU...d-notification
Replace $1 with your message. But this is the type that does not go automatically. Replace SystemNoteDialog with SystemNoteInfoprint and don't include the last uint32:0 string:'NAO OK!' |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
I've spent some time on this script and refined it a little:
*It now only does anything if there's an active connection. *It logs startup and disconnections to a file in mydocs/tmp *It notifies you onscreen when disconnecting *It distinguishes between wifi/cellular connections I still cannot get it to autostart though - I don't get what I'm doing wrong. I have an entry in /etc/event.d as suggested and have tried everything I can see - to no avail. Ideally it needs to start once the desktop is up and loaded properly... any ideas anyone? Here's my script for anyone who wants it :) Code:
#!/bin/sh |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Add an echo into some file to the event.d file, so you can know if the commands in this file run at startup.
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
appreciate your effort please let us know when your done :D
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
or add the script to /etc/networks/if-pre-up.d/ or /etc/networks/if-up.d/ to start every time a network interface is upped. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Yeah, that'd be ideal to launch it when the network starts but I'm way out of my limited knowledge of linux here...
I took a look in if-up.d and saw there were some scripts in there. I tried to put my own in but it didn't seem to run. The others were named 00_something - maybe my test had a malformed naming for execution within that folder or perhaps I'm misunderstanding how that works... I can't find anything clear on this area on the web... What is there is linux specific - I'm not even sure if thats completely appropriate for all versions of linux, let alone maemo... I'm a Windows programmer so this is all rather unfamiliar to me to say the least! Ideally I'd launch the monitor script with some handle, upon network up and then use the handle to terminate on network down (with the handle - if that's even how linux works?) Any idea how, or does anyone know of any useful guides on this sort of stuff? I sort of got it to auto-run on startup but something is not right and the script seems to freeze up or something, it stops working anyhow. I can see it running in HTOP still just doesn't seem to do anything. Incidentally does anyone know how to use HTOP?... its functions use Fx keys and I'm not sure how you do that in a maemo console... |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
You would probably do better to use transmitted rather than received packets because most networks will have some general chatter on them even if they are only occasional broadcast messages and those packet could keep your network connection up even if you aren't responding to them.
Perhaps the best solution is actually to check if both RX and TX have changed? |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
I'll post it when I have a proper working script here for people to test :) |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
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? |
Why N900 doesn't automatically disconnect when I'm done?
Every phone I used somewhat disconnected from the web/wi-fi when I close the browser, email, or whatever app that was using internet connection but the N900 doesn't. For example, if I used 3g to browse then close the browser it takes hours to disconnect from tmobile 3g by itself. If I used wi-fi to browse or check emails, it doesn't disconnect when I'm done with email app. 3G disconnects after a while I guess but wi-fi never disconnects and drains the battery. Anybody else notice this?
|
Re: Why N900 doesn't automatically disconnect when I'm done?
It's not supposed to disconnect. That's why they marketed it as an 'always on' device with the slogan 'online as it happens' and provide widgets that are dependent on a constant connection. :)
|
Re: Why N900 doesn't automatically disconnect when I'm done?
I'm not quite sure what you mean.. and I don't know about the N900 .. but on my G1 (android) if I am connected to WiFi it stays connected until I actually tell it to disconnect.....same for 3G.. it's "always on" 3G unless I tell it to use the smaller Edge network..
Otherwise.. it would have to constantly connect/disconnect every time I open up a new app that requires internet.. which would slow me down.. I would personally be kind of annoyed if my phone kept "guessing" for me when i wanted and didn't want the internet.... what if you have a widget or email app that updates a lot? |
Re: Why N900 doesn't automatically disconnect when I'm done?
Wow, I've NEVER had a phone do that. Android, WinMo, iPhone/Touch/iPad? nope. They have inactivity timeouts, possibly, but instantly? Nope. Not for cellular data, and not for wifi.
Which device do you have that does that? |
Re: Why N900 doesn't automatically disconnect when I'm done?
my most recent phone iphone 3gs disconnects from wifi as soon as I put it into standby. If you have a 3gs you can do this by putting it in standby/sleep while connected to wifi then wake it up. You'll see 3g for few seconds before reconnecting to available wifi thus saving battery.
I also had a N97 before the N900 and 3g connection would disconnect when I close the browser. While I was browsing I see a circular symbol with arrow indicating that I was using 3g/3.5g connection but as soon as I close the browser that symbol goes away but on the N900 it doesn't. Does this make sense? I'm trying to find a way to automatically connect to network when I need but disconnect when I don't to optimize my battery life. I don't want a phone that is constantly connected and draining battery when I don't need to. |
Re: Why N900 doesn't automatically disconnect when I'm done?
Your most recent phone iphone 3gs doesn't support Skype, Google Talk or you didn't switch it on. It is just one example why idea of automatic disconnection doesn't fly here.
|
Re: Why N900 doesn't automatically disconnect when I'm done?
When you put the iPhone into standby, it's far more powered down then the n900. This is a "feature" in apple marketing speak.
You can leave the 3g connected all the time, I do. No battery issues. Wifi, I'd go ahead and turn on/off as needed. |
Re: Why N900 doesn't automatically disconnect when I'm done?
Quote:
The N900 would work this same way.. it just may not change the icon to show actual activity. In either case, you're always connected to the 3G, you're just not always sending and receiving data... Never used an iPhone to know "standby" is... do you get phone calls in that mode? You'd have to be on 3G or EDGE to at least get phone calls.... a connection simply has to be maintained somewhere.. |
Re: Why N900 doesn't automatically disconnect when I'm done?
My n95 used to ask me whether I wanted to disconnect whenever I closed whatever was connected, so I wasn't 'online as it happens'. That's part of what I love about the n900 - no scrubbling for a connection. Just open the email/browser/app and I'm online. The n95 used to ask me which connection to use as soon as I opened something, which was a pain.
|
Re: Why N900 doesn't automatically disconnect when I'm done?
As a Nokia 5800 owner I have also noticed the same problem, the only option I have found is to disconnect wi-fi/3g each time I have finished using the web/email etc a bit time consuming/annoying but at least it means my battery lasts a full day now, rather than just until the late afternoon. I have also noticed all the apps on the phone continuously check the internet and so eat into my internet usage when I am away from my wi-fi connection.
Surely somebody could produce a simple app to disconnect when each app using the wi-fi/3g is closed? |
Re: Why N900 doesn't automatically disconnect when I'm done?
Quote:
|
Re: Why N900 doesn't automatically disconnect when I'm done?
Quote:
|
Re: Why N900 doesn't automatically disconnect when I'm done?
Actually, if discard some bugs, there is no sense in disconnection 3G. it was designed for low-powered devices in mind and it doesn't consume real energy while not transmitting. Moreover, IPv4 infrastructure for 3G was also redesigned a little to prevent some excessive packets.
It is an application activity which consumes a battery but cutting it off is your deliberate decision. Besides browser there are many applications in full-powered Linux which talks to world. If you think about battery it has sense to consider minimization of that activity. WiFi is a little different, it has some excessive traffic from router (depends from network) and that stuff is absolutely useless. Moreover, there is bug related with it then wifi chip or driver doesn't recognize some chip feature then periodic beacon signal can be handled by chipset. That forces a periodic wifi rescan and reconnection and it consumes a lot of energy. But it is a bug and can be fixed. |
Re: Why N900 doesn't automatically disconnect when I'm done?
Thanks egoshin for that explanation. I also would like to have an "always connected" device but I also want a device that will last me the entire day. Hopefully these bugs can be worked out so I don't have to monitor my network activities throughout the day.
|
Re: Why N900 doesn't automatically disconnect when I'm done?
Upon searching I did find this brainstorm... and also several references to a "2g/3g switch toggle" app that should already be out there.
|
Re: Why N900 doesn't automatically disconnect when I'm done?
I think that there should be an option for the user to set so that the phone can be "always connected" or "connected while using web browser" Functionality like this could both be helpfull for users who are battery consupmtion nazis, and for people who simply dont want to always be connected, lets face it, even though it has the advantages of being "always on/connected" not everyone utilizes the device to that extent. Thats just IMO though =D
|
Re: Why N900 doesn't automatically disconnect when I'm done?
I added a desktop app that shows your ip, its a simple way to let you know you are disconnected if there is no ip addresses. And manually selecting network connection before doing any online stuff.
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
The thread "Why N900 doesn't automatically disconnect when I'm done?" with seventeen posts has been merged into this thread.
|
Re: Why N900 doesn't automatically disconnect when I'm done?
Quote:
Since I stopped routinely leaving Skype, SIP and YahooIM accounts active throughout the whole day whilst using a 3G connection, my battery life has improved significantly. |
Re: Why N900 doesn't automatically disconnect when I'm done?
Quote:
The weather widget and email account - it seems pointless having an always connected device when the battery can't cope unless it's plug into the charger - I assume this is why Nokia are aleady releasing a new version with a bigger battery? My Nokia 5800 will check the internet at reguler intervals and then disconnect automatically but as far better battery life anyway. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
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. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
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!) :) |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
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! |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
|
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. |
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. |
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 11:39. |
vBulletin® Version 3.8.8