Cài đặt Wi-Fi hotspot trên Orange Pi Zero 3

Trên Official Debian image

create_ap được cài sẵn trong các Official image.

Lưu ý rằng trong các lệnh sau, Debian12 cần thay đổi eth0 thành end0, các distro khác có thể là eth0.

Nhập lệnh sau để tạo điểm phát sóng WIFI có tên orangepi
mật khẩu orangepi ở chế độ NAT (Orange Pi Zero 3 sẽ cấp IP cho máy khách của nó - mặc định 192.168.12.0/24).

$ sudo create_ap -m nat wlan0 eth0 TEN_WIFI PASS_WIFI --no-virt

Nhập lệnh sau để tạo điểm phát sóng WIFI có tên orangepi và mật khẩu orangepi ở chế độ bridge

$ sudo create_ap -m bridge wlan0 eth0 TEN_WIFI PASS_WIFI --no-virt

Image bên thứ 3

create_ap đã ngừng bảo trì từ lâu, vì thế bạn nên sử dụng 1 trong 2 fork của nó là:

Linux Wifi Hotspot hỗ trợ GUI nhưng chưa có đóng gói cho arm64 nên phải tự build, việc cài đặt sẽ phức tạp. Linux-router đơn giản hơn tải về chạy được ngay, tuy nhiên chỉ có CLI.

Hãy nhớ sử dụng --no-virt. Nếu không nó sẽ không hoạt động.

For Armbian please check video bellow.

https://youtu.be/LEutae28Nkc?si=Zn_v1z5I9k9c1VXh

Để tự động chạy khi khởi động bạn có thể sử dụng cron hoặc init yêu thích của mình.

Ví dụ

@reboot /PATH/TO/linux-router/lnxrouter --ap wlan0 TEN_WIFI -p PASS_WIFI --no-virt --daemon

do@opi-zero3:~$ cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *	* * *	root	cd / && run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.daily; }
47 6	* * 7	root	test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.weekly; }
52 6	1 * *	root	test -x /usr/sbin/anacron || { cd / && run-parts --report /etc/cron.monthly; }
@reboot root /home/do/linux-router/lnxrouter --ap wlan0 OPIWIFI -p OPIPASS1 --no-virt --daemon