Advice needed how to set SQM parameters in the scenario the RUTM30 is constantly moving

I have a RUTM30 in my camper, so the router is located in different areas every few days. When the 5G/4G signal is weak, i still get reasonable download speedtest results, but watching streaming television frequently buffers due to high latency spikes (ping times up to 900ms). Setting an upload limit of 80% of the attanable upload speed greatly improves the situation because it reduces bufferbloat, i can see ping spikes reduced considerably.

But now my question; the attainable upload speed is different every few days based on location, it can be 2mbps or 20mbps. But i do not want to adjust the upload speed in SQM every time i move my camper. Is it possible to set a dynamic SQM upload speed of say 80% of of the current maximum upload speed, so the set SQM upload speed dynamically follows the current connection capabilities? Via a script for example?

Greetings,

A router cannot determine the maximum capacity of a cellular connection without actively testing it, so running a speed test is necessary. You would need to decide how often this test should be performed and whether it should run automatically at set intervals or be triggered by specific events (for example, after a router reboot). A manual trigger is also possible, like sending an SMS command to the router.

Since the router does not natively support dynamic SQM configuration, a custom script is required. While writing and troubleshooting custom scripts is outside the scope of our technical support, I can help outline the logic for implementing one. A simple shell script should be sufficient for this purpose.

You can run a speed test from the CLI using the speedtest command. However, it prompts for confirmation before execution.
image
To bypass this prompt and save the results to a file, you can use:
echo "y" | speedtest > /tmp/speedtest_results.txt

The script should then extract the final upload speed from the results and store it in a variable. It’s a good idea to validate that the extracted value is numeric to ensure the speed test completed successfully.

Next, calculate 80% of that value and apply it to the SQM instance using the following commands:

uci set sqm.instance_name.upload='$VALUE'
uci commit sqm
/etc/init.d/sqm restart

As mentioned earlier, it’s important to carefully consider how frequently the script runs, since repeated speed tests can consume a significant amount of data.

You can find additional information and examples of custom scripts here:

Best Regards,
Justinas

There is an option for you to investigate: cake-autorate → GitHub - lynxthecat/cake-autorate: Eliminate the excess latency and jitter terrorizing your 4G, 5G, LTE, Starlink or other variable rate connection! · GitHub

Thank you both very much for your answer, i think i will manage to fimd a solution this way.

Just installed cake-autorate on my rutx50. Now comes the difficult part, fine-tuning and monitoring how effective the script is. I will probably have to install a Raspberry Pi in my camper with Home Assistant, Victoriametrics and Grafana.

Can you outline how you did the install, and do you have an estimate how much data is used for the frequent speed tests?

There are two prerequisites, bash and fping version 5.3 or higher. Bash can be installed using this command.

opkg -e /etc/opkg/openwrt/distfeeds.conf update
opkg -e /etc/opkg/openwrt/distfeeds.conf install bash

fping is the default ping utility that cake-autorate uses. To measure One-Way-Delay instead of Round-Trip Time you need version 5.3 or higher. You could also use the default ping utility on your router, but then you will only measure RTT and you do not know if the delay is caused by the upload or download.

fping v5.3 is not available in the Teltonika repository nor in the OpenWRT 21.02 repository RutOS is based on. So I copied the .ipk file from the OpenWRT 24.10 repo and installed it locally. I know you are not supposed to mix and match files from different releases because of dependencies, but I figured what can go wrong with a small ping utility. Use this option at your own risk!

opkg install /tmp/fping_5.3-r1_arm_cortex-a7_neon-vfpv4.ipk

After that just follow the install-procedure and cake-autorate will be installed as a service you can enable and start.

I don’t know how much data is used for the speedtest. I first have to figure out how to do the monitoring. I like the idea of a smart van, but maybe I start with MQTT to my server at home.