Hello,
Thank you for reaching out!
To achieve this, the SIM Switch feature can be utilized, which is located in Network → Mobile → SIM Switch. However, please keep in mind, that at least at the moment there is no option for measuring speed, only options seen in the article can be used.
In your case, I'd recommend using the rule "On data connection fail", setting the method to LCP echo, and setting the "Check interval" to something less, for example, 3 seconds. This way SIM switch will occur faster.
If this method does not suit you, then a shell script could also be utilized, however that will require some scripting knowledge. Speedtest package can be downloaded from the package manager (Services → Package Manager). Then using a shell, command speedtest, speed test can be performed via shell. Options for this command are:
--help shows usage of file
-s set silent mode
-u [url] set server
-t [time] set test time
SIM Switch can be done using UCI commands:
uci set simcard.@sim[0].primary='0'
uci set simcard.@sim[1].primary='1'
uci commit simcard
/etc/init.d/simcard restart
Let me know if there is anything else I can help with!
Best regards,
DaumantasG