42 Commits

Author SHA1 Message Date
ad879bfe7b feat: remove CpuUsage calculation 2025-10-27 10:38:56 +01:00
4559e13d7d fix: revert RAW message 2025-10-27 07:48:06 +01:00
0f003335b3 feat: new cluster protocol, event naming 2025-10-26 12:43:22 +01:00
e796375a9f feat: memberlist optimization 2025-10-21 10:50:46 +02:00
daae29dd3f refactor: update local node 2025-10-20 21:35:08 +02:00
37a68e26d8 refactor: remove unused and obsolet stuff 2025-10-20 21:21:02 +02:00
407b651b82 feat: change event naming schema 2025-10-19 13:48:13 +02:00
3ed44cd00f feat: improve cluster forming; just use heartbeat to form the cluster 2025-10-19 12:50:43 +02:00
b404852fc7 feat: GET node config endpoint 2025-10-15 22:36:20 +02:00
7063b1ab16 feat: persistent custom labels 2025-10-15 22:23:00 +02:00
993a431310 feat: persistent config 2025-10-15 21:52:24 +02:00
a45871625e refactor: harmonize method names 2025-10-14 18:01:37 +02:00
0fcebc0459 feat: multimatrix example 2025-10-04 13:54:06 +02:00
f78dd8b843 feat: matrix stream example 2025-10-02 21:36:46 +02:00
f3d99b174f feat: udp stream 2025-10-01 22:34:32 +02:00
7a37901fb2 feat(streaming): suppress WS echo via origin tagging
Inject _origin=ws:<clientId> into JSON payloads on inbound WS messages and strip it on broadcast while skipping the origin client. Documents behavior in StreamingAPI.md.
2025-09-28 21:23:05 +02:00
3cc5405292 feat(streaming): introduce WebSocket Streaming API bridging event bus
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.
2025-09-28 21:10:26 +02:00
cabf857bbd feat(cluster, neopattern): add CLUSTER_EVENT and broadcast handling
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
2025-09-28 13:18:25 +02:00
eaeb9bbea8 config: more frequent cluster_listen 2025-09-25 22:07:22 +02:00
096cf12704 feat: measure latency 2025-09-25 21:54:25 +02:00
356ec3d381 feat: simplify udp listen 2025-09-25 20:44:31 +02:00
51bd7bd909 feat: introduce udp state machine 2025-09-24 21:23:00 +02:00
921e2c7152 feat(cluster): move member info sync to UDP heartbeat; remove HTTP polling
Broadcast CLUSTER_HEARTBEAT every 5s; peers reply with CLUSTER_NODE_INFO containing resources and labels. Update memberList from received node info and set status/lastSeen; keep UDP discovery responses.

Disable HTTP-based updateAllMembersInfoTaskCallback loop to reduce network and memory overhead.

Add protocol constants HEARTBEAT_MSG and NODE_INFO_MSG; increase UDP buffer to 512 bytes.

Set default heartbeat_interval_ms to 5000 ms.

Fix sdkVersion JSON fallback by converting to const char* before assigning to String.
2025-09-23 22:11:49 +02:00
93f09c3bb4 feat: unified monitoring service 2025-09-16 20:09:48 +02:00
702eec5a13 feat: releay ui example, simplify logging 2025-09-16 15:32:49 +02:00
2d85f560bb feat: serve static files, relay example 2025-09-16 12:12:27 +02:00
8a2988cb50 feat: logging service 2025-09-16 10:10:23 +02:00
98fdc3e1ae WIP: service and broken partitions 2025-09-15 20:33:15 +02:00
554c6ff38d refactor: reorganize project structure with modern C++ namespace organization
- 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.
2025-09-13 21:30:07 +02:00
bf17684dc6 feat: implement Spore framework class as main orchestration layer
- 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().
2025-09-13 21:17:54 +02:00
72b559e047 refactor: simplify endpoint and capabilities 2025-09-13 19:15:07 +02:00
12caeb0be6 feat: services (#2) 2025-09-13 13:45:24 +02:00
fe045804cb feat: set labels in NodeContext/Info 2025-08-29 20:21:11 +02:00
d3a9802ec9 feat: add labels to NodeInfo 2025-08-29 13:30:08 +02:00
4b63d1011f feat: improve task handling, refactoring 2025-08-28 20:46:27 +02:00
d7e98a41fa feature/capabilities (#1)
Reviewed-on: #1
2025-08-28 11:17:24 +02:00
f48ddcf9f7 chore: move header files to includes folder 2025-08-22 16:06:05 +02:00
30a5f8b8cb feat: task manager endpoint, updated documentation 2025-08-22 15:47:08 +02:00
0d51816bd3 feat: bind tasks instead of passing fn ptrs when registering a task 2025-08-21 22:24:46 +02:00
f80b594d21 feat: task manager 2025-08-21 21:52:25 +02:00
fd89c8e7eb feat: config class 2025-08-21 21:33:54 +02:00
fc015e8958 basic functionality 2025-08-21 15:54:05 +02:00