melkati / CO2-Gadget

An advanced CO2 Monitor/Meter firmware for ESP32 with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.
https://emariete.com/medidor-co2-gadget/
GNU General Public License v3.0
64 stars 13 forks source link

Temperature offset only in sensor memory #178

Closed Olaruci closed 4 months ago

Olaruci commented 8 months ago

CO2 Gadget version and flavour

Paste the two first serial log lines, as:

-->[STUP] CO2 Gadget Version: 0.9.030-development beta: TTGO T-Display 
-->[STUP] Version compiled: Feb 09 2024 

CO2 Gadget installation method?

Describe the bug

If the offset is stored in the sensor (Sensirion SDC30 ) but CO2 Gadget doesn't know it, it can be out of sync and the sensor still adjust the temperature but CO2 Gadget shows the offset at 0.

To Reproduce Steps to reproduce the behavior: it can happen if, for example, you adjust the offset in CO2 Gadget (and so in the sensor) but later you reset CO2 Gadget preferences by, for example, erasing the flash memory when installing new version. Then every time after a restart I can see a temperature of 30C that slowly decreases to an ambiental temp of 21, so clearly an offset is applied but in Co2 Gadget is showed as 0 (where previously it had to be 9 to have same behavior)

Expected behavior Temperature offset inside the sensor and in Co2 Gadget to be in sync.

melkati commented 8 months ago

Thank you reporting and for your patience,

Now the offset is working right with some fixes we applied internally to the under the hood sensors library https://github.com/kike-canaries/canairio_sensorlib/pull/198 but there is still some issue with temperature offset to be on sync between [sensor <=> library <=> CO2 Gadget].

I'm still working on it. Version 0.9.36 on development already includes some changes but it's not finished.

Sorry for the time it's taking, it's not too easy as it's deeply hidden in the logic and looks like it not only affects the SCD30 sensor but also the SCD4x.

melkati commented 8 months ago

Hi.

Just to let you know I'm still working on this.

Looks like the bug is deeper than I thought. You can find more information and see advancements here: https://github.com/kike-canaries/canairio_sensorlib/issues/203

Thank you very much for uncovering it.

melkati commented 4 months ago

I believe this issue has been resolved. Closing now.