65 lines
1.1 KiB
Markdown
65 lines
1.1 KiB
Markdown
# SPORE
|
|
|
|
SProcket ORchestration Engine
|
|
|
|
## Features
|
|
|
|
- WiFi STA / AP
|
|
- node auto discovery over UDP
|
|
- service registry
|
|
- pub/sub event system
|
|
- Over-The-Air updates
|
|
|
|
## Supported Hardware
|
|
|
|
- ESP8266
|
|
|
|
## Architecture
|
|
|
|
### Auto Discovery
|
|
|
|
A node periodically executes 2 tasks responsible for auto discovers:
|
|
|
|
- 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 cluster memberlist.
|
|
Another periodic task will then call the `/api/node/status` endpoint over HTTP on each node in the memberlist to get detailed informations about the node (e.g. freeHeap, available API endpoints).
|
|
|
|
## 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
|
|
``` |