Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ tools/pki-server/*.crt
*_key
secrets/
password*.txt

# Documentation
frontend_modification.md
frontend_emoji_list.md
94 changes: 32 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
# TianShanOS
![TianshanOS](assets/tsintro.png)

[English](README_EN.md) | [中文](README.md)

[![Build Status](https://github.com/thomas-hiddenpeak/TianshanOS/actions/workflows/build.yml/badge.svg)](https://github.com/thomas-hiddenpeak/TianshanOS/actions/workflows/build.yml)
[![Release](https://img.shields.io/github/v/release/thomas-hiddenpeak/TianshanOS)](https://github.com/thomas-hiddenpeak/TianshanOS/releases/latest)
[![License](https://img.shields.io/github/license/thomas-hiddenpeak/TianshanOS)](LICENSE)
![ESP-IDF](https://img.shields.io/badge/ESP--IDF-v5.5+-green?logo=espressif)
![C](https://img.shields.io/badge/C-99-blue?logo=c)
![ESP32-S3](https://img.shields.io/badge/ESP32--S3-supported-blue?logo=espressif)
![Configuration Oriented](https://img.shields.io/badge/Configuration-Oriented-orange)

> 天山操作系统 - ESP32 机架管理操作系统
>
> 天山控制南北两大盆地——北向 AGX 提供 AI 算力,南向 LPMU 提供通用计算和存储服务

```
╔══════════════════════════════════════════════════════════════════════╗
║ ║
║ ████████╗██╗ █████╗ ███╗ ██╗███████╗██╗ ██╗ █████╗ ███╗ ██╗ ║
║ ╚══██╔══╝██║██╔══██╗████╗ ██║██╔════╝██║ ██║██╔══██╗████╗ ██║ ║
║ ██║ ██║███████║██╔██╗ ██║███████╗███████║███████║██╔██╗ ██║ ║
║ ██║ ██║██╔══██║██║╚██╗██║╚════██║██╔══██║██╔══██║██║╚██╗██║ ║
║ ██║ ██║██║ ██║██║ ╚████║███████║██║ ██║██║ ██║██║ ╚████║ ║
║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ║
║ ║
║ TianShanOS v0.4.0 ║
║ ESP32 Rack Management Operating System ║
║ ║
╚══════════════════════════════════════════════════════════════════════╝
```

---

## 🚀 项目概述
## 项目概述

TianShanOS 是一个**面向配置而非面向代码**的嵌入式操作系统框架,基于 ESP-IDF v5.5+ 开发,用于 NVIDIA Jetson AGX + DFRobot LattePanda Mu 载板的机架管理。
TianshanOS 是一个**面向配置而非面向代码**的嵌入式操作系统框架,基于 ESP-IDF v5.5+ 开发,用于 NVIDIA Jetson AGX + DFRobot LattePanda Mu 载板的机架管理。

### 核心特性

Expand All @@ -43,38 +30,27 @@ TianShanOS 是一个**面向配置而非面向代码**的嵌入式操作系统
- **跨平台设计** - 支持 ESP32-S3 和 ESP32-P4
- **安全优先** - HTTPS/mTLS、SSH 公钥认证、PKI 证书管理、分级权限
- **统一接口** - CLI 和 WebUI 共享 Core API,行为一致
- **多语言支持** - 中/英/日/韩/德/法/西/乌克兰 8 种语言界面
- **多语言支持** - 中/英双语界面
- **CI/CD** - GitHub Actions 自动编译、Release 发布

### 系统架构

```
┌─────────────────────────────────────────────────────────────────┐
│ 用户交互层 (CLI / WebUI / HTTPS API) │
├─────────────────────────────────────────────────────────────────┤
│ Core API 层 (ts_api) │
├─────────────────────────────────────────────────────────────────┤
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ 服务管理层 │ │ 自动化引擎 │ │ 安全模块 │ │
│ │ (8阶段启动) │ │ (数据源/规则) │ │ (SSH/PKI/mTLS) │ │
│ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ 事件/消息总线 (ts_event) │
├─────────────────────────────────────────────────────────────────┤
│ 配置管理层 (NVS/SD卡/默认值,优先级:内存>SD>NVS>默认) │
├─────────────────────────────────────────────────────────────────┤
│ 硬件抽象层 (GPIO/PWM/I2C/SPI/UART/ADC) │
├─────────────────────────────────────────────────────────────────┤
│ 平台适配层 (ESP32-S3 / ESP32-P4) │
└─────────────────────────────────────────────────────────────────┘
```mermaid
flowchart TB
UI["CLI / WebUI / HTTPS API"] --> API["Core API (ts_api)"]
API --> S1["服务管理"] & S2["自动化引擎"] & S3["安全模块"]
S1 & S2 & S3 --> Event["事件总线 (ts_event)"]
Event --> Config["配置管理 (NVS/SD卡)"]
Config --> HAL["硬件抽象层 (GPIO/PWM/I2C/SPI/UART/ADC)"]
HAL --> Platform["平台适配层 (ESP32-S3 / ESP32-P4)"]
```

---

## 📦 项目结构
## 项目结构

```
TianShanOS/
TianshanOS/
├── .github/ # GitHub 配置
│ └── workflows/ # CI/CD 工作流
│ └── build.yml # 自动编译 & Release
Expand Down Expand Up @@ -108,7 +84,7 @@ TianShanOS/

---

## 🛠️ 开发环境
## 开发环境

### 依赖
- ESP-IDF v5.5.2+
Expand All @@ -120,15 +96,15 @@ TianShanOS/
```bash
# 克隆项目
git clone https://github.com/thomas-hiddenpeak/TianshanOS.git
cd TianShanOS
cd TianshanOS

# 设置 ESP-IDF 环境
. $HOME/esp/v5.5/esp-idf/export.sh

# 设置目标芯片
idf.py set-target esp32s3

# 配置项目 (TianShanOS 选项在顶层菜单)
# 配置项目 (TianshanOS 选项在顶层菜单)
idf.py menuconfig

# 编译(带版本号更新)
Expand All @@ -146,7 +122,7 @@ idf.py -p /dev/ttyACM0 flash monitor
esptool.py --chip esp32s3 -p /dev/ttyACM0 write_flash \
0x0 bootloader.bin \
0x8000 partition-table.bin \
0x10000 TianShanOS.bin
0x10000 TianshanOS.bin
```

### VS Code 开发
Expand All @@ -157,7 +133,7 @@ esptool.py --chip esp32s3 -p /dev/ttyACM0 write_flash \

---

## 📚 文档
## 文档

| 文档 | 描述 |
|-----|------|
Expand All @@ -178,10 +154,10 @@ esptool.py --chip esp32s3 -p /dev/ttyACM0 write_flash \

---

## 🎯 当前状态
## 当前状态

**版本**: 0.4.0
**阶段**: Phase 38 完成 - WebUI 多语言支持 (8种语言)
**阶段**: Phase 38 完成 - WebUI 多语言支持

### 已完成功能

Expand All @@ -196,7 +172,7 @@ esptool.py --chip esp32s3 -p /dev/ttyACM0 write_flash \
| 网络 | WiFi、以太网 W5500、HTTP/HTTPS 服务器 |
| 安全 | 会话管理、Token 认证、AES-GCM、RSA/EC、SSH 客户端、PKI 证书管理 |
| 驱动 | 风扇控制、电源监控 (ADC/INA3221/PZEM)、AGX/LPMU 电源控制、USB MUX |
| WebUI | REST API 网关、WebSocket 广播、前端仪表盘、认证系统、8语言国际化 |
| WebUI | REST API 网关、WebSocket 广播、前端仪表盘、认证系统、中英文国际化 |
| OTA | 双分区升级、版本检测、完整性校验、自动回滚 |
| 自动化引擎 | 触发器-条件-动作系统、SSH 远程执行、正则解析、变量系统、电压保护集成 |
| CI/CD | GitHub Actions 自动编译、Tag 触发 Release 发布 |
Expand Down Expand Up @@ -234,30 +210,24 @@ esptool.py --chip esp32s3 -p /dev/ttyACM0 write_flash \

---

## 🌐 多语言支持
## 多语言支持

WebUI 支持 8 种语言,根据浏览器设置自动检测:
WebUI 支持中英文界面,根据浏览器设置自动检测:

| 语言 | 代码 |
|------|------|
| 🇨🇳 简体中文 | zh-CN |
| 🇺🇸 English | en-US |
| 🇯🇵 日本語 | ja-JP |
| 🇰🇷 한국어 | ko-KR |
| 🇩🇪 Deutsch | de-DE |
| 🇫🇷 Français | fr-FR |
| 🇪🇸 Español | es-ES |
| 🇺🇦 Українська | uk-UA |
| 简体中文 | zh-CN |
| English | en-US |

---

## 👥 贡献者
## 贡献者

- Thomas (项目负责人)
- massif-01

---

## 📄 许可证
## 许可证

本项目采用 GPL-3.0 许可证,详见 [LICENSE](LICENSE) 文件。
80 changes: 30 additions & 50 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# TianShanOS
![TianshanOS](assets/tsintro.png)

[English](README_EN.md) | [中文](README.md)

> TianShan Operating System - ESP32 Rack Management Operating System
>
> TianShan controls both the northern and southern basins — northward to AGX for AI computing power, southward to LPMU for general computing and storage services
[![Build Status](https://github.com/thomas-hiddenpeak/TianshanOS/actions/workflows/build.yml/badge.svg)](https://github.com/thomas-hiddenpeak/TianshanOS/actions/workflows/build.yml)
[![Release](https://img.shields.io/github/v/release/thomas-hiddenpeak/TianshanOS)](https://github.com/thomas-hiddenpeak/TianshanOS/releases/latest)
[![License](https://img.shields.io/github/license/thomas-hiddenpeak/TianshanOS)](LICENSE)
![ESP-IDF](https://img.shields.io/badge/ESP--IDF-v5.5+-green?logo=espressif)
![C](https://img.shields.io/badge/C-99-blue?logo=c)
![ESP32-S3](https://img.shields.io/badge/ESP32--S3-supported-blue?logo=espressif)
![Configuration Oriented](https://img.shields.io/badge/Configuration-Oriented-orange)

```
╔══════════════════════════════════════════════════════════════════════╗
║ ║
║ ████████╗██╗ █████╗ ███╗ ██╗███████╗██╗ ██╗ █████╗ ███╗ ██╗ ║
║ ╚══██╔══╝██║██╔══██╗████╗ ██║██╔════╝██║ ██║██╔══██╗████╗ ██║ ║
║ ██║ ██║███████║██╔██╗ ██║███████╗███████║███████║██╔██╗ ██║ ║
║ ██║ ██║██╔══██║██║╚██╗██║╚════██║██╔══██║██╔══██║██║╚██╗██║ ║
║ ██║ ██║██║ ██║██║ ╚████║███████║██║ ██║██║ ██║██║ ╚████║ ║
║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ║
║ ║
║ TianShanOS v0.3.0 ║
║ ESP32 Rack Management Operating System ║
║ ║
╚══════════════════════════════════════════════════════════════════════╝
```
> Tianshan Operating System - ESP32 Rack Management Operating System
>
> Tianshan controls both the northern and southern basins — northward to AGX for AI computing power, southward to LPMU for general computing and storage services

---

## 🚀 Project Overview
## Project Overview

TianShanOS is a **configuration-oriented rather than code-oriented** embedded operating system framework, developed based on ESP-IDF v5.5+, designed for rack management of NVIDIA Jetson AGX + DFRobot LattePanda Mu carrier boards.
TianshanOS is a **configuration-oriented rather than code-oriented** embedded operating system framework, developed based on ESP-IDF v5.5+, designed for rack management of NVIDIA Jetson AGX + DFRobot LattePanda Mu carrier boards.

### Core Features

Expand All @@ -38,38 +30,26 @@ TianShanOS is a **configuration-oriented rather than code-oriented** embedded op
- **Cross-Platform Design** - Supports ESP32-S3 and ESP32-P4
- **Security First** - HTTPS/mTLS, SSH public key authentication, PKI certificate management, tiered permissions
- **Unified Interface** - CLI and WebUI share Core API with consistent behavior
- **Multi-Language Support** - Chinese, English, Japanese, and Korean interface support
- **Multi-Language Support** - Chinese and English interface support

### System Architecture

```
┌─────────────────────────────────────────────────────────────────┐
│ User Interaction Layer (CLI / WebUI / HTTPS API) │
├─────────────────────────────────────────────────────────────────┤
│ Core API Layer (ts_api) │
├─────────────────────────────────────────────────────────────────┤
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ Service │ │ Automation │ │ Security Module │ │
│ │ Management │ │ Engine │ │ (SSH/PKI/mTLS) │ │
│ │ (8-stage) │ │ (Data/Rules) │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Event/Message Bus (ts_event) │
├─────────────────────────────────────────────────────────────────┤
│ Config Management (NVS/SD/Defaults, Priority: Mem>SD>NVS>Def) │
├─────────────────────────────────────────────────────────────────┤
│ Hardware Abstraction Layer (GPIO/PWM/I2C/SPI/UART/ADC) │
├─────────────────────────────────────────────────────────────────┤
│ Platform Adaptation Layer (ESP32-S3 / ESP32-P4) │
└─────────────────────────────────────────────────────────────────┘
```mermaid
flowchart TB
UI["CLI / WebUI / HTTPS API"] --> API["Core API (ts_api)"]
API --> S1["Service Mgmt"] & S2["Automation"] & S3["Security"]
S1 & S2 & S3 --> Event["Event Bus (ts_event)"]
Event --> Config["Config Management (NVS/SD)"]
Config --> HAL["HAL (GPIO/PWM/I2C/SPI/UART/ADC)"]
HAL --> Platform["Platform Layer (ESP32-S3 / ESP32-P4)"]
```

---

## 📦 Project Structure
## Project Structure

```
TianShanOS/
TianshanOS/
├── components/ # ESP-IDF Components (18 total)
│ ├── ts_core/ # Core Framework (config/event/service/log)
│ ├── ts_hal/ # Hardware Abstraction Layer (GPIO/PWM/I2C/SPI/UART/ADC)
Expand Down Expand Up @@ -97,7 +77,7 @@ TianShanOS/

---

## 🛠️ Development Environment
## Development Environment

### Dependencies
- ESP-IDF v5.5.2+
Expand All @@ -109,15 +89,15 @@ TianShanOS/
```bash
# Clone the repository
git clone https://github.com/thomas-hiddenpeak/TianshanOS.git
cd TianShanOS
cd TianshanOS

# Set up ESP-IDF environment
. $HOME/esp/v5.5/esp-idf/export.sh

# Set target chip
idf.py set-target esp32s3

# Configure project (TianShanOS options are in the top-level menu)
# Configure project (TianshanOS options are in the top-level menu)
idf.py menuconfig

# Build
Expand All @@ -135,7 +115,7 @@ For detailed instructions, please refer to the [Quick Start Guide](docs/QUICK_ST

---

## 📚 Documentation
## Documentation

| Document | Description |
|----------|-------------|
Expand All @@ -156,7 +136,7 @@ For detailed instructions, please refer to the [Quick Start Guide](docs/QUICK_ST

---

## 🎯 Current Status
## Current Status

**Version**: 0.3.0
**Phase**: Phase 20 Complete - Automation Engine, SSH Remote Execution, Variable System
Expand Down Expand Up @@ -198,7 +178,7 @@ See [Development Progress](docs/DEVELOPMENT_PROGRESS.md) for detailed status.

---

## 👥 Contributors
## Contributors

- Thomas (Project Lead)
- massif-01
Binary file added assets/tsintro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading