![]() |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
That is up to you.
There are two basic approach to use N900 - use it as ACCESS device then you don't need an access to you from outside. In this case you can just set it "offline" in "Availability" button (not "Offline mode" - it switches of your cellphone totally ... battery lasts weeks). In this mode your batter would last around 48h, I estimate. The second approach - stay connected with net/people as possible. In this case you want receive skype/gtalk/email and think about battery. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
There is another approach - have the device do what the user wants, which in this case is to disconnect from network after a certain period of inactivity. If you do not this behaviour, you don't have to read and comment in this thread, as the title of this thread makes its content very simple. Why come here and try to convince people they don't know what they want?
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Hey all - I suppose this is a similar question (I don't want to start a new thread and couldn't find it elsewhere), but is it also possible for the internet access to be turned off at certain times? I know there's an app to turn off cell data and leave internet on (which is great), and there's this script here to disable internet after no activity, but I really want to disable internet at night time only. I'd still want to receive calls... Think this is possible? A button would of course be handy as with the cellular modem data button...! Any thoughts?
|
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Well... hello everybody.
I don't know if you are still interested in a workaround for this (and a very simple one at that). But reading the codes previously posted here, and via trial and error, I've managed to get a code that works and starts automatically. Sorry 3g guys, my carrier isn't compatible with the n900 frecuency and therefore I can't see how does 3g behaves, maybe someone can adapt my code. Instructions here: 1) Code:
vim /usr/local/bin/autodisconnect Code:
#!/bin/sh Code:
chmod a+x /usr/local/bin/autodisconnect Code:
vim /etc/event.d/autodisconnect Code:
description "Run a script to disconnect idle wi-fi" 7)Enjoy! Credits to matan for the script in event.d. And to farnwomt for some of the lines there. A few notes here. This script checks every 60 seconds until it finds an established wi-fi connection, it does nothing until then. I'm using grep wlan0 /proc/net/dev | cut -c 8-12 because even when not in use, the wi-fi sends and receives about 1 packet every 30 seconds or so. These are very small packets (most ranging in 30-250 bytes I believe). So what I did was to ignore the last 3-4 digits (depending on how many bytes the device has received since boot-up) in the bytes received and use that as a reference, given that most internet sites are big enough to be about 1-10 kb at least. Not sure how does it behave along with IM (I don't know if IM can receive at least 10kb every 3 mins). For those that decide to test it, it shoud disconnect after 3 mins, but in a bad scenario (unlikely) it should be 6 mins, and in a very bad scenario (very unlikely) it should be 9 mins. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Is anyone willing do thy that? |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
@azstunt: i tried your script because thats exactly what I was looking for. Unfortunatly it does not disconnect my wlan.
with "ps" i see 2 instances of the script running and there is "sleep 180" there also. so i think it recognizes the established connection. but it does not disconnect, waited for 30 minutes or so. my messengers are offline and mfe-setting is to check every 60 minutes. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Code:
#!/bin/sh |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
I have to admit I dont fully understand your script. so do I change every sleep 10 to sleep 180 for normal use? what about the sleep 5? change to 60? then erase all echos-lines to surpress output? anything else to delete? |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Quote:
Code:
#!/bin/sh Now test if it works when being autostarted. |
Re: Connect to Internet on demand & disconnect automatically, particularly for GPRS?
Could someone do 3G compatible version of this. Change wlan0>gprs0 etc. and edit cuts?
Maybe this script should run only when connected like this /etc/networks/if-pre-up.d/ or /etc/networks/if-up.d/ to start every time a network interface is upped. And someone should make simple control panel applet to turn this script on/off. Like wifi-switcher check the source code. |
All times are GMT. The time now is 11:29. |
vBulletin® Version 3.8.8