Radxa zero 3w problem with external antenna and his overlay

Good evening all, @MichaIng

After purchasing a Radxa Zero 3W board, I ran into trouble trying to enable the overlay included in the DietPi distribution.
The activation failed, and I didn’t know how to verify that the overlay had been successfully enabled.
Below is a small script that renames the overlay and copy it to the overlay-user folder to activate it via dietpiEnv.txt.

#!/bin/bash
# ==============================================================================
# SCRIPT DE RE-DÉPLOIEMENT PROPRE DE L'ANTENNE EXTERNE (DIETPI)
# ==============================================================================

echo "--- [1/3] Création du dossier et copie du fichier DTBO d'origine ---"
sudo mkdir -p /boot/overlay-user
sudo cp /boot/dtb/rockchip/overlay/rk35xx-radxa-zero-3w-ext-ant.dtbo /boot/overlay-user/radxa-ext-ant.dtbo

echo "--- [2/3] Configuration du fichier /boot/dietpiEnv.txt ---"
# Nettoyage des lignes existantes pour éviter les doublons
sudo sed -i '/user_overlays=/d' /boot/dietpiEnv.txt

# Injection de la configuration propre (conserve pcm5122_i2s et ajoute radxa-ext-ant)
sudo tee -a /boot/dietpiEnv.txt << 'LINE_EOF'
user_overlays=pcm5122_i2s radxa-ext-ant
LINE_EOF

echo "--- [3/3] Vérification visuelle du fichier modifié ---"
cat /boot/dietpiEnv.txt

echo "=============================================================================="
echo " Opération réussie ! Vous pouvez maintenant redémarrer avec : reboot"
echo "=============================================================================="

# L'exécuter

# bash deploy_antenna.sh


# Pour vérifier

# cat /sys/kernel/debug/gpio | grep -i antenna

# On doit trouver la réponse suivante

#  gpio-26  (                    |board-antenna       ) out lo ACTIVE LOW

# Pour tester la force du signal

# iw dev wlan0 scan | grep -E 'SSID|signal'

At the end of the script, you’ll find the commands to verify successful activation.
With this command cat /sys/kernel/debug/gpio | grep -i antenna,
you should get
gpio-26 ( |board-antenna ) out lo ACTIVE LOW,

This works for me, and I hope it can help others.

There is no need to copy overlays shipped with the kernel package around and make them to user overlays. Just add a prefix that works, like rk35xx-radxa-zero-3w. This overlay really has a name against all conventions. I just added it for our future images: Radxa ZERO 3: add overlay prefix for external antenna overlay · MichaIng/DietPi@145fb9c · GitHub

G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk35xx-radxa-zero-3w rockchip-rk3566 rockchip-rk3568 radxa-zero3 rk3568' /boot/dietpiEnv.txt

Then you can add ext-ant to the overlays line.

Hi @MichaIng ,

As a side note, I tried simply renaming the overlay with a standard name and leaving it in the “overlay” folder; however, it didn’t work,the card kept using the internal antenna, and the overlay wasn’t active.

I’m going to try your method and let you know if it works.

In any case, the gain of the external antenna compared to the internal one is over 20 dB.

Hello @MichaIng

Many thanks

Tested and approved, it works perfectly now with the overlay folder :wink:

Good, there just needs to be a matching prefix in overlay_prefix. Renaming the overlay or moving it to user overlays has the downside that you miss possible changes on kernel upgrade.