maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   ConnectNow Maemo5 widget to switch between internet connections (https://talk.maemo.org/showthread.php?t=47623)

neboja 2012-02-13 12:20

Re: ConnectNow Maemo5 widget to switch between internet connections
 
i agree with IVGALVEZ .... i considered to ask for that implementation in cssu thread, but this could be another way to do that!

nicolai 2012-02-16 11:32

Re: ConnectNow Maemo5 widget to switch between internet connections
 
Quote:

Originally Posted by ivgalvez (Post 1164383)
Nicolai, I have yet another feature request. Maybe a very specific use case from my side but I though it might be useful for someone else.

I usually keep my N900 always in GSM (using 2G/3G/Dual status menu widget) to avoid wasting battery, but when I want to connect to the Internet, I change it back to 3G, wait a few seconds to reconnect with the network and then press the ConnectNow widget. After browsing, I disconnect again with ConnectNow and return to 2G mode.

It would be useful for me, then, to be able to use the same widget ConnectNow to make the whole process in a single click. For example the GPRS connection widget could have an option to "change first to 3G/Dual mode if not enabled" and then, on disconnection, an option to "return to 2G mode".

What do you think?

Good idea.
I'll try to implement it.

ivgalvez 2012-02-16 13:15

Re: ConnectNow Maemo5 widget to switch between internet connections
 
Quote:

Originally Posted by nicolai (Post 1165755)
Good idea.
I'll try to implement it.

Amazing!!!

I've never seen this kind of support from any private company.

nicolai 2012-02-24 11:14

Re: ConnectNow Maemo5 widget to switch between internet connections
 
connectnow-home-widget 1.3 is in extras-devel now.
It has an extra option for changing radio mode (3g/gsm)
on connect/disconnect intenetconnections.

Please test and give feedback.

nicolai

ivgalvez 2012-02-24 12:55

Re: ConnectNow Maemo5 widget to switch between internet connections
 
Quote:

Originally Posted by nicolai (Post 1169146)
connectnow-home-widget 1.3 is in extras-devel now.
It has an extra option for changing radio mode (3g/gsm)
on connect/disconnect intenetconnections.

Please test and give feedback.

nicolai

Implemented in only one week!!!

Thank you very much.

In my case, with Vodafone Spain, when pressing connect it tries to make the connection a bit soon without time to stablish correctly the 3G network and thus, an error of connection appears.

Disconnection works flawlessly.

Are you waiting a fixed time after the switch for the connection or are you receiving any dbus signal?

nicolai 2012-02-24 20:00

Re: ConnectNow Maemo5 widget to switch between internet connections
 
This is bad.
There are a bunch of dbus-signals like

com.nokia.phone.SSC.modem_state_changed_ind
com.nokia.phone.GPRS.Available
Phone.Net.operator_name_change

It took me some time to figure out
how to start the connection at the right time. The
current way is:
wait for signal
com.nokia.phone.SSC.modem_state_changed_ind = online
and wait for
Phone.Net.operator_name_change
after that I open the connection.
I have to listen for both signals because right after changing
the radio mode, operator_name_change is signaled two
times, but only after the third time (after signal
modem_state_changed_ind) I can start the connection.
I hoped this way would work for others too. But
it seems this doesn't work for all network operators.

I don't know how to find out what could be the right
way that works for all operators.

peterleinchen 2012-02-24 22:01

Re: ConnectNow Maemo5 widget to switch between internet connections
 
Hey nicolai,

here is some shell code, which I use to detect online state when switching from one SIM to another (dual adapter).

Code:

#give some/infinite time to enter PIN (if SIM requests PIN and only needed for IAP and call forwarding)
#this will wait until cell modem gets online after switching
if [ "$3" != "" -o "$7" != "" ]; then
    /usr/bin/dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"We need to wait for cell modem to get online ..." uint32:4 string:"ack"
    sleep 3
    scount=0
    while [ "`cat /var/run/ssc`" != "online" ]
    do
        /usr/bin/dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"still waiting for cell modem to get online ..."
        if [ $scount < 30 ]; then
            sleep 3
            let scount+=3
        elif [ $scount < 60 ]; then
            sleep 5
            let scount+=5
        else 
            sleep 10
        fi
    done
    /usr/bin/dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"Done, we are online!" uint32: string:
fi

Where I think, you are interested only in that line ;)
Code:

    while [ "`cat /var/run/ssc`" != "online" ]
I wait infinite until I detect this and then continue to connect specific IAP.

Hope this helps.

daniel_m 2012-02-25 12:28

Re: ConnectNow Maemo5 widget to switch between internet connections
 
Oh nice, another update ... no more thinking about broken AutoDisconnect :D
Thanks a lot!

Btw. could you implement a check if a 3G connection has been established and switch to 2G if it failed?

Another interesting feature would be to "silence" icd2! It is easy to kill the daemon on X-Term but that solution is not very comfortable. How about switching icd2 off generally and only start it when a connection with ConnectNow is being established (again with failure check).
This internet connection popup is driving me crazy!
In an ideal world all apps should have an option to work offline, but in reality they don't. And I would rather have an app crash without internet connection then getting that popup every 5 minutes :mad:

Puh, sorry for that outbreak :p
And again: Love my phone because the community is awesome! :)

ivgalvez 2012-02-26 18:55

Re: ConnectNow Maemo5 widget to switch between internet connections
 
I have been using this new feature during the last days and apparently it works 85% of the times with Vodafone Spain. It seems that it depends on the cell tower as most of the fails are always in the same place.

Maybe it's just a timing issue, if you add a little delay it could be enough.

What I have observed is that the widget switches from 2G to 3G, and maybe it's better to change to Dual, so if there's no good reception for 3G you could stay connected to GPRS.

Edit: As far as I continue testing percent of success is raising.

funkmunk 2012-02-29 12:45

Re: ConnectNow Maemo5 widget to switch between internet connections
 
@nicolai....

Could this be configured to be used as a switch for bluetooth. I mean to say to turn on/off the bluetooth (similar like bluezswitch widget) without going into the status bar dropdown???


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

vBulletin® Version 3.8.8