RUT950 - How to connect to Wi-Fi via CLI

Hello,

I’m trying to connect to Wi-Fi network via CLI, but I not sure the procedure I am using is the correct one. Sometimes the connection works, but most of the times it fails. Can someone help with this problem?

The procedure I am using is this one:

1st - Create the interface and set the link up:
iw phy phy0 interface add wlan0 type managed
ip link set wlan0 up

2nd - Scan the network to get the information about the network I am about to connect:
iw dev wlan0 scan

3rd - Set the wireless configuration:
uci set wireless.1=wifi-iface
uci set wireless.1.key=key
uci set wireless.1.bssid=bssid
uci set wireless.1.ssid=ssid
uci set wireless.1.encryption=encryption
uci set wireless.1.device=radio0
uci set wireless.1.mode=sta
uci set wireless.1.network=network
uci set wireless.1.skip_inactivity_poll=0
uci set wireless.1._bgscan_enabled=0
uci set wireless.1.ieee80211r=0
uci set wireless.1.wds=0
uci set wireless.1.disassoc_low_ack=0
uci set wireless.1.short_preamble=0
uci set wireless.1.wifi_id=wifi1

4th - Set the network configuration:
uci set network.network=interface
uci set network.network.proto=dhcp
uci set network.network.metric=1
uci set network.network.area_type=wan
uci set network.network.force_link=0

5th - Commit changes:
uci commit
reload_config

6th - Execute the DHCP lease:
udhcp -i wlan0

Hi joao,

Welcome to Teltonika Networks Community!

Can you try running the following commands? Make sure to change the highlighted text with correct information.

uci set wireless.1=wifi-iface
uci set wireless.1.key=‘[password]
uci set wireless.1._device_id=‘2’
uci set wireless.1.ssid=‘[ssid]
uci set wireless.1.encryption=‘psk2’
uci set wireless.1.device=‘radio1’
uci set wireless.1.mode=‘sta’
uci set wireless.1.network=‘ifWan1’
uci set wireless.1.skip_inactivity_poll=‘0’
uci set wireless.1._bgscan_enabled=‘0’
uci set wireless.1.ieee80211r=‘0’
uci set wireless.1.short_preamble=‘0’
uci set wireless.1.wds=‘0’

uci set network.ifWan1=interface
uci set network.ifWan1.proto=‘dhcp’
uci set network.ifWan1.name=‘wifi1’
uci set network.ifWan1.metric=‘5’
uci set network.ifWan1.area_type=‘wan’
uci set network.ifWan1.force_link=‘0’

reload_config

Let me know if this helps.

Regards,

This topic was automatically closed after 15 days. New replies are no longer allowed.