Skip to content

Commit 49d931c

Browse files
Update APFPV.md
add how using and 4 antenna on radxa gs and how install apalink and setting it
1 parent f3a63bf commit 49d931c

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed

src/content/docs/use-cases/fpv/APFPV.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,134 @@ Unlike complex mesh networking systems (WFB-NG, RubyFPV), APFPV:
320320
- Provides easy web-based configuration
321321

322322
APFPV bridges the gap between complex FPV systems and simple solutions, making FPV accessible to everyone while supporting professional equipment for advanced users.
323+
324+
##apfpv with runcam gs or other gs that got many wifi card
325+
326+
step 1 : download radxa img at this link https://github.com/OpenIPC/sbc-groundstations/releases/tag/zero3w-apfpv-v0.0.1
327+
step 2 : flash sd card using balena etcher or other similar software
328+
setp 3 : once finish we need to modify stream.sh and firstboot.sh
329+
330+
in /script/firstboot.sh copy this block of code that will shearch external wifi card at the beginning of the file it should replace the wlan0 connection script.
331+
332+
```bash
333+
#!/bin/bash
334+
335+
SSID="OpenIPC"
336+
PASSWORD="12345678"
337+
EXCLUDE_IFACE="wlan0"
338+
339+
echo "[*] Détection des interfaces Wi-Fi via ip..."
340+
341+
# Liste des interfaces de type wlan* ou wlx* sauf wlan0
342+
WIFI_IFACES=$(ip -o link show | awk -F': ' '{print $2}' | grep -E '^wlan|^wlx' | grep -v "^$EXCLUDE_IFACE$")
343+
344+
INDEX=1
345+
346+
for IFACE in $WIFI_IFACES; do
347+
CONN_NAME="wifi$INDEX"
348+
349+
echo ""
350+
echo "=== Interface détectée : $IFACE → connexion nommée $CONN_NAME ==="
351+
352+
# Supprimer ancienne connexion si elle existe
353+
if nmcli connection show "$CONN_NAME" &>/dev/null; then
354+
echo "[*] Suppression de l'ancienne connexion $CONN_NAME"
355+
nmcli connection delete "$CONN_NAME"
356+
fi
357+
358+
# Scanner les réseaux Wi-Fi
359+
echo "[*] Scan des réseaux pour $IFACE..."
360+
nmcli device wifi rescan ifname "$IFACE"
361+
sleep 2
362+
363+
# Créer la connexion Wi-Fi
364+
echo "[*] Création de la connexion $CONN_NAME..."
365+
nmcli connection add type wifi ifname "$IFACE" con-name "$CONN_NAME" ssid "$SSID" \
366+
wifi-sec.key-mgmt wpa-psk wifi-sec.psk "$PASSWORD" \
367+
ipv4.method auto connection.autoconnect yes
368+
369+
# Définir la priorité de route
370+
if [[ "$CONN_NAME" == "wifi1" ]]; then
371+
echo "[*] Affectation de la priorité de route : 100 (wifi1)"
372+
nmcli connection modify "$CONN_NAME" ipv4.route-metric 100
373+
elif [[ "$CONN_NAME" == "wifi2" ]]; then
374+
echo "[*] Affectation de la priorité de route : 200 (wifi2)"
375+
nmcli connection modify "$CONN_NAME" ipv4.route-metric 200
376+
fi
377+
378+
# Activer la connexion
379+
echo "[*] Activation de la connexion $CONN_NAME"
380+
nmcli connection up "$CONN_NAME"
381+
382+
echo "[+] $CONN_NAME connectée et priorisée"
383+
INDEX=$((INDEX + 1))
384+
done
385+
386+
echo ""
387+
echo "[✓] Toutes les interfaces sont connectées avec priorités configurées."
388+
```
389+
step 4 : in stream.sh disable wlan0 using nmcli
390+
391+
copy this line :
392+
393+
```bash
394+
nmcli device disconnect wlan0
395+
```
396+
397+
thats all now put the sd card on your vrx and boot it, you will get 2 wifi interface connect to apfpv credential, and with ip route it will pick the best wifi card every time to connect, the range will increase significantly.
398+
399+
###using adaptive link
400+
adaptive link will modify the bitrate to keep link alive, it still exprimental stage
401+
step 1 : download from github https://github.com/carabidulebabat/CaraSandbox/blob/main/ap_alink.sh
402+
step 2 : modify rc.local in /etc/ folder and add before exit 0
403+
```bash
404+
ap_alink.sh &
405+
````
406+
save the file
407+
step 3 : go to putty and type
408+
409+
````bash
410+
chmod +x /etc/ap_alink.sh
411+
```
412+
413+
Now lets see the different setting, cause its experimental we can play with various parametrer
414+
415+
bitrate=30 is the default bitrate, when its boot it will start at 30mbps
416+
bitratemax is the max bitrate allowed, majestic will not go higher than this value
417+
default value is bitrate 30 and max 40, its good if you have a radxa gs with good wifi card, if your on android try lower value like
418+
419+
```bash
420+
bitrate=4
421+
bitratemax=10
422+
````
423+
424+
power is not adaptive yet
425+
426+
get_dynamic_interval() {
427+
dbm=$(get_dbm)
428+
echo $(awk -v d="$dbm" 'BEGIN {
429+
if (d > -40) print 8;
430+
else if (d > -65) print 6;
431+
else if (d > -75) print 4;
432+
else if (d > -85) print 2;
433+
else print 1;
434+
}')
435+
}
436+
this function allow to increase the bitrate faster or lower depends on link quality in dbm you can modify the d value to set the sensitivity of ap alink
437+
438+
get_dynamic_decrease() {
439+
dbm=$(get_dbm)
440+
echo $(awk -v d="$dbm" 'BEGIN {
441+
if (d > -60) print 2;
442+
else if (d > -75) print 5;
443+
else if (d > -85) print 15;
444+
else print 20;
445+
}')
446+
}
447+
448+
same thing at get dynamic interval will lower bitrate faster or lower depends of link quality.
449+
450+
I suggest to try different value for d > dbm and see in flight
451+
452+
thats all for the moment
453+

0 commit comments

Comments
 (0)