Files
orangepi-rag/markdown/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.md
2026-06-11 23:53:48 +07:00

318 lines
11 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Nanobot là một AI Agent framework hỗ trợ nhiều channel như WebUI, WhatsApp và có khả năng mở rộng mạnh mẽ. Trong bài viết này, chúng ta sẽ cài đặt Nanobot trên các dòng SBC ARM64 như Orange Pi 4 Pro hoặc Orange Pi Zero 3W 4GB RAM chạy Ubuntu/Debian.
Bài viết phù hợp cho:
- Orange Pi 4 Pro
- Orange Pi Zero 3W 4GB
- Các SBC Orange Pi khác (tối thiểu 4GB RAM)
- Cài đặt sẵn hệ điều hành Ubuntu / Debian ARM64
## 1\. Chuẩn bị môi trường Python 3.11
Vì Nanobot được viết bằng Python và yêu cầu Python 3.11 trở lên, nên cách tối ưu và sạch nhất là sử dụng Miniconda.
### Cài Miniconda
```bash
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh
bash Miniconda3-latest-Linux-aarch64.sh
```
Sau khi cài xong, reload shell:
```bash
source ~/.bashrc
```
Hoặc activate thủ công:
```bash
conda activate base
```
### Tạo môi trường Python 3.11
```bash
conda create -n py311 python=3.11 -y
```
### Activate môi trường
```bash
conda activate py311
```
Khuyến nghị thêm auto activate:
```bash
echo "conda activate py311" >> ~/.bashrc
```
## 2\. Cài đặt Nanobot
Nanobot có thể cài bằng nhiều cách khác nhau.
### Cách 1 — Cài bằng pip (khuyến nghị)
```bash
pip install nanobot-ai
```
### Cách 2 — Cài bằng UV
UV nhanh hơn pip rất nhiều.
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install nanobot-ai
```
### Cách 3 — Clone source và build trực tiếp
```bash
git clone https://github.com/HKUDS/nanobot.git
cd nanobot
pip install -e .
```
## 3\. Cài đặt WebUI
Mặc dù Nanobot có WebUI mặc định, nhưng mình khuyến khích sử dụng repo WebUI độc lập này vì giao diện đẹp hơn, quản trị dễ hơn và có nhiều tính năng hơn.
Repo này cũng có contribution từ Orange Pi Việt Nam.
Repo: [https://github.com/Good0007/nanobot-webui](https://github.com/Good0007/nanobot-webui)
### Cài đặt nhanh WebUI
```bash
pip install nanobot-webui
```
### Các lệnh sử dụng WebUI
```bash
# Foreground
nanobot-webui start
# Custom port
nanobot-webui start --port 9090
# Background daemon
nanobot-webui start -d
# Alias ngắn
webui start
```
Tài khoản mặc định:
```
Username: admin
Password: nanobot
```
## 4\. Onboard Nanobot
Bạn cần khởi động onboard nanobot để khởi tạo các thông tin như config, api, v.v. Tại màn hình câu lệnh đánh lệnh
```bash
nanobot onboard
```
Sau khi cấu hình xong, truy cập WebUI:
```
http://IP_ORANGEPI:18780
```
## [![](https://orangepivn.b-cdn.net/wp-content/uploads/2026/05/Onboard-Nanobot-600x400.webp)](https://orangepivn.b-cdn.net/wp-content/uploads/2026/05/Onboard-Nanobot.webp)
## 5\. Kết nối WhatsApp
Nanobot sử dụng bridge NodeJS nội bộ dựa trên Baileys để kết nối WhatsApp.
### Cài NodeJS 22
```bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
```
### Login WhatsApp
```bash
nanobot channels login whatsapp
```
Mã QR sẽ xuất hiện trong terminal. Trên điện thoại mở WhatsApp → Cài đặt → Thiết bị được liên kết → Liên kết thiết bị → quét mã QR.
### Ví dụ cấu hình WhatsApp
```json
{
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["+84901234567"],
"groupPolicy": "open"
}
}
}
```
- **allowFrom**: Danh sách số điện thoại được phép nói chuyện với bot.
- **groupPolicy = open**: Trả lời mọi tin nhắn.
- **groupPolicy = mention**: Chỉ trả lời khi được mention.
## 6\. Chạy Nanobot + WhatsApp
WhatsApp bridge cần chạy song song với gateway/WebUI.
Terminal 1:
```bash
nanobot channels login whatsapp
```
Terminal 2:
```bash
nanobot webui start
```
Nếu bạn nâng cấp Nanobot, hãy rebuild lại connect
```bash
rm -rf ~/.nanobot/bridge
nanobot channels login whatsapp
```
## [![](https://orangepivn.b-cdn.net/wp-content/uploads/2026/05/Ket-noi-nanobot-voi-Whatsapp-600x400.webp)](https://orangepivn.b-cdn.net/wp-content/uploads/2026/05/Ket-noi-nanobot-voi-Whatsapp.webp)
## 7\. Một số lỗi thường gặp
Lỗi thiếu build tools:
```bash
sudo apt install build-essential -y
```
Lỗi bridge WhatsApp:
```bash
rm -rf ~/.nanobot/bridge
```
## 8\. Tổng kết
Nanobot là một AI Agent framework rất mạnh và phù hợp với các SBC ARM64 như Orange Pi.
Khi kết hợp với RK3588, RK3566, NPU, Local LLM, Home Assistant hoặc WhatsApp thì có thể xây dựng các AI Agent Edge cực kỳ mạnh mẽ.
Ngoài các tính năng trong bài viết, Nanobot còn rất nhiều khả năng khác mà bạn có thể tiếp tục khám phá thêm.
Video hướng dẫn:
Hướng dẫn cài đặt Nanobot - YouTube
Tap to unmute
[Hướng dẫn cài đặt Nanobot](https://www.youtube.com/watch?v=VD_bskZaedE) [Orange Pi Vietnam](https://www.youtube.com/channel/UCl0lVmXFHAhZybuOIzu2CaA)
![thumbnail-image](https://yt3.ggpht.com/nDus3_aNISkA5x8KD3J1lcxvLAPBa0WdYl8UDthVlh1HXRK1WyCmMfqfbq6lqd3hRx8iqHc6ysA=s68-c-k-c0x00ffffff-no-rj)
Orange Pi Vietnam1.83K subscribers
[Watch on](https://www.youtube.com/watch?v=VD_bskZaedE)
[Chia sẻ trên WhatsApp](whatsapp://send?text=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20%C4%91%E1%BA%B7t%20Nanobot%20tr%C3%AAn%20Orange%20Pi%204%20Pro%20%2F%20Zero%203W%204GB%20RAM%20-%20https://orangepi.vn/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html "Chia sẻ trên WhatsApp")[Chia sẻ trên Facebook](https://www.facebook.com/sharer.php?u=https://orangepi.vn/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html "Chia sẻ trên Facebook")[Chia sẻ trên Twitter](https://twitter.com/share?url=https://orangepi.vn/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html "Chia sẻ trên Twitter")[Gửi email cho bạn bè](mailto:?subject=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20%C4%91%E1%BA%B7t%20Nanobot%20tr%C3%AAn%20Orange%20Pi%204%20Pro%20%2F%20Zero%203W%204GB%20RAM&body=Xem%20n%C3%A0y%3A%20https%3A%2F%2Forangepi.vn%2Fhuong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html "Gửi email cho bạn bè")[Ghim trên Pinterest](https://pinterest.com/pin/create/button?url=https://orangepi.vn/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html&media=https://orangepi.vn/wp-content/uploads/2026/05/Huong-dan-cai-dat-Nanobot-1200x800.webp&description=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20%C4%91%E1%BA%B7t%20Nanobot%20tr%C3%AAn%20Orange%20Pi%204%20Pro%20%2F%20Zero%203W%204GB%20RAM "Ghim trên Pinterest")[Chia sẻ trên LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https://orangepi.vn/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html&title=H%C6%B0%E1%BB%9Bng%20d%E1%BA%ABn%20c%C3%A0i%20%C4%91%E1%BA%B7t%20Nanobot%20tr%C3%AAn%20Orange%20Pi%204%20Pro%20%2F%20Zero%203W%204GB%20RAM "Chia sẻ trên LinkedIn")
![](https://secure.gravatar.com/avatar/fedf9d992f1e8a3e3109ac596191d91386f32fb01a7f6a91e35636c5eefb761e?s=90&d=mm&r=g)
##### superadmin
### Để lại một bình luận [Hủy](https://orangepi.vn/huong-dan-cai-dat-nanobot-tren-orange-pi-4-pro-zero-3w-4gb-ram.html\#respond)
Email của bạn sẽ không được hiển thị công khai.Các trường bắt buộc được đánh dấu \*
Bình luận \*
Tên \*
Email \*
Trang web
Δ
- Tìm kiếm:
- [![](https://orangepivn.b-cdn.net/wp-content/uploads/2017/02/cropped-logo-transparent-280x280.png)Orange Pi Việt Nam](https://orangepi.vn/)
- [Giới thiệu về máy tính nhúng](https://orangepi.vn/gioi-thieu-ve-may-tinh-nhung)
- [Hướng dẫn đặt hàng](https://orangepi.vn/dat-hang-tai-orange-pi-viet-nam)
- [Chính sách Bảo hành](https://orangepi.vn/chinh-sach-ban-hang-va-bao-hanh)
- [Thư ủy quyền phân phối tại Việt Nam](https://orangepi.vn/thu-uy-quyen-phan-phoi-tai-viet-nam)
- [Chính sách bảo mật](https://orangepi.vn/chinh-sach-bao-mat)
- [Liên hệ](https://orangepi.vn/lien-he)
- [Shop](https://orangepi.vn/shop)
- [Bo Mạch Orange Pi](https://orangepi.vn/danh-muc-san-pham/bo-mach-orange-pi)
- [Chip H3](https://orangepi.vn/tu-khoa-san-pham/chip-h3)
- [Chip H6](https://orangepi.vn/tu-khoa-san-pham/chip-h6)
- [RK3399](https://orangepi.vn/tu-khoa-san-pham/chip-rk3399)
- [RK3588, RK3566](https://orangepi.vn/tu-khoa-san-pham/rk3588)
- [Chip H616, H618](https://orangepi.vn/tu-khoa-san-pham/chip-h616)
- [Allwinner A733](https://orangepi.vn/tu-khoa-san-pham/allwinner-a733)
- [RAM 1GB](https://orangepi.vn/tu-khoa-san-pham/ram-1gb)
- [RAM 2GB](https://orangepi.vn/tu-khoa-san-pham/ram-2gb)
- [RAM 4GB](https://orangepi.vn/tu-khoa-san-pham/ram-4gb)
- [RAM 6GB](https://orangepi.vn/tu-khoa-san-pham/ram-6gb)
- [RAM 8GB](https://orangepi.vn/tu-khoa-san-pham/ram8gb)
- [Phụ kiện Orange Pi](https://orangepi.vn/danh-muc-san-pham/phu-kien-orange-pi)
- [Màn hình](https://orangepi.vn/tu-khoa-san-pham/man-hinh)
- [Vỏ Mica lắp ghép](https://orangepi.vn/tu-khoa-san-pham/vo-mica)
- [Vỏ thép kiêm tản nhiệt](https://orangepi.vn/tu-khoa-san-pham/vo-thep)
- [Vỏ nhôm nhẹ tản nhiệt tốt](https://orangepi.vn/tu-khoa-san-pham/vo-nhom)
- [Nguồn Orange Pi](https://orangepi.vn/tu-khoa-san-pham/nguon-orange-pi)
- [Thẻ nhớ microSD](https://orangepi.vn/tu-khoa-san-pham/the-nho-microsd)
- [Compute Module](https://orangepi.vn/tu-khoa-san-pham/compute-module)
- [Blog](https://orangepi.vn/blog)
- [Giới thiệu](https://orangepi.vn/category/gioi-thieu)
- [Hướng dẫn](https://orangepi.vn/category/huong-dan)
- [Trình diễn](https://orangepi.vn/category/trinh-dien)
- [Đăng nhập](https://orangepi.vn/my-account "Đăng nhập")
- [**Hotline: 0923449899**](tel:0923449899)
Bạn cần trợ giúp?
[![Messenger](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/fbmessenger.svg)Messenger](https://m.me/orangepivietnam "Messenger") [![Zalo Official Account](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/zalo.svg)Zalo Official Account](https://oa.zalo.me/1687181280533723118 "Zalo Official Account") [![Telegram](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/telegram.svg)Telegram](https://t.me/maytinhnhung "Telegram") [![Whatsapp](https://orangepi.vn/wp-content/plugins/chat-bubble/assets/images/whatsapp.svg)Whatsapp](https://api.whatsapp.com/send?phone=84923449899 "Whatsapp")
![Orange Pi Việt Nam](https://orangepivn.b-cdn.net/wp-content/uploads/2017/02/logo-transparent.png)
Orange Pi Việt NamNhà phân phối chính thức
Xin chào! 👋🏼👋🏼👋🏼 Tôi có thể giúp gì được bạn?
- [Hotline](tel:0923449899 "Hotline")
- [Facebook](https://www.facebook.com/orangepivietnam "Facebook")
- [Zalo](https://oa.zalo.me/1687181280533723118 "Zalo")
## Đăng nhập
Sign In - Google Accounts
Continue with GoogleContinue with Google. Opens in new tab
Tên tài khoản hoặc địa chỉ email \*Bắt buộc
Mật khẩu \*Bắt buộc
Ghi nhớ mật khẩuĐăng nhập
[Quên mật khẩu?](https://orangepi.vn/my-account/lost-password)