66 lines
3.4 KiB
Markdown
66 lines
3.4 KiB
Markdown
# FireWatchTower 2-Axis
|
||
|
||
An automated fire surveillance system built around a LattePanda platform, combining real-time motor control firmware with a host application for camera capture, MQTT telemetry, and remote gimbal control.
|
||
|
||
## Overview
|
||
|
||
The system mounts a camera on a 2-axis gimbal (yaw + pitch) and continuously scans the surrounding area. When motion or stopping events are detected, the host triggers image capture and publishes telemetry data over MQTT for remote monitoring.
|
||
|
||
### Architecture
|
||
|
||
```
|
||
┌─────────────────────────────────────────────┐
|
||
│ LattePanda │
|
||
│ │
|
||
│ ┌──────────────────┐ ┌───────────────┐ │
|
||
│ │ Host (Linux) │◄──►│ Arduino MCU │ │
|
||
│ │ │ │ (Firmware) │ │
|
||
│ │ - Camera (Vimba)│ │ - Motor ctrl │ │
|
||
│ │ - MQTT client │ │ - Thermal mg │ │
|
||
│ │ - Serial I/O │ │ - Cmd parser │ │
|
||
│ └──────────────────┘ └───────────────┘ │
|
||
│ │
|
||
│ External: Camera │ TMC5160 Drivers │ Fan│
|
||
└─────────────────────────────────────────────┘
|
||
```
|
||
|
||
### Components
|
||
|
||
| Component | Description |
|
||
|-----------|-------------|
|
||
| **firmware/** | Arduino sketch running on the LattePanda's onboard MCU. Handles TMC5160 stepper motor drivers, endstop homing, thermal management (DHT sensor + PWM fan), and serial command parsing. |
|
||
| **host/** | C++ application running on the Linux side. Manages camera acquisition via Vimba SDK, communicates with the firmware over serial, and publishes/subscribes to MQTT topics for remote control and status reporting. |
|
||
|
||
## Hardware
|
||
|
||
- **Main board:** LattePanda (Intel x86 + Arduino Leonardo ATmega32U4)
|
||
- **Motor drivers:** 2× TMC5160 (yaw and pitch axes)
|
||
- **Camera:** Area-scan camera via Vimba SDK (Allied Vision / FLIR)
|
||
- **Thermal:** DHT22 temperature/humidity sensor + PWM-controlled cooling fan
|
||
- **Endstops:** Hardware limit switches on both axes
|
||
|
||
## Quick Start
|
||
|
||
1. **Flash firmware:** `cd firmware && pio run --environment megaatmega2560 --target upload`
|
||
2. **Build host:** `cd host/build && cmake .. && make -j$(nproc)`
|
||
3. **Run host:** `./FireWatchTower_2axis --init true --start true`
|
||
|
||
See the subdirectory README files for detailed documentation:
|
||
- [firmware/README.md](firmware/README.md) — MCU firmware architecture, commands, pinout
|
||
- [host/README.md](host/README.md) — Host application build, configuration, MQTT topics
|
||
|
||
## MQTT Topics
|
||
|
||
The system uses the following topic pattern (`<tower>` is the instance name, default `Dev`):
|
||
|
||
| Topic | Direction | Description |
|
||
|-------|-----------|-------------|
|
||
| `GGS/FWT/<tower>/StatusCode` | Publish | Current control mode (0=free scan, 1=guided) |
|
||
| `GGS/FWT/<tower>/CamEvent/RGB` | Publish | Camera event notifications |
|
||
| `GGS/FWT/<tower>/ControlCode` | Subscribe | Set control mode remotely |
|
||
| `GGS/FWT/<tower>/target_HDG` | Subscribe | Set target heading for guided mode |
|
||
|
||
## License
|
||
|
||
[Add your license here]
|