Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send error payload with MQTT, especially when NTP/RTC is out of sync #97

Open
3rwww1 opened this issue Jun 13, 2018 · 1 comment
Open
Labels
enhancement New feature or request high priority

Comments

@3rwww1
Copy link
Contributor

3rwww1 commented Jun 13, 2018

THIS IS A DRAFT

We are lacking an error reporting funnel.

When we have a Big Problem™, we should record it somewhere, or send it somewhere, if possible. Flashing a LED just doesn't cut it. Here is a proposed solution:

What to to when we detect an error:

  • obviously flash the LED and log an error message (already working somehow)
  • prepare an MQTT message with an error payload and possibly error properties
  • if we can send it, send it
  • if we can't send it, record it (and then replay it)

How to format the error message:
we SHALL have a global errors object, with one entry per error type.

  • the entry key MUST be the error code, so that the latest error of that type remains in the shadow
  • the entry value CAN be an object with nested properties. Properties differ with respect to the error type.

Example

"state" : {
  "reported" : {
    "errors" : {
      "ntp": {
        "lastNtpSync": "date_or_null",
      },
      "spiffs": null,
      "rtc" : {
        "stopped": {
          "lastSyncOffset": "diff_between_rtc_time_and_last_ntp_sync"
        }
      }
    }
  }
}
@3rwww1 3rwww1 added enhancement New feature or request high priority labels Jun 13, 2018
@Kameeno
Copy link
Contributor

Kameeno commented Jun 23, 2018

can be right to get also a timestamp ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

No branches or pull requests

2 participants