Hi. I need connect my router to wifi for install LuCi. On LuCi you can scan for select a near wifi and then you can install any packages for modify your router. But now I don't have LuCi cuz I installed a custumize bin file of OpenWrt. The documentation is confused for me (I don't speak english and I'm newbie), I've followed this official info but I think that is incomplete, I only see the wifi signals around me ( iw dev wlan0 scan) but I don't have any idea how to connect my principal wifi router.
How to connect to wifi via ssh?
Edit the /etc/config/wireless file to enable the radio (remove the option disabled line) and add a section like this:
config wifi-iface
option mode sta
option device radio0
option network wan
option ssid 'my_network_name'
option encryption psk2
option key 'my_network_password'
Then edit /etc/config/network and remove any ifname (usually an ethernet port) from the wan section.
This should get it connected to the Internet unless the main router is also using 192.168.1.X addresses. In that case you need to change the lan IP address in /etc/config/network to 192.168.2.1 for example.
Oh sorry my mistake, the wifi configuration goes in /etc/config/wireless. I've edited my post.
In /etc/config/network, you need to delete the default Ethernet adapter to allow wifi to serve as your WAN connection instead. You do not need to specify the wifi interface there, placing option network wan in the wifi configuration is sufficient.
In a standard build there should be a wan interface and firewall zone pre-defined even if they aren't used (device with only one Ethernet port). If you don't already have it, add this to your /etc/config/network:
I could connect my router to wifi via ssh . I tell you how to do it. Thanks to @mk24 for the tips.
1. As the official info tells, go to inside your router vis ssh and follow the next previous steps:
uci set wireless.@wifi-device[0].disabled=0
uci commit wireless
wifi
2. Is necessary know some info about the wifi connection, so:
iw dev wlan0 scan
This commnad line shows important info like BSS id, router id and encryption protocol.
3. Now, edit the next config files: /etc/config/network and /etc/config/wireless (remember that OpenWrt include Vi editor, so for edit: vi /etc/config/network)
The bssid is optional. That will force it to connect only to one particular AP in a situation where more than one AP having the same matching SSID is in radio range.
I just used this information to connect my TP-Link RE305 I just flashed to my wifi router. I will note there is a typo in the config suggestion for wifi-iface in /etc/config/wireless