airgradienthq / arduino

Other
212 stars 115 forks source link

BootCount not updated when posting to AirGradient is disabled #253

Open dtrejod opened 2 weeks ago

dtrejod commented 2 weeks ago

Problem

When using the local server API to get air gradient sensor data, I noticed the boot and bootCount values were not being updated. This only happened after I configured postDataToAirGradient: false. I have a simple airgradient prometheus exporter that I used to gather the local server metrics into a Prometheus instance. You can see from the below Grafana graph before postDataToAirGradient: false, the boot count metric was incremented every 1m. After the change, the bootCount value doesn't increment.

Screenshot 2024-10-06 at 11 47 16

Analysis

It appears bootCount is incremented in the sendDataToServer() func. The func returns early, not incrementing bootCount, when posting to airgradient servers is disabled.

airgradienthq commented 2 weeks ago

Yes good point. We will fix in one of the next updates.