Files
spore/README.md

81 lines
1.7 KiB
Markdown

# SPORE
> SProcket ORchestration Engine
SPORE is a simple cluster engine for ESP8266 microcontrollers.
## Features
- WiFi STA / AP
- auto discovery over UDP
- service registry
- pub/sub event system
- Over-The-Air updates
## Supported Hardware
- ESP-01
## Architecture
### Components
The core architecture consists for following components:
- Network Manager: WiFi connection handling
- Cluster Manager: node discovery and memberlist management
- API Server: HTTP API for interacting with node and cluster
- Task Scheduler: internal scheduler used for system and user defined tasks
### Auto Discovery
A node periodically executes 2 tasks responsible for auto discovery:
- send discovery: send UDP packet on broadcast address to discover nodes
- listen for discovery: receive UDP packets and send response back to the node who initiated discovery
Discovered nodes are added to the so clusters memberlist.
Another periodic task will then call the `/api/node/status` endpoint over HTTP on each node in the memberlist to get system resources and available API endpoints.
### Event System
The `NodeContext` implements an event system for publishing and subscribing to local and cluster wide events (TODO).
It is used internally for communication between different components and tasks.
## Develop
### Configuration
Choose one of your nodes as the API node to interact with the cluster and configure it in `.env`:
```sh
export API_NODE=10.0.1.x
```
### Build
Build the firmware:
```sh
./ctl.sh build
```
### Flash
Flash firmware to a connected device:
```sh
./ctl.sh flash
```
### OTA
Update one nodes:
```sh
./ctl.sh ota update 10.0.1.x
```
Update all nodes:
```sh
./ctl.sh ota all
```