8000 drivers/sen5x: Add device driver for SEN5x by dprigoshij · Pull Request #19955 · RIOT-OS/RIOT · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

drivers/sen5x: Add device driver for SEN5x #19955

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

Merged
merged 4 commits into from
Apr 8, 2025
Merged

Conversation

dprigoshij
Copy link

Contribution description

Testing procedure

tests/drivers/sen5x:

  1. Connect a SEN5x device via i2c to a supported board
  2. Navigate to tests/drivers/sen5x
  3. Flash and execute the test

SAUL:

  1. Navigate to examples/saul
  2. Add the following to the Makefile: USEMODULE += sen5x
  3. Flash the saul example and also use the target term
  4. Use saul read [ID] to test the outputs

@github-actions github-actions bot added Area: doc Area: Documentation Area: tests Area: tests and testing framework Area: build system Area: Build system Area: pkg Area: External package ports Area: drivers Area: Device drivers Area: SAUL Area: Sensor/Actuator Uber Layer Area: Kconfig Area: Kconfig integration labels Sep 28, 2023
@MrKevinWeiss
Copy link
Contributor

I wonder if any maintainer has access to one of these?

@MrKevinWeiss
Copy link
Contributor

If you are still interested in getting this in I would suggest removing the Kconfig dependency modelling aspect and posting test results :)

@janschlicht
Copy link

I wonder if any maintainer has access to one of these?

Hi, if this is a problem we (TU Braunschweig) could try to send you one of ours ;)
For example sending one to HAW shouldn't be a problem.

@dprigoshij
Copy link
Author
dprigoshij commented Apr 19, 2024

Regarding the test results, the SEN55 outputs its measurements every two seconds. Here are three sample iterations of the test:

2024-04-19 12:43:14,556 # Mass concentration pm1p0: 0.5 µg/m³
2024-04-19 12:43:14,560 # Mass concentration pm2p5: 1.8 µg/m³
2024-04-19 12:43:14,563 # Mass concentration pm4p0: 2.8 µg/m³
2024-04-19 12:43:14,566 # Mass concentration pm10p0: 3.2 µg/m³
2024-04-19 12:43:14,569 # Ambient humidity: 33.2 %RH
2024-04-19 12:43:14,571 # Ambient temperature: 23.4 °C
2024-04-19 12:43:14,573 # Voc index: 60.0
2024-04-19 12:43:14,574 # Nox index: 1.0
2024-04-19 12:43:16,595 # Mass concentration pm1p0: 0.6 µg/m³
2024-04-19 12:43:16,599 # Mass concentration pm2p5: 2.0 µg/m³
2024-04-19 12:43:16,602 # Mass concentration pm4p0: 3.2 µg/m³
2024-04-19 12:43:16,606 # Mass concentration pm10p0: 3.8 µg/m³
2024-04-19 12:43:16,608 # Ambient humi
8000
dity: 33.1 %RH
2024-04-19 12:43:16,611 # Ambient temperature: 23.4 °C
2024-04-19 12:43:16,612 # Voc index: 60.0
2024-04-19 12:43:16,614 # Nox index: 1.0
2024-04-19 12:43:18,635 # Mass concentration pm1p0: 0.7 µg/m³
2024-04-19 12:43:18,639 # Mass concentration pm2p5: 2.4 µg/m³
2024-04-19 12:43:18,642 # Mass concentration pm4p0: 3.8 µg/m³
2024-04-19 12:43:18,646 # Mass concentration pm10p0: 4.5 µg/m³
2024-04-19 12:43:18,648 # Ambient humidity: 33.0 %RH
2024-04-19 12:43:18,651 # Ambient temperature: 23.4 °C
2024-04-19 12:43:18,652 # Voc index: 60.0
2024-04-19 12:43:18,654 # Nox index: 1.0

I'm a bit confused as to what you mean by the Kconfig dependency modelling aspect. Can you elaborate this a bit further?

@crasbe
Copy link
Contributor
crasbe commented Feb 27, 2025

@dprigoshij Are you still interested in merging this? I recently acquired a SEN55-SDN-T sensor and tested this PR with an nRF52840DK and everything seems to work as it should 👍

main(): This is RIOT! (Version: 2024.01-devel-468-gac785-sen5x)
Mass concentration pm1p0: 3.1 µg/m³
Mass concentration pm2p5: 3.3 µg/m³
Mass concentration pm4p0: 3.4 µg/m³
Mass concentration pm10p0: 3.4 µg/m³
Ambient humidity: 38.5 %RH
Ambient temperature: 21.5 °C
Voc index: 23.0
Nox index: 1.0
Mass concentration pm1p0: 3.2 µg/m³
Mass concentration pm2p5: 3.4 µg/m³
Mass concentration pm4p0: 3.4 µg/m³
Mass concentration pm10p0: 3.4 µg/m³
Ambient humidity: 38.5 %RH
Ambient temperature: 21.5 °C
Voc index: 23.0
Nox index: 1.0
Mass concentration pm1p0: 3.2 µg/m³
Mass concentration pm2p5: 3.4 µg/m³
Mass concentration pm4p0: 3.4 µg/m³
Mass concentration pm10p0: 3.4 µg/m³
Ambient humidity: 38.5 %RH
Ambient temperature: 21.5 °C
Voc index: 24.0
Nox index: 1.0
Mass concentration pm1p0: 3.2 µg/m³
Mass concentration pm2p5: 3.4 µg/m³
Mass concentration pm4p0: 3.5 µg/m³
Mass concentration pm10p0: 3.5 µg/m³
Ambient humidity: 38.5 %RH
Ambient temperature: 21.5 °C
Voc index: 24.0
Nox index: 1.0
Mass concentration pm1p0: 3.3 µg/m³
Mass concentration pm2p5: 3.5 µg/m³
Mass concentration pm4p0: 3.5 µg/m³
Mass concentration pm10p0: 3.5 µg/m³
Ambient humidity: 38.5 %RH
Ambient temperature: 21.5 °C
Voc index: 24.0
Nox index: 1.0

@janschlicht
Copy link

Hey, we are still interested in merging the driver. Please let us know if any further changes are required.

@crasbe
Copy link
Contributor
crasbe commented Mar 18, 2025

Hey, we are still interested in merging the driver. Please let us know if any further changes are required.

I'll take a closer look at it then for a review, but it certainly has to be rebased and there are two conflicts in drivers/Kconfig and pkg/Kconfig that have to be resolved.

The early commits should be squashed and all commit messages have to adhere to our Commit Conventions: https://github.com/RIOT-OS/RIOT/blob/master/CONTRIBUTING.md#commit-conventions

Other than that I don't think major changes are required. One functional change I would suggest is to keep the test running forever instead of just 100 cycles. The SEN5x takes some time until the values stabilize and the test is already over once the values stabilize.
I think NOx can even take up to an hour or so?

@dprigoshij
Copy link
Author

Alright, thanks for your input. It's been some time since I've worked on this, but I'll see to get it done.

@dprigoshij
Copy link
Author

It looks like you have to add a Makefile.ci file to the test to exclude boards with insufficient memory. I set the "no fast fail" flag, so we can see which boards exactly fail.

This is how such a file looks like: https://github.com/RIOT-OS/RIOT/blob/801d19b59093c4498e6d3f2dac145be5eae0f57e/examples/advanced/twr_aloha/Makefile.ci

I believe it's finished now? I've also added the mentioned "Makefile.ci".

@crasbe
Copy link
Contributor
crasbe commented Apr 7, 2025

I believe it's finished now? I've also added the mentioned "Makefile.ci".

Yes (mostly). There are still a couple of small static-test errors that were probably introduced when you added the line breaks, but nothing major.

Thanks a lot for addressing all the review points.
I'm positive we can merge this before the 2025.04 release :)

@dprigoshij
Copy link
Author

I believe it's finished now? I've also added the mentioned "Makefile.ci".

Yes (mostly). There are still a couple of small static-test errors that were probably introduced when you added the line breaks, but nothing major.

Thanks a lot for addressing all the review points. I'm positive we can merge this before the 2025.04 release :)

You probably mean the vera++ checks? I've glossed over them, since the test ran trough, but it should be changed now.
Thanks for taking your time working on my PR btw!

@dprigoshij dprigoshij force-pushed the sen5x branch 2 times, most recently from d8011b9 to 7cf3fc6 Compare April 7, 2025 13:02
Copy link
Contributor
@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything done now! 🥳

Unfortunately we have to wait with the merging until our build server mobi3 is fixed, but that won't be long.

@crasbe crasbe enabled auto-merge April 7, 2025 14:19
@crasbe crasbe added this pull request to the merge queue Apr 7, 2025
@maribu maribu removed this pull request from the merge queue due to a manual request Apr 7, 2025
@crasbe crasbe added this pull request to the merge queue Apr 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 7, 2025
@crasbe crasbe added CI: full build disable CI build filter CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 7, 2025
@maribu
Copy link
Member
maribu commented Apr 8, 2025

Would you mind running make generate-Makefile.ci -C tests/drivers/sen5x? That should locally generate that Makefile.ci file that prepares the CI to expect linking to fail on some boards due to RAM/ROM overflow. The CI will then skip linking for boards it is expected to fail and only compile.

@crasbe crasbe added this to the Release 2025.04 milestone Apr 8, 2025
@crasbe crasbe enabled auto-merge April 8, 2025 13:21
@crasbe crasbe added this pull request to the merge queue Apr 8, 2025
Merged via the queue into RIOT-OS:master with commit 87352ee Apr 8, 2025
25 checks passed
@crasbe
Copy link
Contributor
crasbe commented Apr 8, 2025

@dprigoshij Thank you for your contribution and for applying all the suggestions, I know it's been a long journey :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: doc Area: Documentation Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: pkg Area: External package ports Area: SAUL Area: Sensor/Actuator Uber Layer Area: tests Area: tests and testing framework CI: full build disable CI build filter CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0