fablabbcn / smartcitizen-api

The Smart Citizen Engine
https://developer.smartcitizen.me
GNU Affero General Public License v3.0
10 stars 4 forks source link

Add a means of tracking data parse errors for a device #288

Open timcowlishaw opened 6 months ago

timcowlishaw commented 6 months ago

We have a recurring, but intermittent error where some devices send malformed payloads which cause errors on ingest (eg: This sentry error).

These can be fixed in a firmware release, but we need to be able to inform users that their device is 'unhealthy' and that they should upgrade the firmware.

Therefore, we should catch these errors in the mqtt parser, and create some sort of 'device health status' flag on devices, which gets set when a malformed packet is received.

We could even capture the errors themselves, and store a 'device error log' in the db for debugging