본문으로 건너뛰기

本产品还未支持网线连接

网线使用教程

网线接线

适用与FLY上位机的系统包

适用于C8 PI_V2 PI GEMINI系列

  • 下载系统包

安装服务

其他上位机需要自行安装服务

注意事项

安装过程需要联网

sudo apt install isc-dhcp-server

配置网络

  • 本教程将会把上位机网口占用,只能使用连接屏幕
  • 如果不需要,只需要将下方修改和添加的配置完全删除即可

修改/etc/network/interfaces.d/eth0

auto eth0
iface eth0 inet static
address 192.168.251.100
netmask 255.255.255.0
broadcast 192.168.251.255
network 192.168.251.0
gateway 192.168.251.1

修改/etc/default/isc-dhcp-server

# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth0"
#INTERFACESv4="eth0"
INTERFACESv6=""
#INTERFACES="eth0"

INTERFACES="eth0"

修改/etc/dhcp/dhcpd.conf,尾部新增下面的内容

# ddns-update-style none;
subnet 192.168.251.0 netmask 255.255.255.0 {
range 192.168.251.100 192.168.251.200;
option routers 192.168.251.1;
option domain-name-servers 8.8.8.8, 8.8.4.4; # Google Public DNS as an example
default-lease-time 600; # Default lease time in seconds
max-lease-time 7200; # Maximum lease time in seconds
}

先重启系统,再执行下面的重启服务

或者重启网络服务

sudo systemctl restart NetworkManager

此操作会断网重连

重启服务

sudo systemctl restart isc-dhcp-server

本机IP地址应为192.168.251.100

提高WIFI的优先级

  • 此命令是提高网络优先级,如果不添加的话无法正常联网下载东西等!!!
  • 请在上位机的/etc/rc.local中添加下方指令
sudo ip route del default && sudo ip route add default via $(ip route show dev wlan0 | grep 'default via' | awk 'NR==1 {print $3}') dev wlan0