maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [SOLVED] turn off cellular when wifi is available (https://talk.maemo.org/showthread.php?t=83525)

qwazix 2012-04-08 17:09

[SOLVED] turn off cellular when wifi is available
 
I use the N900 only as a computer. I have a sim card in it that only does data. Thus when I have wifi access there is no reason for the cellular subsystem to be on and drain battery. On the other hand when I am out, I want to be able to connect to 3G data.

I have cell-modem-ui installed and I switch to tablet mode when I am home but I am looking for a more automatic solution.

Short version: I want cellular to turn off every time wifi is connected.

Any pointers to where should I begin?

peter2p 2012-04-08 17:42

Re: turn off cellular when wifi is available
 
Quote:

Originally Posted by qwazix (Post 1189781)
Any pointers to where should I begin?

Maybe ConnectNow Maemo5 widget by nicolai can help you...
Latest version has an extra option for changing radio mode
by OnConnect / OnDisconnect with the internet connection.

qwazix 2012-04-12 14:29

Re: [SOLVED] turn off cellular when wifi is available
 
dbus-scripts ftw!

I installed dbus-scripts, created a control file /etc/dbus-scripts.d/onWifiConnect with this contents

Code:

/home/user/onWifiConnect.sh * * com.nokia.icd status_changed * WLAN_INFRA CONNECTED
/home/user/onWifiDisconnect.sh * * com.nokia.icd status_changed * WLAN_INFRA IDLE

and two scripts in /home/user

onWifiConnnect.sh

Code:

#!/bin/sh
dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:false

onWifiDisconnect.sh
Code:

#!/bin/sh
dbus-send --system --type=method_call --dest=com.nokia.phone.SSC /com/nokia/phone/SSC com.nokia.phone.SSC.set_radio boolean:true



All times are GMT. The time now is 12:01.

vBulletin® Version 3.8.8