We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Switching default internet access interface



  • Hey everyone,

    I'm working with an Onion Omega2S+. I have it connected to a Sara R410 module which is working great. However I'd like to programmatically switch my internet connection interface between wireless.sta and the Cellular connection. What is the cleanest way to do this? I've seen mentions of using the option metric to do this but not sure I fully grasp how that works. Any input would be greatly appreciated.

    For reference, in case it helps, here is the output from uci show network and uci show wireless

    uci show network:
    network.loopback=interface
    network.loopback.ifname='lo'
    network.loopback.proto='static'
    network.loopback.ipaddr='127.0.0.1'
    network.loopback.netmask='255.0.0.0'
    network.globals=globals
    network.globals.ula_prefix='fd1d:48c4:7633::/48'
    network.wlan=interface
    network.wlan.type='bridge'
    network.wlan.proto='static'
    network.wlan.ipaddr='192.168.3.1'
    network.wlan.netmask='255.255.255.0'
    network.wlan.ip6assign='60'
    network.wwan=interface
    network.wwan.ifname='apcli0'
    network.wwan.proto='dhcp'
    network.wwan.hostname='Cosmic-CB57'
    network.wan=interface
    network.wan.ifname='eth0'
    network.wan.proto='dhcp'
    network.hologram=interface
    network.hologram.defaultroute='1'
    network.hologram.device='/dev/ttyS2'
    network.hologram.apn='hologram'
    network.hologram.service='umts'
    network.hologram.proto='3g'
    network.hologram.pppd_options='noipdefault'
    

    uci show wireless:

    wireless.radio0=wifi-device
    wireless.radio0.type='ralink'
    wireless.radio0.variant='mt7628'
    wireless.radio0.country='US'
    wireless.radio0.hwmode='11g'
    wireless.radio0.htmode='HT40'
    wireless.radio0.channel='auto'
    wireless.radio0.device_mode='apsta'
    wireless.radio0.op_mode='preference'
    wireless.radio0.disabled='0'
    wireless.ap=wifi-iface
    wireless.ap.device='radio0'
    wireless.ap.mode='ap'
    wireless.ap.network='wlan'
    wireless.ap.ifname='ra0'
    wireless.ap.disabled='0'
    wireless.ap.ssid='Cosmic-CB57'
    wireless.ap.key='XXXXXXXXX'
    wireless.ap.encryption='psk2'
    wireless.sta=wifi-iface
    wireless.sta.device='radio0'
    wireless.sta.mode='sta'
    wireless.sta.ifname='apcli0'
    wireless.sta.network='wwan'
    wireless.sta.led='omega2pro:blue:wifi'
    wireless.sta.disabled='0'
    wireless.sta.encryption='psk2'
    wireless.sta.key='XXXXXXXX'
    wireless.sta.ssid='Travis-WiFi'
    wireless.@wifi-config[0]=wifi-config
    wireless.@wifi-config[0].key='XXXXXXXX'
    wireless.@wifi-config[0].ssid='Travis-WiFi'
    wireless.@wifi-config[0].encryption='psk2'
    


  • So from what I can find it looks like the best way to do this is to set the disabled option property on the network interface.

    To switch to Cellular execute commands:

    uci set network.hologram.disabled=0
    uci set wireless.radio0.disabled=1
    

    To switch to WiFi execute commands:

    uci set network.hologram.disabled=1
    uci set wireless.radio0.disabled=0
    

    If there is a better way of doing this please let me know.



Looks like your connection to Community was lost, please wait while we try to reconnect.