https://home.hottis.de/gitlab/mainscnt/sinkserver
The SinkServer is the main ingress collector. It accepts single UDP packets of the following structure:
#define SECONDS_PER_MINUTE 60 typedef struct __attribute__((__packed__)) { char deviceId[16]; uint8_t hash[SHA256_BLOCK_SIZE]; uint32_t totalRunningHours; uint32_t totalPowercycles; uint32_t totalWatchdogResets; uint32_t version; uint64_t timestamp; uint32_t frequency[SECONDS_PER_MINUTE]; } t_minuteStruct;
timestamp
is the UNIX timestamp (seconds since 1970-01-01 00:00:00 with UTC timezone) of the first measurement value in the frequency
array. It shall be synchronized using NTP.
The fields totalRunningHours
, totalPowercycles
and totalWatchdogResets
are only set by the STM 32 implementation. version
should be the short Git commit hash of the sources used to build the particular client. They can be used by other implementations to submit meta data. However, currently, these data are not stored.
The hash
will be calculated from data of the packet and a 31 octet wide shared secret.
The values in the frequency
array shall be the measurements (or calculated averages) of the 60 seconds in one minute. It is important to have the values for consecutive seconds here since there is only a single timestamp in the packet (for the first value). The unit of the values is mHz (milli Hertz).