Hey JJ,

On Sat, Nov 23, 2013 at 11:40:14PM +0100, jj_calvo wrote:
> I am developing a script for the Fonera 2n that can connect to the better
> wifi network that has defined in a list.
> 
> So I can change the site of the fonera and I always access the best network
> (like the function of a lantop)
Cool. Did you already find the "ap_client" command, which (IIRC) can be
used to perform a wifi scan? It might disconnect any current
connections, though, because it has to hop to different channels.

> I've seen that when I change the wifi network the files 
> 
> /etc/config/fon 
> 
> and 
> 
> /etc/config/wireless 
> 
> change.

What happens is that the WebUI changes /etc/config/fon. Then, the
/etc/fonstated/ConfigFON script runs, which calls /lib/fon/config.sh,
which updates /etc/config/wireless.

Then, /etc/fonstated/ConfigWifi runs, which calls "wifi" and "ifup wan".

http://trac.fonosfera.org/fon-ng/browser/trunk/fon/fonstate/files/etc/fonstated/ConfigFON
http://trac.fonosfera.org/fon-ng/browser/trunk/fon/fonbase/files/lib/fon/config.sh
http://trac.fonosfera.org/fon-ng/browser/trunk/fon/fonstate/files/etc/fonstated/ConfigWifi
http://trac.fonosfera.org/fon-ng/browser/trunk/luci/libs/fon/luasrc/fon/net/wifi.lua
http://trac.fonosfera.org/fon-ng/browser/trunk/luci/libs/fon/luasrc/fon/net/wan.lua

> My questions are as follows
> 
> Is there any function to change the files (by comnand line) best than I use?
You can use the "uci" command, run "uci -h" to get some help. For
example, to set the ssid:

        root@Fonera:~# uci set fon.wan.ssid=foo


Regards,

Matthijs Kooijman

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Development mailing list
[email protected]
http://fonosfera.org/mailman/listinfo/development

Reply via email to