Problem with renaming WiFi interface from wlan0 to phy0-sta0

Hello,

I am upgrading my system from OpenWRT 19.07 to 23.05.

On the new version, I realized that when Wifi is used as station mode, after the connection the network interface name changes, from wlan0 to phy0-sta0.

Is there any way to disable this behavior?

In my case, what happens is that when I need to shutdown the WiFi, I need also to power off the WiFi module, on its regulator. And when I turn back on, I need also to restart the SDIO bus and the brcmfmac driver, so the firmware can be correctly loaded into the driver.

On OpenWRT 23.05, after the boot everything works fine. The wlan0 interface is initialized, and after the connection it is renamed to phy0-sta0.

If I shutdown the WiFi, everything works fine too ... no more network interfaces

But when I turn the WiFi back on, what happens is that the interface wlan0 is initialized again, but the connection no longer happens. Looking at wifi status, I can see that the configuration is looking for the phy0-sta0 interface, which no longer exists.

I believe that disabling the renaming would solve my problem. But if is there any other way to work around this problem, I would be thankful for help.

Best regards,

Flavio

Did you keep settings across that upgrade?

Hi @psherman ,

Yes, I did. Is it a problem?

Yes... very much so. Keeping settings across the upgrade is only supported for 22.03 > 23.05. There have been many significant changes to the syntax over the last several versions, so your previous configs are certainly invalid in certain sections and will result in problematic operational behaviors.

Reset your device to defaults and configure from scratch -- that's the only way to ensure that things operate properly.

1 Like

Hi @psherman , thank you for your fast response.

Oh ... I see... I have checked the configurations .... specially regarding other system components. In this case, everything is fine.

Regarding WiFi configuration, I reset the configuration to defaults ... and the behavior is the same.

The rename from wlan0 to phy0-sta0 is a new OpenWRT feature, as far as I understood. But it is causing problems on my use case, and I would like an advice on how to overcome the problem.

I don't think I made it clear enough...

You need to reset and start over from scratch.

I'm not sure how you checked the configurations, but do you know all the places that there have been changes to the syntax and what is now invalid and how things are now defined? If you've gone over every line of the configs with that knowledge and can confidently say that you've made all the required adjustments, great. But I'm guessing that's not the case.

The only way to ensure that things will work properly is to reset and start over. 19.07 configs cannot be directly used on 23.05.

1 Like

you can rename here.


I left myself with the default value

Hi @fkl7834456 ,

Looking at your picture, it seems to be an Access Point configuration screen. Is that correct?

I am using WiFi as station, which connects to an access point :expressionless:

And could you please send me the UCI configuration on the command line, or the /etc/config/wireless parameter? I have no Luci on my system.

for 2.4 GHz add to
config wifi-iface 'default_radio0'
option ifname 'wlan0'

for 5 GHz add config wifi-iface 'default_radio1' to the config
option ifname 'wlan1'

and if you connect to a 2.4 GHz wifi access point, then add to this config
config wifi-iface 'wifinet2'
option ifname 'wlan0'

@fkl7834456 , thank you very much.

I tried these parameters, without success.

I have found this on the repository: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=a511480368a03f754aa6ce7887633247a07ea166

I reverted the changes, but no impact. I believe that the reason is that as I am not using OpenWRT with access point packages, the hostapd is the basic one and this hostapd.uc file is not even installed on my system.

You were rightly told, it’s better to set it up from scratch, or even better, install luci

2 Likes

On my research, I saw that the interface renaming feature is applied only when the interface is up.

In my case, at least, when the connection to the access point is established.

I will prepare some output to show it here.

I connect via wifi in the garage, 2 routers with openwrt, one upstairs, the second in the garage, both have luci installed and there are no problems
luci than convenient, some changes immediately catch the eye.
change the router, most importantly, before purchasing, check the openwrt support, since especially some new router models have reduced flash memory to 4 MB :slight_smile:

Have you reset to defaults yet?

1 Like

Yes, I did ... but no meaningfully progress to report to you.

Here is the content of my /etc/config/wireless

root@OpenWrt:/# cat /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/soc/2100000.bus/2190000.mmc/mmc_host/mmc0/mmc0:0001/mmc0:0001:1'
	option channel '36'
	option band '5g'
	option htmode 'VHT80'
	option disabled '0'

config wifi-iface 'someNetworkInterface'
	option persist 'False'
	option device 'radio0'
	option network 'wan'
	option mode 'sta'
	option ssid 'guacu wifi'
	option name 'guacu wifi'
	option encryption 'psk2+ccmp'
	option disabled '0'
	option timestamp '1710978233.262934'
	option is_hidden '0'
	option hidden '0'
	option ifname 'wlan0'
	option macaddr '11:0a:95:9d:68:17'
	option key 'XXXXXXXXXXXXX'
	option newStyle '1'

@fkl7834456 yesterday before posting this message I have tried to use the ifname field inside the wifi-device configuration, like you advised. I have found this field here: https://openwrt.org/docs/guide-user/network/wifi/basic

After you insist, I decided to try again ... and this time it worked. After the connection, the network interface had not changed the name, keeping wlan0.

But the connection with the access point no longer happens.

This looks very, very wrong:

Where did all those configuration options come from???

Where is it wrong?

As I am working on a custom design, I have custom information.

More parameters is not an issue, as far as I know. But missing, incorrect information, causes misbehavior.

Could you give me some advice?

You didn't mention that previously.

Where did you get the image for 23.05 that you installed just prior to starting this thread?

A normal config would look something like this:

/etc/config/network:

config interface 'wwan'
	option proto 'dhcp'

/etc/config/wireless:

config wifi-device 'radio0'
	option type 'mac80211'
	option path '18000000.axi/bcma0:7/pci0000:00/0000:00:00.0/0000:01:00.0/bcma1:1'
	option channel '1'
	option band '2g'
	option cell_density '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'
	option disabled '1'

config wifi-iface 'wifinet1'
	option device 'radio0'
	option mode 'sta'
	option network 'wwan'
	option ssid 'REDACTED'
	option encryption 'psk2'
	option key 'REDACTED'

And this produces an interface that shows up in the GUI as:

1 Like

Now you know: More parameters is an issue.

Then, I'm sorry to say you are out of your league.

He has: start over.

WHY????

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

@psherman , my apologies.

I thought I have mentioned that before.

I do not install any image. I build it from the source code, from the branch openwrt-23.05. My SoC is iMX6.

I had some challenges with the field path on wifi-device. The path changed from the OpenWRT versions, probably due kernel update.

Thank you very much for all your help and attention.