Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow speed data download and minor issue #44

Open
danielbernalb opened this issue Oct 17, 2024 · 4 comments
Open

Slow speed data download and minor issue #44

danielbernalb opened this issue Oct 17, 2024 · 4 comments
Assignees

Comments

@danielbernalb
Copy link

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 added a commit that referenced this issue Oct 22, 2024
instead of only sending the last byte
this fixes mismatch of logged device id on Serial output
of the ESP and device id which appears in MyAmbience (as mentioned in issue #44
@LeonieFierz
Copy link
Member

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 send last 2 bytes of mac as device id #45 and will release it with the next version.

Best, Léonie

@LeonieFierz LeonieFierz self-assigned this Oct 23, 2024
@danielbernalb
Copy link
Author

danielbernalb commented Oct 28, 2024

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_NOX_PM25)
    generates the error:
    assert failed: void ByteArray::writeByte(uint8_t, size_t) [with unsigned int SIZE = 20; uint8_t = unsigned character; size_t = unsigned int] ByteArray.h:56 (position < SIZE)
    always.

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

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

  4. SCD40:
    dataProviderProvider(lib, dataType::T_RH_CO2_ALT);
    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
Copy link
Member

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

@LeonieFierz
Copy link
Member

Deair @danielbernalb

I had some time to investigate regarding the data download

  1. There is a Bug in the definition of the download type used for T_RH_VOC_NOX_PM25 which we need to solve on the Arduino and MyAmbience side. So for now please use e.g. T_RH_VOC_PM25_V2 for a Gadget with SEN55.

  2. I did test the data download using the T_RH_VOC_PM25_V2 as data type and could not observe a slow download. Do you use the examples provided in this repo? If so, please try to remove the delay(1000) in the measure_and_report() function which is actually not necessary as the timing is done in the loop() and this just blocks processing, including the handling of the download, for too long. If you have your own code, please make sure that the provider.handleDownload(); get called every 5ms or so and the measurement is not blocking for longer than needed.

I hope this helps to resolve the issue with fast/slow downloads.

Best, Léonie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants