Skip to content

feat: solar debug MQTT publishing with rate limiting (#66)#83

Merged
basmeerman merged 2 commits intomasterfrom
work/plan-01-issue-66
Mar 19, 2026
Merged

feat: solar debug MQTT publishing with rate limiting (#66)#83
basmeerman merged 2 commits intomasterfrom
work/plan-01-issue-66

Conversation

@basmeerman
Copy link
Copy Markdown
Owner

Summary

  • New pure C module solar_debug_json.c — formats evse_solar_debug_t struct to JSON
  • Bridge getter evse_get_solar_debug() — spinlock-protected snapshot read
  • MQTT topic SmartEVSE/<serial>/Debug/Solar — publishes JSON every 5s when enabled
  • MQTT control Set/SolarDebug — enable (1/ON) or disable (0/OFF) publishing
  • 10 new tests — 7 JSON formatter tests + 3 MQTT parser tests

Gated 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)
  • CI pipeline green (native tests, sanitizers, static analysis, firmware build)
  • MQTT: mosquitto_sub -t "SmartEVSE/+/Debug/Solar" shows JSON after sending 1 to Set/SolarDebug

🤖 Generated with Claude Code

basmeerman and others added 2 commits March 19, 2026 09:21
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>
@basmeerman basmeerman merged commit aef3769 into master Mar 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Plan-01] Follow-up: Solar debug MQTT/WS publishing

1 participant