{"id":20166815,"url":"https://github.com/OpenIPC/adaptive-link","last_synced_at":"2025-05-07T00:33:18.596Z","repository":{"id":258020645,"uuid":"867947375","full_name":"OpenIPC/adaptive-link","owner":"OpenIPC","description":"Greg's Adaptive-Link - Files for OpenIPC camera and Radxa Zero 3w/e ground station","archived":false,"fork":false,"pushed_at":"2025-04-12T02:33:40.000Z","size":706,"stargazers_count":15,"open_issues_count":5,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-28T19:31:05.211Z","etag":null,"topics":["adaptive-link","fpv","openipc"],"latest_commit_sha":null,"homepage":"https://openipc.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenIPC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"openipc"}},"created_at":"2024-10-05T04:37:26.000Z","updated_at":"2025-04-15T07:34:25.000Z","dependencies_parsed_at":"2024-12-17T07:33:29.252Z","dependency_job_id":"4a9881f1-9889-476e-99d3-7ae34e1298a0","html_url":"https://github.com/OpenIPC/adaptive-link","commit_stats":null,"previous_names":["sickgreg/openipc-adaptive-link","openipc/adaptive-link"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fadaptive-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fadaptive-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fadaptive-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fadaptive-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenIPC","download_url":"https://codeload.github.com/OpenIPC/adaptive-link/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252792454,"owners_count":21804975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adaptive-link","fpv","openipc"],"created_at":"2024-11-14T00:46:13.839Z","updated_at":"2025-05-07T00:33:13.584Z","avatar_url":"https://github.com/OpenIPC.png","language":"C","funding_links":["https://opencollective.com/openipc"],"categories":[],"sub_categories":[],"readme":"# OpenIPC-Adaptive-Link\n**Greg's Adaptive-Link - For OpenIPC Camera and Radxa Zero 3w/e Ground Station**\n\nWarning: Set power levels for your transmitter appropriately in txprofiles.conf\n\n1. Upgrade camera to latest OpenIPC with wfb_tun included (Warning: All files will be overwritten)\n\n`sysupgrade -k -r -n`\n\n2. Get installer and run\n\n```\ncurl -L -o install_adaptive_link.sh https://raw.githubusercontent.com/sickgreg/OpenIPC-Adaptive-Link/refs/heads/main/install_adaptive_link.sh\nchmod +x install_adaptive_link.sh\n./install_adaptive_link.sh drone install\n```\nSettings (including power levels) can be set in `/etc/txprofiles.conf` and `/etc/alink.conf`\n\n3. Install on ground station\n\nSame as above with gs\n```\ncurl -L -o install_adaptive_link.sh https://raw.githubusercontent.com/sickgreg/OpenIPC-Adaptive-Link/refs/heads/main/install_adaptive_link.sh\nchmod +x install_adaptive_link.sh\nsudo ./install_adaptive_link.sh gs install\n```\n\nService will be added to systemd.  stop | start | disable | enable | status with `sudo systemctl stop adaptive_link`\n\nconfig file is `/etc/adaptive_link.conf`\n\nMake sure to set udp port to 9999 and udp IP to 10.5.0.10 (drone's IP) in adaptive_link.conf\n\n\n\n**--- Changing the rate at which wfb-ng talks to the gs script ---**\n\nYou can add this to  `/etc/wifibroadcast.cfg` on gs\n\nDefault is only 1Hz (1000ms).  200ms gives the script 5 rssi/snr/etc/etc updates per second\n```\n[common]\nlog_interval = 200\n```\n\n\n\n\n**--- How to WinSCP to your drone via gs over tunnel ---**\n\n```\n# On drone set up a route to your LAN (sub 192xxx with yours). This should persist after reboot\nip route add 192.168.8.0/24 via 10.5.0.1\n\n# On GS set up IP forwarding temporarily:\nsudo sysctl -w net.ipv4.ip_forward=1\n# Make Permenant:\nsudo nano /etc/sysctl.conf #uncomment or add this line: \nnet.ipv4.ip_forward = 1\nsudo sysctl -p\n# On GS (Sub 192.x.x.x with your LAN). This seems to not persist after reboot\nsudo iptables -t nat -A POSTROUTING -o gs-wfb -s 192.168.8.0/24 -j MASQUERADE\n\n# On Windows as Administrator (Sub 192xxx with your GS IP) - persists after reboot\ncmd\nroute add 10.5.0.0 mask 255.255.255.0 192.168.8.116 -p\n```\n\n\n**More details**\n\n**--- ALink42p ---**\n\nudp listener and video-link mode changer for OpenIPC\n\n\ncopy to `/usr/bin` on OpenIPC camera and make it executable\n\n`ALink42p --help` for command line options\n\nCopy `txprofiles.conf` to `/etc` (Warning: contains tx power level settings.  Don't set your specific device' power too high)\n\nCopy `alink.conf` to `/etc` for general settings / custom mode-changing execution strings.\n\nNote: It won't start up without those files\n\nI'm running `/usr/bin/ALink42p \u0026` from `/etc/rc.local` startup script. You also need wfb-ng tunnel or run wfb_rx on the camera,\n\neg\n\nI put\n```\n# Tunnel pair\nwfb_rx -c 127.0.0.1 -u 5800 -K /etc/drone.key -p 160 -i 7669206 wlan0 \u003e /dev/null \u0026\nwfb_tx -p 32 -u 5801 -K /etc/drone.key -R 2097152 -B20 -M 0 -S 1 -L 1 -G long -k 1 -n 2 -i 7669206 -f data wlan0 \u003e /dev/null \u0026\nwfb_tun -T 0 \u0026\n# Although this may work out of the box already if you sysupgrade (?)\n# Then\nsleep 2\n/usr/bin/ALink42m\n```\n\nOld Way - for reference\n\n`wfb_rx -c 127.0.0.1 -u 5000 -K /etc/drone.key -p 1 -i 7669207 wlan0 \u0026`\n\n\n**--- adaptive_link_greg3.py ---**\n\nRun this on ground station - Radxa, in  my case\n\nhttps://github.com/sickgreg/steam-groundstations/blob/master/adaptive-link/adaptive_link_greg3.py (keep an eye on it for newer versions)\n\n`python3 adaptive_link_greg3.py --udp_ip 10.5.0.2 --udp_port 9999`\n\nfor no tunnel\n`python3 adaptive_link_greg3.py`\n\nYou also need wfb-tunnel on ground station... default worked for me\n\nOr the old way (non-tunnel)\n```\n#/bin/bash\n\nif [ -e /etc/default/wifibroadcast ]; then\n  . /etc/default/wifibroadcast\nfi\n\nsudo wfb_tx -p 1 -u 9998 -K /etc/gs.key -R 456000 -B20 -M 0 -S 1 -L 1 -G long -k 1 -n 2 -i 7669207 -f data $WFB_NICS\n```\n\n**--- setpower.sh ---**\n\nDon't forget to set output power for your card(s) so the drone can hear messages\n\nIn my case, i'm using 3 rtl8812au's and have been using this script (which also restarts everything, maybe do this first)\n\n```\n#/bin/bash\n\n# usage ./setpower.sh \u003cpwrlvl\u003e\necho Stopping wifibroadcast\nsudo systemctl stop wifibroadcast\necho Unloading 88XXau_wfb  module\nsudo modprobe -r 88XXau_wfb \u0026\u0026\necho Loading 88XXau_wfb module with power level $1\nsudo modprobe 88XXau_wfb rtw_tx_pwr_idx_override=$1\necho Restarting openipc.service\nsudo systemctl restart openipc.service\necho Starting wifibroadcast\nsudo systemctl start wifibroadcast\n```\n\nUsage\n`./setpower.sh 40`\n\n**--- spreadfwd.py ----**\nRuns on ground station\n\nListens on a single port and forwards messages to the same number of ports as there are adapters found in /etc/default/wifibroadcast in a round-robin fashion (taking it in turns to send a message)\n\nExample\n\nRun\n\n`python3 spreadfwd.py 9998 9999`\n\n 9998 is the UDP port you set in adaptive_link_greg3.py script\n \n  If in `/etc/default/wifibroadcast` file we have `WFB_NICS=\"rtl1 rtl2 rtl3\"`, the program will send to port 9999,10000,10001, so set --first_port_out to the same port you start wfb_tx on (eg 9999)\n  \n\n**--- txprofiles.conf ---**\n\nLives on camera: `/etc/txprofiles.conf`\nStores video / mcs settings for all the different modes used in adaptive link\n\nNOTE: Be careful with PWR settings.  These examples are for pushing the BL-8812EU2 (square-blue) fairly hard.\n\nExample contents of `/etc/txprofiles.conf`\n\n\n```\n999 - 999 long 0 12 15 3332 5.0 61 0,0,0,0\n1000 - 1150 long 0 12 15 3333 5.0 60 0,0,0,0\n1151 - 1300 long 1 12 15 6667 5.0 59 0,0,0,0\n1301 - 1700 long 2 12 15 10000 5.0 58 0,0,0,0\n1701 - 1950 long 3 12 15 12500 5.0 56 0,0,0,0\n1951 - 2001 short 3 12 15 14000 5.0 56 0,0,0,0\n```\n\nThe values are: `rangestart - rangeend guard_interval FECN FECK Bitrate GOP PWR ROI-QP-definition`\n\n\n**--- alink.conf ---**\n\nLives on camera: `/etc/alink.conf`\n\n```\n\nrssi_weight=0.3\nsnr_weight=0.7\nfallback_ms=1000\nhold_fallback_mode_s=3\nmin_between_changes_ms=150\nhold_modes_down_s=4\nidr_every_change=false\nroi_focus_mode=false\nrequest_keyframe_interval_ms=100\nhysteresis_percent=15\n\n\n# Command templates - Don't change these unless you know what you are doing\npowerCommand=\"iw dev wlan0 set txpower fixed %d\"\nmcsCommand=\"wfb_tx_cmd 8000 set_radio -B 20 -G %s -S 1 -L 1 -M %d\"\nbitrateCommand=\"curl -s 'http://localhost/api/v1/set?video0.bitrate=%d'\"\ngopCommand=\"curl -s 'http://localhost/api/v1/set?video0.gopSize=%f'\"\nfecCommand=\"wfb_tx_cmd 8000 set_fec -k %d -n %d\"\nroiCommand=\"curl -s 'http://localhost/api/v1/set?fpv.roiQp=%s'\"\nidrCommand=\"echo 'IDR 0' | nc localhost 4000\"\n#idrCommand=\"curl localhost/request/idr\"\nmsposdCommand=\"echo '%ld s %d M:%d %s F:%d/%d P:%d G:%.1f\u0026L30\u0026F28 CPU:\u0026C \u0026Tc' \u003e/tmp/MSPOSD.msg\"\n#timeElapsed, profile-\u003esetBitrate, profile-\u003esetMCS, profile-\u003esetGI, profile-\u003esetFecK, profile-\u003esetFecN, profile-\u003ewfbPower, profile-\u003esetGop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenIPC%2Fadaptive-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenIPC%2Fadaptive-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenIPC%2Fadaptive-link/lists"}