Enable the external antenna connector on the Raspberry Pi Compute Module 4
The internal WiFi module on the Compute Module 4 (that's the bit under the metal shield in the picture above) routes its antenna signal via software. You can route the signal to either:
- The built-in PCB triangle antenna (this is the default).
- The external U.FL connector (which has an external antenna plugged into it in the picture above)
To switch the signal to the U.FL connector (for example, if you're installing your CM4 in a metal box where the PCB antenna would be useless), you need to edit the boot config file (
sudo nano /boot/config.txt, and add the following at the bottom:
# Switch to external antenna. dtparam=ant2
Then reboot the Pi.