Can't configure Wireless interface (wlan0) with UCI

I have got this UCI files and when I do /etc/init.d/network reload there is no wireless interface up. Then, if I use ip link set wlan0 up the interfacec appears but without any IP address. It must be any mistake in my files or something more wrong.

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '1'
	option phy 'phy0'
	option disabled '0'

config wifi-iface 'ap'
	option device 'radio0'
	option mode 'ap'
	option network 'radio0ap'
	option encryption 'psk2'
	option disabled '0'
	option ssid 'MyWifi'
	option key '7116db6e'	

config wifi-iface 'sta'
	option device 'radio0'
	option mode 'sta'
	option network 'radio0sta'
	option ssid 'sta'
	option encryption 'psk2'
	option key 'stastast'
	option disabled '1'

/etc/config/network


config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'
	option ipv6 '0'

config interface 'usb'
	option ifname 'usb0'
	option proto 'static'
	option ipaddr '192.168.33.33'
	option netmask '255.255.255.0'
	option ipv6 '0'

config interface 'radio0ap'
	option ifname 'wlan0'
	option proto 'static'
	option ipaddr '192.168.2.33'
	option netmask '255.255.255.0'
	option ipv6 '1'

config interface 'radio0sta'
	option ifname 'wlan1'
	option proto 'dhcp'
	option ipv6 '1'

config interface 'lan'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.33'
	option netmask '255.255.255.0'
	option ipv6 '1'

config interface 'plc'
	option ifname 'eth2'
	option proto 'static'
	option ip6assign '60'
	option macaddr 'a0:b0:c0:d0:e0:f0'

config interface 'wan'
	option proto 'wwan'
	option ipv6 '0'
	option apn 'movistar.es'
	option username 'movistar'
	option password 'movistar'
	option discover_apn '1'

config globals 'globals'
	option ula_prefix 'auto'

mv /etc/config/wireless /etc/config-wirelessold
wifi config
cat /etc/config/wireless  | grep path

I do not understand why you sent it

He sent it because it resets the wireless config to defaults. After which, it also shows your device's real hardware path, which is missing from your current config.

Feel free to look at the Linux Manual for most those commands.

2 Likes

Yes what @lleachii said about not having the hardware path. This is a big problem because the radio hardware can't be accessed without it. You can't paste a whole /etc/config/wireless from one model to another. There is some hardware specific stuff in the wifi-device stanza which you should let the firstboot scripts generate. After doing that, add the following radio-wide parameters:

  • country
  • channel (find neighbors and avoid them)
  • htmode
  • legacy_rates 0

Also don't do this in /etc/config/network:

Don't call out wireless interfaces with option ifname, you don't need option ifname at all if the only interfaces in a network are wireless. The option network in /etc/config/wireless will attach the radio to a network. The names wlan1 etc are generated at runtime and you can't be sure what they will be in advance.

It doesn't work to me. I deleted this interface and I added these new options. I think that I have got the radio resource correctly linked with the radio0ap interface (ifname wlan0) but, the default status of the interface is still down. I don't find a way to set it up using UCI files.

I'm not sure you understood those helping you - as your response indicates you may have failed to perform the steps above:

  • You were not told to delete an Interface, yet you deleted one
  • You were told that radio0ap is likely wrong
  • You were instructed to let OpenWrt re-create the whole file - /etc/config/wireless from defaults - using the instructions in Post No. 2.

I'm not sure how you're determining the interface down - especially if you never followed the steps from @wulfy23. Please follow the instructions above; and post the new /etc/config/wireless when complete.

You likely won't see it - until you follow the instructions in Post No. 2.

BTW, if you think your AP PHY linking is correct, following the instructions of Post No. 2 will prove it.

2 Likes
  1. Ok. I didn't understand properly. I thought that it was unnecessary. I get it uncommented as in the beginning.
  2. Ok but, is it wrong because of the ifname? I only deleted ifname option. Would it be right now?
config interface 'radio0ap'
	option proto 'static'
	option ipaddr '192.168.2.33'
	option netmask '255.255.255.0'
	option ipv6 '1'

config interface 'radio0sta'
	option proto 'dhcp'
	option ipv6 '1'
  1. Yeah. I had done it previously but, I must use wifi detect instead of wifi config because this ones did not generate anything. I think that It is what we were looking for. Here the result:
config wifi-device  radio0
	option type     mac80211
	option channel  11
	option hwmode	11g
	option path	'soc0/soc/2100000.aips-bus/2190000.usdhc/mmc_host/mmc0/mmc0:0001/mmc0:0001:1'
	option htmode	HT20
	# REMOVE THIS LINE TO ENABLE WIFI:
	option disabled 1

config wifi-iface
	option device   radio0
	option network  lan
	option mode     ap
	option ssid     OpenWrt
	option encryption none

However, I have set disabled '0' but...nothing.

Thank you for all your help @wulfy23 @mk24 @lleachii! I will be waiting for your answer :wink:

2 Likes

good you now have a valid PATH... for your radios...

define wrong. what is or is not currently working? why? show or describe the tests you've made and the results you see....

we can't tell much by what you posted.

please tell me why you did that?

as some general advice.. do not touch anything unless you KNOW what it does. or at least backup your file... change one thing.... test.... then change it back if there are issues... Using LUCI/web interface is advised... until you a familiar with specific options.

I personally do that ( use the web interface ) for wifi... even with intermediate knowledge on the topic....

2 Likes
  • Describe how you set to 0?
  • Describe how you saved and applied the setting

Did you add this - because it's in the wrong location???

Completely remove this.

It was directly in the default configuration of my device but, I set it in 0 because, it is like removing that. option.

Whenever I change something I follow this steps:

  1. I save changes in the file.
  2. uci commit wireless
  3. etc/init.d/network reload

About the procedure

I exactly do it. Following this procedure:

About ifname

I did it because I understood that in this reply:

About why it does not work

Because with this configuration I do not have any wireless interface up...

root@6S0A182C0002:/# ifconfig
eth0      Link encap:Ethernet  HWaddr F8:DC:7A:23:9E:85  
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:269392 (263.0 KiB)  TX bytes:269392 (263.0 KiB)

usb0      Link encap:Ethernet  HWaddr 0E:CD:1E:8F:E5:57  
          inet addr:192.168.33.33  Bcast:192.168.33.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3364 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1934 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:320691 (313.1 KiB)  TX bytes:273710 (267.2 KiB)

If I call the status up: false...

root@6S0A182C0002:/# ubus call network.interface.radio0ap status
{
	"up": false,
	"pending": false,
	"available": false,
	"autostart": true,
	"proto": "static",
	"data": {
		
	}
}

If I set up the wlan0 it appears without any IP in spite of setting 192.168.2.33 in etc/config/network

root@6S0A182C0002:/# ip link set wlan0 up
root@6S0A182C0002:/# ifconfig
eth0      Link encap:Ethernet  HWaddr F8:DC:7A:23:9E:85  
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5484 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5484 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:286392 (279.6 KiB)  TX bytes:286392 (279.6 KiB)

usb0      Link encap:Ethernet  HWaddr 0E:CD:1E:8F:E5:57  
          inet addr:192.168.33.33  Bcast:192.168.33.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3597 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2065 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:338843 (330.9 KiB)  TX bytes:291464 (284.6 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:25:CA:3C:1F:97  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I will try the web interface ok

1 Like

I think you should.

Whoa!

You should not be configuring an IP on the WiFi PHY, you should be configuring a VLAN/OpenWrt Interface and bridging it to an SSID. LAN should already have this setup in the default wireless and network configs (e.g. SSID OpenWrt). If you simply change the LAN IP and enable WiFi, you will have the IP scheme you desire on the WiFi.

Also, free free to use one post to respond to multiple people, we can all see the responses.

I suggest you try setting up a working WiFi first. Perhaps it will be easier for you if you do that with the defaults, simply enable WiFi, then renumber your network.

See:

I know this is a config for wifi-iface - and not wifi-device. We cannot assist if you refuse to tell us that you're changing configs.

3 Likes

Yes use the web interface... you can see below...;

  1. "lan"(interface) is linked to eth1.1(device) via ifname
  2. and the single line in wireless "network" that links each radio to a layer3-interface ( lan )

Read the guides posted above... play around... and keep copies of your /etc/config/network and /etc/config/wireless ( or a web config backup ) so you can easily reset things when they don't work...

[root@syno-rt2600ac /FLAMEGRAPH 51°]#  uci show network | grep 'network.lan' | head -n6
network.lan=interface
network.lan.type='bridge'
network.lan.ifname='eth1.1'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ipaddr='10.2.3.11'

[root@syno-rt2600ac /FLAMEGRAPH 51°]# cat /etc/config/wireless | grep network
	option network 'lan'
	option network 'lan'

I'm pretty sure you'll get the hang of it if you follow the main advice in this thread.... follow guides, start simple... do one small thing at a time... in the next easiest order....

3 Likes

What is your use case? Why are extra networks needed?

Creating new networks should only be considered after you are familiar with the standard configuration of wifi attached to br-lan and know that it works on your hardware. What happened to br-lan anyway?

1 Like

Ok. I will try setting up a simple WiFI and, then, when it will work, I will adapt it to my preferences.

It automatically appears in the wifi-device... but it does no matter. I have removed.

So, if I correctly understand, I should have in /etc/config/wireless the default wifi-device and wifi-iface which use it. Besides, I have to set lan of /etc/config/network as a wifi-iface network. Finally, configure the interface following my preferences... Isn't it the procedure?

I feel that my web manager has got a very few options. Is it possible bridging here?



It's quite obvious to regular OpenWrt users, that these configs are not their default. For example, you have no DHCP on LAN, so even if you connect to WiFi, you wouldn't get an IP address.

Why dont you reset the router to default settings; and then attempt to configure everything from the beginning?

It will also allow us to assist you easier.

Also, please note to us what make/model router you have.

I am using the module DART-6UL. More info: https://www.variscite.com/product/system-on-module-som/cortex-a7/dart-6ul-freescale-imx-6ul/

The device was used before by other people and I am afraid to lose things that they installed or configured. I prefer to touch only network configuration. Do you think that reset is such an important? I am starting everything almost from the beginning. I am basing on this:

  • I wouldn't have advised the reset if your presentation of non default configs each time wasn't causing confusion

I personally have to keep guessing what files have been changed or deleted, instead of just assisting you.

  • Settings like DHCP are in another file (which also appears not to be default at this time) - it's nice to say "touch only network", but be prepared to actually configure the device
  • If you don't wanna loose configs, simply back them up - I don't get your point though, since you're changing configs anyway
  • It may be helpful to note also that customization of a wireless LAN requires editing of at least 3 config files
  • As you've observed, it may be easier for you to use the web GUI
  • I don't see your device listed in the Table of Hardware, I don't think it's officially supported

Perhaps you should inquire with the Original Equipment Manufacturer.

  • Again, that disabled line you posted is not valid in wifi-device (at least per OpenWrt documentation, it's used on the SSIDs), so ask the OEM firmware maker.
  • If others have installed and changed things, how do you know this to be true!?!?

...and who is Ingeteam???

That's who you should be asking, since it's their firmware.

https://www.ingeteam.com/en-us/aboutus/contact.aspx

I would like to configure everything in static.

Could be but, in the configuration of the wifi aspects is required an authentification and if I use the username and password I was given, it redirects me again to the main page... It seems not to be allowed to change in the web the wifi settings...

It does not seem to be... :pensive:

Yeah, yeah. I now it. I had followed your advice and I had removed it :wink:

Because, their told me about they had done, but not about what :sweat_smile: I will try to ask again.

How do you know it is their?

Anyway, I will keep trying to follow @wulfy23 steps. I achieved something...

br-lan    Link encap:Ethernet  HWaddr F8:DC:7A:23:9E:85  
          inet addr:192.168.2.33  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr F8:DC:7A:23:9E:85  
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0.1    Link encap:Ethernet  HWaddr F8:DC:7A:23:9E:85  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:11448 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11448 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:583656 (569.9 KiB)  TX bytes:583656 (569.9 KiB)

usb0      Link encap:Ethernet  HWaddr 06:9F:60:88:4E:76  
          inet addr:192.168.33.33  Bcast:192.168.33.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1641 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1023 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:231443 (226.0 KiB)  TX bytes:149866 (146.3 KiB)

Those are right now my /etc/config/wireless and /etc/config/network:

config wifi-device  radio0
	option type     mac80211
	option channel  11
	option hwmode	11g
	option path	'soc0/soc/2100000.aips-bus/2190000.usdhc/mmc_host/mmc0/mmc0:0001/mmc0:0001:1'
	option htmode	HT20
	option country	ES

config wifi-iface
	option device   radio0
	option network  lan
	option mode     ap
	option ssid     OpenWrt
	option encryption none
config interface 'wired'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.33'
	option netmask '255.255.255.0'
	option ipv6 '1'

config interface 'lan'
	option ifname 'eth0.1'	
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.2.33'
	option netmask '255.255.255.0'
	option stp '1'

Thank you so much and sorry for all my questions and starter ignorance...