Sensirion / arduino-ble-gadget

Create your own Do-It-Yourself BLE enabled sensor gadget on the ESP32 platform.
BSD 3-Clause "New" or "Revised" License
65 stars 21 forks source link

Slow speed data download and minor issue #44

Open danielbernalb opened 1 month ago

danielbernalb commented 1 month ago

Hi, My main issue is the very slow data download speed in the MyAmbience app. Using the same Android phone, it sometimes takes minutes to download, for example, 200 data points, while other times it only takes few seconds. I haven’t been able to identify the cause of this inconsistency. I would appreciate some guidance on resolving this issue.

And I’ve noticed a minor issue with the MyAmbience app displaying the Device ID in an unhelpful way.

Example in the APP:

Device id: 00:C1 (device 1) Device id: 00:c1 (device 2)

However, in the code I’ve written, the ID is displayed correctly:

Serial.print(F("Sensirion Provider Lib initialized with deviceId = ")); Serial.println(provider.getDeviceIdString());

Sensirion Provider Lib initialized with deviceId = c1:a2

Sensirion Provider Lib initialized with deviceId = c1:d3

Thanks!

LeonieFierz commented 3 weeks ago

Hello @danielbernalb

  1. Slow Data Download

First thing to check is that you always keep your phone near the gadget while downloading and also having a lot of other BLE devices around might slow down the download.

Further, we recently added support in MyAmbience and arduino-ble-gadget to avoid missing datapoints when downloading data from the gadget. This means that whenever we detect that data was lost we re-initialize the data download. The support for it was added on the master, but was not yet released. Which version do you use, latest master or version 1.3.2?

  1. Device Id thank you for reporting the inconsistency with the Device ID. We fixed that with https://github.com/Sensirion/arduino-ble-gadget/pull/45 and will release it with the next version.

Best, Léonie

danielbernalb commented 3 weeks ago

Hello Leonie. Thanks for your response.

Testing my SEN55-4-0, SPS30 and SCD40 I found differences:

  1. If I configure SEN55 with: _DataProvider Provider (lib, datatype::T_RH_VOC_NOXPM25) generates the error: _assert failed: void ByteArray::writeByte(uint8_t, size_t) [with unsigned int SIZE = 20; uint8_t = unsigned character; sizet = unsigned int] ByteArray.h:56 (position < SIZE) always.

  2. If I configure SEN54 with: _dataProviderProvider(lib, dataType::T_RH_VOC_PM25V2); It works well but very slow.

  3. If I configure the SEN50 or SPS30 with: _dataProviderProvider(lib, dataType::PM10_PM25_PM40PM100); It works well and is fast.

  4. SCD40: _dataProviderProvider(lib, dataType::T_RH_CO2ALT); It works well and is fast.

Due to the problem I change the DataProvider for my SEN55 to T_RH_VOC_PM25_V2 and I have the same performance as SEN54 (good but slow) and if I change to PM10_PM25_PM40_PM100 it works fine and fast.

I think it's a problem with the performance of the DataProvider.

Thank you

LeonieFierz commented 1 week ago

Hello @danielbernalb thank you for investigating further. It is not clear to my why the different data types should have a influence on the data speed. I will try to reproduce and come back when I have more infos. Best, Léonie