Problems when replacing the Wi-Fi adapter

Hi,

Once again, I’m coming to you with what might be a trivial problem that I haven’t been able to solve properly yet.

Unfortunately, there’s no one in my personal circle who knows Linux.

That’s why, as always, I’m turning to this forum with confidence.

Enough with the preamble.

Ultimately, it’s about two RPi 4s that are connected to the network via Wi-Fi for space-related reasons. For the most part, that works well.

But now I’d like to improve or optimize the Wi-Fi connection by using better Wi-Fi adapters.

The old Wi-Fi adapters have a Realtek chip, while the new ones have a MediaTek chip.

In my naivety, I thought it would be plug-and-play—just take out the old ones, put in the new ones, and that’s it.

Unfortunately, that’s not the case.

So far, Wi-Fi0 has been set up.

I “experimented” a bit to set up Wi-Fi 1, but that went wrong.

In the end, out of desperation, I temporarily removed a Pi 4 and connected it via LAN, but that didn’t really work either—the network was unstable and kept dropping out.

Now I’ve wiped the system; I still have the original on the SD card (a copy from about 3 days ago).

My question:

With DietPi OS running in the latest version and using ONLY a Wi-Fi connection as Wi-Fi0, what’s the best way to swap out the Wi-Fi adapter for a different one?

If necessary, I can also physically remove the Pi 4 and perform the setup via LAN.

I hope I’ve managed to explain my plan in a way that makes sense.

Thank you in advance for your time!

Edit: I forgot to mention that I’ve at least noticed that the kernel supports and recognizes the MediaTek adapter without any additional drivers.

Have you enabled the onboard Wi-Fi? Or are you only using external adapters? The RPi4 does come with its own Wi-Fi, after all.

Is your system running right now? If so, which adapter are you using? The onboard one? An older external one? If the system is running, just plug in the new adapter and restart the system. Then you can check to see if the system recognizes the new adapter.

Generally, the RPi will assign “wlan0” to the Wi-Fi adapter that becomes available first. The second adapter will then be assigned “wlan1.” It all depends on how quickly the kernel can initialize the individual adapters. As a rule, the internal adapter should be the fastest (if enabled).

Of course, it would also be advantageous to perform the configuration via LAN. This avoids the problem of potentially not having Wi-Fi access if something goes wrong during configuration.