We have moved to a new Sailfish OS Forum. Please start new discussions there.

Intelligent failover between cellular and wifi connectivity

asked 2015-07-29 10:29:15 +0300

tore gravatar image

updated 2016-08-17 10:58:15 +0300

jiit gravatar image

Currently, SailfishOS treats cellular and wifi connectivity as strictly either/or. That is, when in range of a known wifi network, SFOS will connect to it, and if successful will disconnect the cellular data connectivity. This does not appear to take into the quality of the wireless network, which could suck big-time for a number of reasons, such as the the signal quality being poor, there being high levels of interference from other wireless networks or devices, saturated wifi bandwidth, etc. Furthermore, even when the wifi link itself is working flawlessly, it could work badly for other reasons, such as the internet uplink being saturated (something I often experience in hotels for example).

For this reason, I often find myself simply disabling wifi and running exclusively with a cellular uplink. This even happens in my own apartment: I have two floors with concrete floors between, and one AP on each floor, but when I move between the floors there is a significant delay before SFOS will roam to the nearest AP, and until it does, the network connectivity hardly works at all. Unless I'm staying put on one location, cellular connectivity is simply more reliable for me. However, when wifi actually works, it is both faster and can be used freely without worrying about extra cost. So simply disabling wifi is not an ideal solution either.

RFC 6555: Happy Eyeballs discusses a similar problem, where you have essentially two available methods of connectivity, and discusses how you can do a fast failover to the secondary connectivity if the primary one does not seem to work. While this document specifically speaks about IPv4 vs IPv6 connectivity, the basic principle could be applied to other types of alternate connectivity as well, such as wifi vs cellular. So what I'd like to propose is to make it possible to keep cellular connectivity active even when wifi is connected, and when attempting to make a connection to some external destination, quickly (within a few 100ms) fall back on cellular connectivity if wifi fails to work. This would allow me to keep wifi on without having a poor user experience when the wifi is working poorly. (Note that the fallback would probably need to be implemented in a high-level "connect-by-name" API, as the standard UNIX socket API is not flexible enough to allow for this).

For what it's worth, Apple recently announced that they've implemented this in iOS. See pages 30-32 in the linked PDF.

edit retag flag offensive close delete


This affects me a lot. My ISP has left me with no internet for about 5 days now, and my jolla connects to an internet-less WLAN, and disconnects from cellular data. It's extremely annoying.

WhyNotHugo ( 2015-07-30 02:05:22 +0300 )edit

Well for that you can temporarily disable your home wifi APN in the Jolla WLAN APN list. Just let it connect to it, then tick the APN. It will grey out and only connect to the rest until you reactivate it.

MoritzJT ( 2015-07-30 13:47:13 +0300 )edit

2 Answers

Sort by » oldest newest most voted

answered 2015-07-29 16:18:54 +0300

tigeli gravatar image

@tore Yes, we would need something like this and connman already supports per application routing (so called session API) though there were just few patches on the mailing list which will fix some issues with it.

I can't promise anything when this kind of behaviour would be implemented but for instance the "connect-by-name"-api could be implemented into connection helper (see attemptToConnectNetwork() at https://github.com/nemomobile/nemo-qml-plugin-connectivity/blob/master/src/connectionhelper.cpp#L122) and just modify the per application routing policies etc.

If someone has free time.. please look at it. :)

edit flag offensive delete publish link more

answered 2020-04-11 17:36:40 +0300

Using answer as raise-to-first-page

I suffered a lot from this the last weeks (maybe months who knows?)

My data plan was used up even I was at home and with good WiFi reception everywhere.
But somehow cellular data was used.

I just today researched a bit and really found wih ifconfig two IP adresses for WLAN and also rmnet_data. traceroute seemed to confuse routes to known servers and timed out often.

The icon was switching between WiFi and cell data.
So it really seems that my XA2 uses data as well as WLAN???

Switching WiFi off and on restores the normal WLAN only usage until I hit.this.again!!!

I guess I should create another question but this here (with multipath-tcp) was the best match I could find!

edit flag offensive delete publish link more



"The icon was switching between WiFi and cell data"

--> This happens to mee often, too. If I am fe. playing YouTube on browser, and I slide back to the home screen, I can see the icon switching between Wifi and 4G. Also at work (with several floors and APs) I have found that the Wifi won't have connectivity if I move between areas. So I keep Wifi turned off, which is a bummer.

MystIsland ( 2020-04-11 18:09:25 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2015-07-29 10:29:15 +0300

Seen: 805 times

Last updated: Apr 11 '20