Skip to content

Commit

Permalink
0.8.130
Browse files Browse the repository at this point in the history
* add timestamp to JSON output #1707
* restart Ahoy using MqTT #1667
  • Loading branch information
lumapu committed Aug 4, 2024
1 parent a8117ee commit 24ceb3e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* merge PR: Power limit command accelerated #1704
* merge PR: reduce update cycle of ePaper from 5 to 10 seconds #1706
* merge PR: small fixes in different files #1711
* add timestamp to JSON output #1707
* restart Ahoy using MqTT #1667

## 0.8.129 - 2024-07-11
* sort alarms ascending #1471
Expand Down
7 changes: 5 additions & 2 deletions src/publisher/pubMqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ class PubMqtt {
tickerMinute();
publish(mLwtTopic.data(), mqttStr[MQTT_STR_LWT_CONN], true, false);

snprintf(mVal.data(), mVal.size(), "ctrl/restart_ahoy");
subscribe(mVal.data());

for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
snprintf(mVal.data(), mVal.size(), "ctrl/limit/%d", i);
subscribe(mVal.data(), QOS_2);
Expand Down Expand Up @@ -386,9 +389,9 @@ class PubMqtt {
pos++;
}

/*char out[128];
char out[128];
serializeJson(root, out, 128);
DPRINTLN(DBG_INFO, "json: " + String(out));*/
DPRINTLN(DBG_INFO, "json: " + String(out));
(mSubscriptionCb)(root);

mRxCnt++;
Expand Down
1 change: 1 addition & 0 deletions src/publisher/pubMqttIvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class PubMqttIvData {
publish = true;

if (publish) {
doc[F("ts")] = rec->ts;
// if next channel or end->publish
serializeJson(doc, mVal.data(), mVal.size());
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/ch%d", mIv->config->name, rec->assign[mPos].ch);
Expand Down
2 changes: 2 additions & 0 deletions src/web/RestApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,8 @@ class RestApi {
} else if(F("dev") == jsonIn[F("cmd")]) {
DPRINTLN(DBG_INFO, F("dev cmd"));
iv->setDevCommand(jsonIn[F("val")].as<int>());
} else if(F("restart_ahoy") == jsonIn[F("cmd")]) {
mApp->setRebootFlag();
} else {
jsonOut[F("error")] = F("ERR_UNKNOWN_CMD");
return false;
Expand Down

0 comments on commit 24ceb3e

Please sign in to comment.