11324 questions

13494 answers

21161 comments

31591 members

0 votes
235 views 8 comments
by
How to add a Wifi in CLI ?

I could create new Multi-AP-Wifis by using uci add/set with appropriate parameters and accomplish the new settings with an "uci commit".
But WITHOUT a REBOOT the new wifi is not visible/usable.

Is there a command to "reload" the wireless-section to avoid reboot?

Many thx, Rainer

1 Answer

0 votes
by

Hello, 

Kindly try executing this command after "uci commit wirelss" execute this "reload_config". 

Regards,
Jerome

by

Many thx for your answer :-)

Unfortunately this does not change anything, but doing:
uci commit multi_wifi & reload_config & "reload WebUI in wireless section" shows me then the new wifi when I open "MultiAP".
Without doing the "WebUI"_Reload in Wireless-Seciont the wifi does not popup in MultiAP-Submenu. Mmmh.

But still, without reboot I do not get the new wifi to work.
So there must be an additional (or other) command to "reload" some more config to get the wifi visibile AND workinging.

Many thx for all your help,
Best regards, Rainer

by

Hello, 

Tested adding WiFi Clients on Multi AP with the commands below:

uci add multi_wifi wifi-iface
uci set multi_wifi.@wifi-iface[-1]=wifi-iface
uci set multi_wifi.@wifi-iface[-1].enabled='1'
uci set multi_wifi.@wifi-iface[-1].ssid='test123456'
uci set multi_wifi.@wifi-iface[-1].key='123123123'
uci set multi_wifi.@wifi-iface[-1].priority='2'
uci commit multi_wifi
reload_config


This command adds new WiFi AP in CLI and checked it on Web UI and it appears there. Just take note to increase the priority value. 

Regards,
Jerome

by

Thx. But without reload the WebUI-Wireless-Section the new wifi is not shown when opening Multi-AP-List. But it is shown well in "uci show", so no problem and fine for me.

Main-Problem : reload_config does not work to make new wifi usable/working until I do reboot.

Thx for any help here :-)

by

Hi, 

For this one try adding /etc/init.d/network restart and let me know the results.

The full command will be like this:
uci add multi_wifi wifi-iface
uci set multi_wifi.@wifi-iface[-1]=wifi-iface
uci set multi_wifi.@wifi-iface[-1].enabled='1'
uci set multi_wifi.@wifi-iface[-1].ssid='test123456'
uci set multi_wifi.@wifi-iface[-1].key='123123123'
uci set multi_wifi.@wifi-iface[-1].priority='2'
uci commit multi_wifi
reload_config

/etc/init.d/network restart

Regards,
Jerome

by

Thx for answer. 

Yes, new wifi is visible under MultiAP after "network restart", but only if this new wifi was the recent wifi which used sometimes ago (so only if it's shown under "uci show wireless" which shows the recently used wifi). But independent whether this wifi is the recent one or is a completely new wifi it does not work (provide internet) at all.

To get the new wifi visible AND working "multi_wifi restart" does the job I found out :-)

But now every time when router does failover back to mobile (which is working well) I need a "firewall restart" to get the mobile working well. 

Note, that everything is working well after a reboot - so it must be a matter of restarting correct service(s).

Be so kind and help,
thx, Rainer

by
Gentle reminder :-)
by

Hello, 

Regarding this query of yours kindly try executing "uci commit" instead of "uci commit multi_wifi" to save all the configs and try reloading it. And for the firewall restart execution is needed when failover is done. I would like to ask for a copy of the TS file for that


Regards,
Jerome

by

Thx for answer :-)

All the problems solved somehow after again freshly did firmware-installation (which creates fresh filesystems).
Seems my tests did somehow "corrupted" something (not in uci I checked but maybe in /tmp or or or).

At the end it looks like working as below:

WIFI_IF_NO="`uci get multi_wifi.@wifi-iface[-1].priority`";
let WIFI_PRIO=$WIFI_IF_NO+1;
uci set multi_wifi.@wifi-iface[-1].enabled='1';
uci set multi_wifi.@wifi-iface[-1].ssid='***';
uci set multi_wifi.@wifi-iface[-1].key='***';
uci set multi_wifi.@wifi-iface[-1].priority="$WIFI_PRIO";
uci commit;
reload_config;
/etc/init.d/multi_wifi restart;

When disabling/enabling/deleting MultiAP-Wifis, it must be checked whether this wifi has been recently used, then it is still set under "uci show wireless" and you might need to disable/enable/delete it there too (not only under multi_wifi).
As far as I tested the multi_wifi restart is only needed in case the wifi (which needs to be disabled/deleted/enabled) is already set under "uci show wireless" as the recently used one.

( Btw, the array-number -1 is only working well in case there is already array existing with at least one element, but not fully tested )

Many thx for all you help,
Rainer