feat: solar debug MQTT publishing with rate limiting (#66)#83
Merged
basmeerman merged 2 commits intomasterfrom Mar 19, 2026
Merged
feat: solar debug MQTT publishing with rate limiting (#66)#83basmeerman merged 2 commits intomasterfrom
basmeerman merged 2 commits intomasterfrom
Conversation
Add MQTT topic SmartEVSE/<serial>/Debug/Solar that publishes a JSON snapshot of the solar regulation state every 5 seconds. Gated behind Set/SolarDebug (1/0) — no overhead when disabled. New pure C module solar_debug_json.c formats evse_solar_debug_t to JSON, tested natively (7 tests). Bridge getter evse_get_solar_debug() reads the snapshot with spinlock protection. MQTT parser extended with MQTT_CMD_SOLAR_DEBUG (3 parser tests). Closes #66 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The MQTT receive callback references mqttSetSolarDebug before its definition. Add static forward declaration to fix the firmware build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
solar_debug_json.c— formatsevse_solar_debug_tstruct to JSONevse_get_solar_debug()— spinlock-protected snapshot readSmartEVSE/<serial>/Debug/Solar— publishes JSON every 5s when enabledSet/SolarDebug— enable (1/ON) or disable (0/OFF) publishingGated behind a debug flag — zero overhead when disabled. No state machine changes.
Closes #66 — completes Plan 01 (7/7 issues done).
Test plan
cd SmartEVSE-3/test/native && make clean test— all tests pass (38 suites)mosquitto_sub -t "SmartEVSE/+/Debug/Solar"shows JSON after sending1toSet/SolarDebug🤖 Generated with Claude Code