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
59 stars 13 forks source link

Gaps in datapoints sent via BLE to MyAmbiance #209

Closed melkati closed 2 months ago

melkati commented 2 months ago

Image https://t.me/c/2135172956/95

melkati commented 2 months ago

Looks like it was working fine recently. Reported by @dominator15 https://t.me/c/2135172956/326

I tested with MyAmbiance 3.1.x (actual version is 3.3.0) and the same thing happens.

melkati commented 2 months ago

Looks like it was working fine with v0.11.000. Reported by @Olaruci https://t.me/c/2135172956/262

Edit: Looks like it wasn't working fine after downloading the data (just in live view)

Image

Olaruci commented 2 months ago

this Screenshot is just the live read. After I download all it gets messed up.

melkati commented 2 months ago

this Screenshot is just the live read. After I download all it gets messed up.

So, you confirm that v0.11.000 did not work well?

This makes it even harder to find the bug because for Dominic (@dominator15) it worked fine with v0.12.007 Flavor TTGO T-Display Sandwich and for me it also worked fine with v0.12.022 Flavor TTGO T-Display Sandwich (the last non beta released and installed from the easy web installer).

melkati commented 2 months ago

I tested for a couple hours with the last released version on a TTGO T-Display Sandwich (installed from the Easy Web Installer) and after fetching data it looks fine:

09:39:46.668 > -->[STUP] CO2 Gadget Version: 0.12.022 Flavour: TTGO T-Display Sandwich
09:39:46.668 > -->[STUP] Version compiled: Apr 10 2024 at 08:02:24

Image

melkati commented 2 months ago

Shortly after (few minutes) it appeared again (I'm almost sure it appeared later, in live view):

Image

Edit few hours later:

I left it working some hours more and it appears to be working fine (this chart is a continuation of the previous one):

Image

Edit few hours later:

Working some hours more and it appears to be running strong (this chart is a continuation of the previous one):

Image

melkati commented 2 months ago

Previous test was with libraries:

https://github.com/Sensirion/arduino-upt-core.git#b2c0e76
https://github.com/melkati/arduino-ble-gadget.git

I'm now compiling the same version to make the same tests again (notice, arduino-upt-core theoretically isn't needed anymore) with libraries:

; https://github.com/Sensirion/arduino-upt-core.git
https://github.com/melkati/arduino-ble-gadget.git#historyInterval
08:44:40.767 > -->[STUP] CO2 Gadget Version: 0.12.022 Flavour: TTGO T-Display Sandwich
08:44:40.767 > -->[STUP] Version compiled: May  2 2024 at 08:43:34

1 hour later:

Image

New edit:

Curious. Maybe the libraries I said I used in the above tests are not the ones that were actually used (maybe I forgot to clean the project at PlatformIO before compiling and it used previous downloaded libraries). Now I find myself trying to recompile with the libraries:

https://github.com/Sensirion/arduino-upt-core.git#b2c0e76
https://github.com/melkati/arduino-ble-gadget.git

which are the ones I thought I had saved when it worked, and this combination gives an error (which I know is solved by removing the https://github.com/Sensirion/arduino-upt-core.git#b2c0e76 library (which was included to solve a compilation problem while Sensirion finished making its various libraries compatible with each other):

Image

melkati commented 2 months ago

Looks like there was an issue with library version selection in PlatformIO: As is was installed following Sensirion instructinos as a Global library I think I got mixed results when selecting specific versions in platformio.ini.

In my last tests, looks like it's working fine (using Sensirion's libraries form med April, not installed globally):

https://github.com/Sensirion/arduino-upt-core.git#b2c0e76  ; Temporary fix for arduino-ble-gadget incompatibly with arduino-upt-core library
https://github.com/melkati/arduino-ble-gadget.git#98bed70c507bbbaac9a59ebba87f54ae8784c88d

image

This doesn't work, leaving gaps in data (with last version of Sensirion's libraries):

https://github.com/Sensirion/arduino-ble-gadget.git

melkati commented 2 months ago

I already reported it to Sensirion https://github.com/Sensirion/arduino-ble-gadget/issues/36

I hope to have an answer soon...

melkati commented 2 months ago

This issue is already fixed for CO2 Gadget by using libraries:

    https://github.com/Sensirion/arduino-upt-core.git#b2c0e76 
    https://github.com/melkati/arduino-ble-gadget.git#historyInterval

I'm closing the issue and hope Sensirion fixes it soon (and merges some pull requests) so we can move to use the "official" libraries again.