ApiServer: add AsyncWebSocket at /ws; accept JSON {event, payload} (string or object) and dispatch via ctx.fire; mirror all local events to clients using NodeContext::onAny.\nNodeContext: add onAny subscriber API.\nNeoPatternService: add api/neopattern/color event to set solid color.\nCluster: centralize cluster/broadcast sending in core; services delegate.\nAPI: add generic /api/node/event and /api/cluster/event endpoints in respective services.\nTests: add ws-color-client, ws-cluster-broadcast-color, http-cluster-broadcast-color.\nDocs: add StreamingAPI.md; update README and test/README.\nFixes: robust WS JSON parsing on ESP8266 and payload handling.
Register core handler ctx.on("cluster/broadcast") in ClusterManager to send CLUSTER_EVENT via subnet-directed UDP broadcast; services now delegate broadcasting by firing this event. Fix lambda to reference this->ctx inside handler. Update NeoPatternService to fire cluster/broadcast with event JSON instead of sending UDP directly. Improves consistency and removes duplicated UDP code in services.
Build control payload once from request params and apply locally through ctx.fire("api/neopattern"). If broadcast=true, send the same payload as a CLUSTER_EVENT over UDP.\n\nChanges:\n- Remove duplicated per-parameter setters in REST handler\n- Always fire local event to update state consistently\n- Broadcast reuses same payload; logs retained\n\nImpact:\n- Less duplication, clearer flow, identical behavior for local/remote updates, and simpler maintenance.
Add CLUSTER_EVENT message type and end-to-end handling across cluster and NeoPattern example.\n\nCluster protocol / core:\n- Add ClusterProtocol::CLUSTER_EVENT_MSG\n- ClusterManager: register predicate/handler for CLUSTER_EVENT\n- Robust parsing: accept data as string or nested JSON; serialize nested data to string before firing\n- Add defensive null-termination for full UDP reads; log unknown message head if no handler matches\n- Logging: source IP, payload length, missing fields, and pre-fire event details\n\nNeoPatternService:\n- Constructor now accepts NodeContext and registers ctx.on(api/neopattern) handler\n- /api/neopattern: add optional boolean 'broadcast' flag\n- If broadcast=true: build event payload and send CLUSTER_EVENT over UDP (subnet-directed broadcast); log target and payload size; also fire locally so sender applies immediately\n- Implement applyControlParams with robust ArduinoJson is<T>() checks (replaces deprecated containsKey()) and flexible string/number parsing for color, brightness, steps, interval\n- Minor fixes: include Globals for ClusterProtocol, include ESP8266WiFi for broadcast IP calc, safer brightness clamping\n\nExample:\n- Update neopattern main to pass NodeContext into NeoPatternService\n\nResult:\n- Nodes receive and process CLUSTER_EVENT (api/neopattern) via ctx.fire/ctx.on\n- Broadcast reliably reaches peers; parsing handles both stringified and nested JSON data\n- Additional logs aid diagnosis of delivery/format issues and remove deprecation warnings
- Restructure include/ and src/ directories with logical grouping
- Move core components to spore/core/ (NodeContext, NetworkManager, TaskManager, ClusterManager, ApiServer)
- Move services to spore/services/ (NodeService, NetworkService, ClusterService, TaskService)
- Move types to spore/types/ (NodeInfo, ApiTypes, Config)
- Move internal components to spore/internal/ (Globals)
- Update all #include statements to use new namespace paths
- Update platformio.ini build filters for all environments
- Update all example files to use new include paths
- Maintain backward compatibility for public API
- Improve code organization, maintainability, and scalability
This reorganization follows modern C++ project structure patterns and provides
clear separation between public API, internal implementation, and utilities.
All examples compile successfully with the new structure.
- Add Spore class as unified interface for all core framework functionality
- Implement setup() and begin() methods for flexible initialization pattern
- Add service registration with addService() for both raw and smart pointers
- Provide accessor methods for core components (getTaskManager, getContext, etc.)
- Automatically include core services (Node, Network, Cluster, Task)
- Update all examples to use simplified Spore framework approach
- Fix circular dependency issues in include structure
- Remove setHostname and setApiPort configuration methods
- Add comprehensive documentation and usage examples
The Spore class encapsulates all core functionality from the base example
and provides a clean, unified API for the entire framework. Examples now
use just spore.setup() -> add services -> spore.begin() -> spore.loop().