![]() |
Re: [Announce] Auto2G: A battery saver script for the N900
Quote:
I use dbus-scripts, it's a daemon a bit like cron but for dbus. So I add a rule to dbus-scripts, that rule watch for a wifi connection or deconnection signal. Just follow the instructions of the install/configuration doc at the beginning of the following script and copy the script in a file /home/user/bin/w32g : Code:
#!/usr/bin/perl |
Re: [Announce] Auto2G: A battery saver script for the N900
@JohnLF
Hum yes, I'm more a perl guy but that's a good idea, I could try to do that in python. Could be fun. And to add a GUI, you can just create a conf file and the script called by dbus-scripts can read that file And this is very easy to package. |
Re: [Announce] Auto2G: A battery saver script for the N900
2 Attachment(s)
Quote:
You must copy the file w32g.py.txt (see below attached files) in /home/user/bin/w32g and follow the instruction at the beginning of this file to install it. If you want a different configuration you can copy the file w32g.conf.txt to /home/user/.w32g.conf. If you don't want a different configuration there's no need to copy it now. For information, the default configuration is : Code:
[w32g] |
Re: [Announce] Auto2G: A battery saver script for the N900
An alternative to fcron and dbus would be to put a script in /etc/network/if-up.d (and in if-down.d). If you want to keep doing the polling, put a script there that enables fcron-managed polling.
|
Re: [Announce] Auto2G: A battery saver script for the N900
Quote:
Using if-up.d/if-down.d is quite easy to use but limited to network automation. dbus allow me to automatize many things. I like dbus :) |
Re: [Announce] Auto2G: A battery saver script for the N900
Ran into a problem with it last night. I was on a work call and when I got home, it was dumped as the phone switched to the home wifi and then dropped to 2G. Called him back and then I was leaving home and after I lost my wifi, the script brought me back to 3G and dumped the call. Anyway to add a provision for it not to do anything if there is an active call?
|
Re: [Announce] Auto2G: A battery saver script for the N900
Quote:
Code:
dbus-send --system --dest=com.nokia.csd.Call --print-reply=literal /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.GetStatus So I've modified the script to test this before . You can find it on this wiki page User:Nbc/W32g |
Re: [Announce] Auto2G: A battery saver script for the N900
Update on this: found a problem. For the first time I'm using Joikuspot in a hotel to get my laptop online. Whenever I connect, because Joikuspot is using WiFi to share the 3G signal, it disconnects and drops down to 2G. Very annoying - when I eventually realised what was happening I had to rename the script temporarily to stop it running!
If anyone packages this, there will have to be way to stop this or perhaps just have a way to turn it off manually. |
Re: [Announce] Auto2G: A battery saver script for the N900
if [`ps | grep joiku` = ...]
exit else -script- It's a very simple addition. |
joikuspot and call during network connect/disconnect
A truly complete program, besides checking for these two conditions (ongoing call and joikuspot sharing), should also wait for these two events to finish before switching to 2G/3G, and when doing that, first check if the condition hasn't changed again.
The logic starts to become complicated here. We would have to use some threads for that? BTW, if a packaged script with some user interface is done, I'd recommend using the regular if-up.d and if-down.d networkmanager scripts, because it is not very good to depend on dbus-scripts because it's still in extras-devel, not extras. This way you get only the interface being connected/disconnected, but you can get the remaining details with iwconfig and the like. |
All times are GMT. The time now is 03:41. |
vBulletin® Version 3.8.8