OpenWRT 22.03.5, Raspberry Pi 4, Ralink RT7601 USB Wifi Dongle, ALFA AWUS036AXM Wifi Dongle.
Everything was working fine with just the Ralink wifi dongle I just added the ALFA AWUS036AXM So that I could use 5G wifi...
So, now there is
Radio0/wlan0-Onboard wifi chip
Radio1/wlan1-Ralink wifi dongle
Radio2/wlan2-Alpha wifi dongle. (I know that we are not supposed to reference the wlanX as this is not relative to the UCI)
(Ralink always plugs into the left USB 2.0 port, and the ALPHA plugs into the Right USB 3.0 port).
Here is the "known" problem. My /etc/config/wireless is set up as
Radio0...
Radio1...
Radio2...
Alpha wifi dongle added and Radio2 was created, and it works. Heres the problem. When I remove the Ralink USB Wifi dongle (radio1/wlan1) and boot up the Raspberry Pi... Now the Alpha wifi dongle does not work...
We kinda know why this is (referencing the other posts on this topic).
If I type in the (depreciated command) ifconfig... I see that there is no longer wlan2... and now the Alpha wifi dongle is wlan0, and the onboard wifi chip is now wlan1... arrrgggg....
So ... - How do I force the UCI to make the onboard wifi chip "Radio0", the Ralink wifi dongle Radio1, and the Alpha wifi dongle Radio2 - ALL THE TIME. ?
but why you need remove the ralink radio? if you really need remove the ralink usb, let boot the device just with the alfa plugged in, and after the device boot plugin the ralink. so radio2 will be the ralink.
You have not explained why you have all those radios on the wan?
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:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
The radio definitions (wifi-device) include a physical path, so the radioX names will not move to different hardware as long as you always return the dongles to their same ports after removing them.
The wlan numbers will change when some interfaces cannot be opened because the associated radio no longer exists. There should not be reference to wlanX anywhere in the configuration though. The option network in the wifi-iface block associates each AP or STA with a network regardless of the wlan name.
If you move the radio and place it in an unconfigured port, it will put it in the address as a new device; so even if you return it to the first install port, there is, now, a second phantom address on the second port.
Thanks for your suggestion. Thats - kinda what I am doing now. I deleted the /etc/config/wireless and started over with Alpha wifi dongle as the first one (radio1) ... However - This does not help me/us understand, why does it do that? I should be able to assign the wifi dongle to a specific radio# ...
Did you use EXT4 and the firmware selector the first time?
It is a Pi, so reflashing is not dangerous.
Plan it out now, this goes here, this goes here and all will stay there.
Use the firmware selector and firmware selector select Customize installed packages and/or first boot script.
Add the needed drivers you need for the radios to the script.
remove the USB radios.
Boot and powerdown,
Plug in one radio, boot and shutdown.
Plug in the second, boot and reboot.
You should now have everything identified and you can configure..
I have recreated my wireless config from scratch.... Looks the same as previous wireless paste from ControlC above - without radio2... Now I just have the Alpha card, and it is Radio1.... Unfortunately now - Every time I boot the router (raspberry pi 4) Radio1 does not start. The router correctly automatically connects to my home wifi network with the onboard wifi (radio0), but radio1 does nothing. If I use ip link show We can see that the device is down... hmmmm? I can go into the GUI and click restart and everything works normal... After the Alpha dongle is restarted - it becomes Radio1 (wlan0) and broadcasts like its supposed to...
I know everyone says - we don't care or use "wlan#" however in the images shared. We can see the GUI references wlan1 as the default onboard wifi (onboard wifi chip is radio0)...?
root@mycomputername:/etc/config# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP qlen 1000
link/ether ########## brd ff:ff:ff:ff:ff:ff
3: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
link/ether ########## brd ff:ff:ff:ff:ff:ff
4: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether ########## brd ff:ff:ff:ff:ff:ff
5: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 0########## brd ff:ff:ff:ff:ff:ff
That is just a configuration mess.
For starters the ethernet should be eth0 unless you have a dongle you have not mentioned. eth1 is not even a configured device in devices but shows up as one in the wan interface. eth0 is a configured device but not in any interface.
You have a reason you have two, separate, wan interfaces and have not told us what you are trying to accomplish.
I'm sure there are more but it would just be easier to start over.
If you follow the order of boots and reboots I suggested above the firmware will have the packages it needs for all adapters but will add them one at a time so as not to convolute the devices.
Lastly:
Are you using an ethernet dongle too?
Because it would be added in the second boot then the radios.
This is what happens with Pis because of all the device options that do not require consideration when flashing a dedicated router to OpenWrt.
I am using eth0 to ssh / manage the router. eth1 is a dongle for connecting to ethernet internet (if available).
I will start over. I have a backup from before adding the Alpha dongle.
Right now with the new wireless config - The Alpha wifi card has to be manually restarted every boot...
Other than /etc/config/wireless.... Where else are these devices being stored / saved... Like /etc/network... is there another area where these devices are being assigned?
They were in the cat /etc/config/wireless config but those are USB addresses and I have no idea how to edit them to my whim.
eth0 should be the wan. It will start out in a br-lan bridge but that is just to get everything configured, then you connect wirelessly and change it to a wan device. Then put it in a wan interface yo might need to add.
Still not sure why you have both ethernet and wifi on separate wan interfaces... ...but what do I know.
Let's see what happens when you get all the devices in the interfaces configured as you want them.
Not, really, starting over but give it a try if you need.
Thank you all for your help - greatly appreciated!!!
I prefer to connect to internet at hotels via ethernet - if available. If no ethernet - then I bridge the wifi. -- reason for the dongle.
I will start with a fresh image.
////////////////////////////////////////////////////////////////////
Just a quick test...
I deleted radiio1 entries in /etc/config/wireless.
removed the usb Alpha dongle.
rebooted.
Inserted Ralink usb wifi dongle. /etc/config/wireless shows radio1. I enable it.
uci commit wireless
wifi
reboot
wifi works! - dongle starts every boot!. I check ip a and Luci - Now it shows the onboard wifi chip as wlan0 (radio0)... the Ralink as wlan1(radio1)... Interesting that when wlan0 is radio0... and so forth... it works. Now, I plug in the Alpha wifi dongle (still keeping with all same usb slots) bam! - it shows up in /etc/config/wirelsss as radio2... enable it... (same as before) now every reboot - the wifi for each radio works as it should....
It seems there is somewhere else that is saving usb wifi dongle data that needs to be cleared or something. The system does refrence wlan0,1,2 in Luci (Network / Interfaces /Devices ) Identify the devices as wlan0, wlan1, wlan2...
Yes - /etc/config/wireless is where we define what the wifi interfaces will do... But, somehow it matters... if wlan0 is not assigned to the onboard wifi chip - and wlan0 gets assigned to a wifi dongle - the dongle does not start...