Roaming between several wireless WAN connections, OpenWrt 23.05.2

Hi,

I am experiencing the following issue with my Linksys MR8300 router running OpenWrt 23.05.2, but before I post this as a bug I'd like to make sure I am not doing something wrong.
Any helpful input would be very much appreciated!

In OpenWrt it is possible to add multiple wireless networks as wireless WAN connections, for the purpose of connecting the OpenWrt router to the Internet via an existing nearby Wi-Fi network. (the easiest way being in LuCi to click the [Scan] button under the "Network" > "Wireless" menu and then "Join" one of the listed wireless networks)

So I add a wireless network that is currently within range, the OpenWrt router successfully connects to that wireless host network and then I have a working Internet connection.

At a later time at another place I add another available wireless network as a wireless WAN connection using the same steps as above and I get a working connection to the Internet via that wireless network.

Later I return into the area of coverage of the first wireless network, but the OpenWrt router never establishes a working network connection to that wireless network. I can see that wireless network show up under "Associated Stations" with Signal/Noise and Rx/Tx Rates being displayed, so the wireless has been physically connected, but in LuCi under "Status" > "Overview" the "Network" section doesn't get populated with any IP information. A reboot doesn't help either.

I have tried adding up to four different wireless networks, but only the one that was the last to have made a successful connection remains usable and there seems to be no way for me to get any of the other three connected again. (of course, to "Remove" a connection and then "Add" it again would work, but that is not a solution to the problem)

By the way, I have also tested this on another router model running OpenWrt 22.03.2 and the result was the same, therefore this issue shouldn't be specific to the Linksys MR8300 and/or OpenWrt 23.05.2.

I think you may want to use something like Travelmate. Take a look at what it does and let us know if this addresses your need.

Thank you very much!

It seems Travelmate is the solution, even though I haven't yet been able to get it working the way I need it.

The thing is that if the currently connected wireless network "disappears" (no more signal received), then after a preset number of retries (a maximum value of "10" can be set) Travelmate will disable that wireless network for good. That network's entry in the "Wireless Stations" tab will change from "Enabled - Yes" to "Enabled - No" and then Travelmate doesn't try again to connect to that wireless network. I have to enter LuCi and click the [On/Off] button to enable that network again.

If I can't sort this out by myself, then I will go to the Travelmate support thread and ask for help.

Unfortunately, it turned out that the present version of Travelmate is not suitable for my use case. (for the reason I mentioned in my previous post)

So in the end I went back to my original idea. I added all the wireless networks that I want my router to be able to connect to via the regular "Network" -> "Wireless" menu of LuCi and since things don't work automatically as I had initially hoped I then made a small shell script that assists with the switching between the wireless networks. That script gets started at a specified interval by cron (I opted for every 2 minutes).

I'll paste the script under this post in case someone else might find it useful. I have tested it on two different router models running OpenWrt 22.03.5 and 23.05.2, but there still could be flaws that I haven't discovered yet.

Note that if additional wireless networks are added after the script was run, then OpenWrt needs to be restarted or the temporary list needs to be deleted.

#!/bin/sh

# This is a script that cycles through the available "wifinet" wwan connections until one is found that provides a connection to the Internet.

# Check if Internet is available. If it is, then just exit the script.
ping -c1 8.8.8.8
if [ "$?" -eq 0 ]; then
    exit
fi

# Check if the list containing all the configured "wifinet" connections already exists. If no list exists, then create one.
wifinet_list_file="/tmp/wifinet_list"
if [ ! -f $wifinet_list_file ]; then
    grep "wifinet" /etc/config/wireless | cut -d "'" -f 2 > $wifinet_list_file
fi

# Check if at least two "wifinet" connections exist. If less than two, then exit.
how_many_wifinet=$(wc -l < $wifinet_list_file)
if [ "$how_many_wifinet" -lt 2 ]; then
    exit
fi

# Disable the "wifinet"s that are currently enabled and move those to the end of the list.
let counter1=counter2=1
while [ "$counter1" -le "$how_many_wifinet" ]; do
    wifinet_number=$(sed -n "${counter2} p" $wifinet_list_file)   # Read specified line from the list of "wifinet"s.
    if [ ! "$(uci get wireless.$wifinet_number.disabled)" = 1 ]; then   # If wifinet* is not disabled,
        uci set wireless.$wifinet_number.disabled=1   # then disable it,
        sed -i "/$wifinet_number/d" $wifinet_list_file   # delete it from the list,
        echo $wifinet_number >> $wifinet_list_file	# and re-add it to the bottom of the list.
    else
        let counter2=counter2+1
    fi
    let counter1=counter1+1
done

topoflist_wifinet=$(head -1 $wifinet_list_file)   # Get the first line of the "wifinet" list.
uci set wireless.$topoflist_wifinet.disabled=0   # Enable that "wifinet" connection.

uci commit wireless   # Write the changes to /etc/config/wireless.

# Restart the wwan interface.
ifdown wwan
ifup wwan