ubuntu22.04@laptop安装&配置wfb-ng
1. 源由
- ubuntu20.4测试了gnome&xfce界面下wfb_ng Release 23.01版本,情况并不理想(期望在~50ms)
- 自带Mobility Radeon HD 4530驱动仅支持到内核3.4版本
- 经过各种折腾(尝试),桌面系统已经搞奔溃,且
do-release-upgrade
后,桌面无法进入
决定尝试使用ubuntu22.04 LTS版本看下系统性能是否有所提升。
2. 安装步骤
2.1 下载&安装ubuntu22.04桌面版本
- 下载ubuntu22.04桌面版本
- 烧录镜像文件到U盘
- 安装ubuntu22.04桌面版系统
详细请参考:
2.2 Jammy系统同步更新
$ sudo apt update && sudo apt upgrade
2.3 基础工具安装
$ sudo apt-get install git
$ sudo apt-get install make
$ sudo apt-get install build-essential
2.4 无线工具安装
$ sudo apt-get install iw
$ sudo apt-get install net-tools
2.5 远程命令行工具安装
SSH远程服务
$ sudo apt-get install dropbear
samba共享服务
$ sudo apt-get install samba
$ sudo nano /etc/samba/smb.conf
相关配置项应如下修改(请注意,以下仅给出修改部分,请仔细核对)
#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
增加samba用户,并修改密码(建议和登录密码一致,daniel请使用安装时的用户名替换)
$ sudo smbpasswd -a daniel
2.5 wfb-ng编译环境安装
加密传输依赖组件
$ sudo apt-get install libpcap-dev //用于wifi monitor和injection
$ sudo apt-get install libsodium-dev //用于数据加密
运维&打包依赖python组件等,详见:wfb-ng 开源工程结构&代码框架简明介绍
$ sudo apt-get install debhelper dh-python
$ sudo apt-get install python3-all python3-pip python3-pyroute2 python3-future python3-twisted python3-serial virtualenv
2.6 rtl8812au编译环境安装
鉴于rtl8812au是比较老的芯片,且驱动不一定支持所有内核,因此需要配套内核版本。
由前期配置过程中,我们已经得到Release 23.01内核版本是5.15.76,因此我们至少能够确保新系统在该内核版本是可以正常编译通过。
下载脚本
$ git clone git@github.com:pimlie/ubuntu-mainline-kernel.sh.git
查看当前版本
$ ./ubuntu-mainline-kernel.sh -l
检查ubuntu可用内核版本
$ ./ubuntu-mainline-kernel.sh -r
通过比对wfb-ng Release 23.01内核版本5.15.76 和ubuntu可用内核版本,安装v5.15.76
$ ./ubuntu-mainline-kernel.sh -i v5.15.76
修改grub内核启动配置
$ sudo nano /etc/default/grub
$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
使能grub配置,并重启(重启时,请选择新安装的内核版本)
$ sudo update-grub
$ sudo reboot
2.7 安装rtl8812au
$ git clone -b v5.2.20 https://github.com/svpcom/rtl8812au.git
$ cd rtl8812au && make && sudo make install
2.8 安装wfb-ng
$ git clone -b release-23.01 git@github.com:svpcom/wfb-ng.git
$ cd wfb-ng
$ make deb
$ sudo dpkg -i deb_dist/wfb-ng_23.1.16.78051-1_all.deb
2.9 简易地面端配置
以下是通过已经配置正确的天空端,对地面端进行简单配置的方法:
通过局域网,将天空端配置文件复制到地面端计算机wfb-ng-config
$ mkdir wfb-ng-config
$ cd wfb-ng-config
$ sudo scp /etc/udev/rules.d/75-wifi-interface-name-change.rules daniel@192.168.68.53:/home/daniel/wfb-ng-config
$ sudo scp /etc/wifibroadcast.cfg daniel@192.168.68.53:/home/daniel/wfb-ng-config
$ sudo scp /etc/drone.key daniel@192.168.68.53:/home/daniel/wfb-ng-config
$ sudo scp /etc/gs.key daniel@192.168.68.53:/home/daniel/wfb-ng-config
$ sudo scp /etc/modprobe.d/blacklist-8192cu.conf daniel@192.168.68.53:/home/daniel/wfb-ng-config
$ sudo scp /etc/modprobe.d/blacklist-rtl8xxxu.conf daniel@192.168.68.53:/home/daniel/wfb-ng-config
$ sudo scp /etc/modprobe.d/wfb.conf daniel@192.168.68.53:/home/daniel/wfb-ng-config
将配置文件搬运到地面端计算机配置路径下
$ sudo mv wfb.conf /etc/modprobe.d/
$ sudo mv blacklist-8192cu.conf /etc/modprobe.d/
$ sudo mv blacklist-rtl8xxxu.conf /etc/modprobe.d/
$ sudo mv gs.key /etc/
$ sudo mv wifibroadcast.cfg /etc/
$ sudo mv 75-wifi-interface-name-change.rules /etc/udev/rules.d/
然后再进行适当的修改,详见以下链接:
3. 测试720P@45FPS
1085 - 955 = 90 ms,与之前的测试情况类似。
4. 参考资料
【1】FPV Camera(RPI3+V2.1) | wfb_ng Release 23.01 | Ubuntu 20.04 xfce软解测试
【2】FPV Camera(RPI3+V2.1) | wfb_ng Release 23.01 | ubuntu 20.04 gnome软解测试
【3】Mobility Radeon HD 4530 @ubuntu20.04 显卡驱动不支持[GPU无法使用]
【4】How to Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS
【5】How to Install Ubuntu 22.04 LTS Desktop (Jammy Jellyfish)
【6】wfb-ng 开源工程结构&代码框架简明介绍
【7】How to install Linux kernel 5.19 on Ubuntu 22.04 or 20.04
【8】wfb-ng Release 23.01镜像无头烧录&配置(1)
【9】wfb-ng Release 23.01镜像无头烧录&配置(2)
【10】ubuntu-mainline-kernel
【11】Any configuration or pre-setup failed? #274