diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..4ed8a70a250130d536b0d66f160bca3c9ec40a5b --- /dev/null +++ b/README.en.md @@ -0,0 +1,109 @@ +# IPOM Hydrogen + +IPOM Hydrogen is a drone route management and control system developed based on the Tornado framework, primarily designed for scheduling drone inspection tasks, video control, and data upload. + +## Features + +- **Route Management**: Supports route upload, deletion, and deployment operations +- **Drone Control**: Supports video start/stop control and image upload +- **TMS Integration**: Integrates with the TMS system to enable task deployment and command issuance +- **MQTT Communication**: Receives real-time drone status information via MQTT +- **Object Storage**: Integrates MinIO for reliable storage of inspection data + +## Project Structure + +``` +ipom_hydrogen/ +├── app/ # Main application service +│ ├── hydrogen_application.py # Tornado HTTP service entry +│ ├── boundary.py # TMS boundary interface +│ ├── minio_client.py # MinIO client +│ └── server_config.py # Service configuration +├── mqtt/ # MQTT client +│ └── mqtt_client.py # MQTT message handling +└── app/Dockerfile # Application container build file +``` + +## Quick Start + +### Prerequisites + +- Python 3.11+ +- SQLite3 +- MQTT Broker + +### Installation and Deployment + +1. Clone the project: +```bash +git clone https://gitee.com/temp-ipom/ipom_hydrogen.git +cd ipom_hydrogen +``` + +2. Install dependencies: +```bash +pip install -r requirements.txt +``` + +3. Configure the service: +Edit `app/server_config.py` to configure TMS address, MinIO connection, and other settings. + +4. Start the service: +```bash +python app/hydrogen_application.py +``` + +The service will listen on port 8848 after startup. + +### Docker Deployment + +```bash +# Build the application image +docker build -t ipom-hydrogen -f app/Dockerfile . + +# Build the MQTT image +docker build -t ipom-hydrogen-mqtt -f mqtt/Dockerfile . +``` + +## API Endpoints + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/api/waylines` | GET | Retrieve list of routes | +| `/api/waylines/upload` | POST | Upload route file | +| `/api/waylines/delete` | DELETE | Delete a route | +| `/api/waylines/deploy` | POST | Deploy route task | +| `/api/drone/video/start` | POST | Start drone video stream | +| `/api/drone/video/stop` | POST | Stop drone video stream | +| `/api/drone/image/upload` | POST | Upload drone image | + +## Usage Examples + +### Upload a Route File + +```python +import requests + +url = "http://localhost:8848/api/waylines/upload" +files = {'file': open('wayline.kml', 'rb')} +response = requests.post(url, files=files) +print(response.json()) +``` + +### Start Drone Video Stream + +```python +import requests + +url = "http://localhost:8848/api/drone/video/start" +data = { + "drone_sn": "SN123456789", + "nvr": "nvr001" +} +response = requests.post(url, json=data) +print(response.json()) +``` + +## License + +This project is for internal use only. For commercial licensing, please contact the development team. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ef1becd098b2549a25814969d3a7ba0a96935e6a --- /dev/null +++ b/README.md @@ -0,0 +1,111 @@ + + +# IPOM Hydrogen + +IPOM Hydrogen 是一款基于 Tornado 框架开发的无人机航线管理与控制系统,主要用于无人机巡检任务的调度、视频控制及数据上传。 + +## 功能特性 + +- **航线管理**:支持航线上传、删除、部署等操作 +- **无人机控制**:支持视频开启/停止控制、图像上传 +- **TMS 集成**:与 TMS 系统对接,实现任务部署与控制指令下发 +- **MQTT 通信**:通过 MQTT 接收无人机实时状态信息 +- **对象存储**:集成 MinIO 实现巡检数据的可靠存储 + +## 项目结构 + +``` +ipom_hydrogen/ +├── app/ # 主应用服务 +│ ├── hydrogen_application.py # Tornado HTTP 服务入口 +│ ├── boundary.py # TMS 边界接口 +│ ├── minio_client.py # MinIO 客户端 +│ └── server_config.py # 服务配置 +├── mqtt/ # MQTT 客户端 +│ └── mqtt_client.py # MQTT 消息处理 +└── app/Dockerfile # 应用容器构建文件 +``` + +## 快速开始 + +### 环境要求 + +- Python 3.11+ +- SQLite3 +- MQTT Broker + +### 安装部署 + +1. 克隆项目: +```bash +git clone https://gitee.com/temp-ipom/ipom_hydrogen.git +cd ipom_hydrogen +``` + +2. 安装依赖: +```bash +pip install -r requirements.txt +``` + +3. 配置服务: +编辑 `app/server_config.py` 配置 TMS 地址、MinIO 连接等信息。 + +4. 启动服务: +```bash +python app/hydrogen_application.py +``` + +服务启动后监听端口 8848。 + +### Docker 部署 + +```bash +# 构建应用镜像 +docker build -t ipom-hydrogen -f app/Dockerfile . + +# 构建 MQTT 镜像 +docker build -t ipom-hydrogen-mqtt -f mqtt/Dockerfile . +``` + +## API 接口 + +| 接口 | 方法 | 说明 | +|------|------|------| +| `/api/waylines` | GET | 获取航线列表 | +| `/api/waylines/upload` | POST | 上传航线文件 | +| `/api/waylines/delete` | DELETE | 删除航线 | +| `/api/waylines/deploy` | POST | 部署航线任务 | +| `/api/drone/video/start` | POST | 开启无人机视频 | +| `/api/drone/video/stop` | POST | 停止无人机视频 | +| `/api/drone/image/upload` | POST | 上传无人机图像 | + +## 使用示例 + +### 上传航线文件 + +```python +import requests + +url = "http://localhost:8848/api/waylines/upload" +files = {'file': open('wayline.kml', 'rb')} +response = requests.post(url, files=files) +print(response.json()) +``` + +### 开启无人机视频 + +```python +import requests + +url = "http://localhost:8848/api/drone/video/start" +data = { + "drone_sn": "SN123456789", + "nvr": "nvr001" +} +response = requests.post(url, json=data) +print(response.json()) +``` + +## 许可证 + +本项目仅供内部使用,如需商业授权请联系开发团队。 \ No newline at end of file