AR750 en-/disable tethering device via side-switch

I have successfully modified the /usr/bin/switchaction script for activation/deactivation of the wlan.
The script function toggle_wifi_4g() also en-/disables the 3g/4g modem.
But sadly my 3g stick is only recognized as a tethering device.

Is it possible to en-/disable the tethering device in this script as well?

Hi, mkba
Please provide the firmware version number you are currently using,as well as the logread and dmesg information when you operate the modem and the switchaction script you modified?

Hello wellnw,

here are the files: (10.7 KB)

In the switchaction I have commented my modifications.

The logread and mesg outputs contain the cases:

  • disconnected and reconnected the tethering device
  • switch turns to disable and re-enable the wifi/modem

Thank you very much for your help.

Does anyone know if this possible?

disable tethering
uci set network.tethering.disabled='1'
uci commit network
/etc/init.d/network reload
enable tethering
uci set network.tethering.disabled='0'
uci commit network
/etc/init.d/network reload

Any way this code or alternative could be utilised for the Button Settings -
Button Left = Enable WAN & Disable Tethering
Button Right = Enable Tethering & Disable WAN

Thank you very much!! It works perfectly.

That was also what I was intenting to do. The Left/Right Button Settings are controled in the script /usr/bin/switchaction
In that script the function toggle_wifi_4g() controls WLAN/Modem/Tethering enabling/disabling.

if [ “$action” = “OFF” ];then
# If the switch is set to ‘OFF’ then everything is disabled
uci set wireless.default_radio0.disabled=‘1’
uci set wireless.default_radio1.disabled=‘1’
uci set network.modem_1_1_2.disabled=‘1’
uci set network.tethering.disabled=‘1’
# If the switch is set to ‘ON’ then everything is enabled
# except for the 5Ghz wifi, 5Ghz wifi stays disabled
uci set wireless.default_radio0.disabled=‘1’
uci set wireless.default_radio1.disabled=‘0’
uci set network.modem_1_1_2.disabled=‘0’
uci set network.tethering.disabled=‘0’

Also you have to replace the following lines

switch_enabled=$(uci get glconfig.switch_button.enable)
switch_func=$(uci get glconfig.switch_button.function)

with the following lines


for the switch action to always invoke the function toggle_wifi_4g().

Here is my switchaction script I am using. (1.3 KB)

For control purpose here is my firmware version: OpenWrt 18.06.1 r7258-5eb055306f

Now I see you are talking about WAN not WLAN. Anyway, maybe the above will help anyone.