drivers/sen5x: Add device driver for SEN5x#19955
Conversation
|
I wonder if any maintainer has access to one of these? |
|
If you are still interested in getting this in I would suggest removing the Kconfig dependency modelling aspect and posting test results :) |
Hi, if this is a problem we (TU Braunschweig) could try to send you one of ours ;) |
|
Regarding the test results, the SEN55 outputs its measurements every two seconds. Here are three sample iterations of the test: I'm a bit confused as to what you mean by the Kconfig dependency modelling aspect. Can you elaborate this a bit further? |
|
@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 👍 |
|
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 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. |
|
Alright, thanks for your input. It's been some time since I've worked on this, but I'll see to get it done. |
|
Thx for the PR. The code looks quite good in the first sight. I'll try to take an in-depth review soonish. Would you mind to squash the commits and format the commit title according to conventions, e.g. like the PR title? One commit to add the base driver is sufficient. On top of that a second commit to add a SAUL integration and a third to add a test would be well in line with conventions. (As it stands now, the RIOT git history would be completely dominated by this PR if merged.) |
|
I believe I've adhered to all the input you've given me until now. If there are any more problems, please let me know. |
|
There is a duplicate of the driver test in Also currently the test does not compile for me: |
|
I've added all the things you've mentioned and fixed all the errors. I guess I must've made a mistake somewhere during the rebase. |
crasbe
left a comment
There was a problem hiding this comment.
I tested this driver again with the nucleo-l073rz and everything seems to work as it should.
Once the last small changes are in and CI is happy, this is ready for merge 🥳
Thank you for addressing all the suggestions.
Some logging traces:
From the test program:
025-04-04 14:46:54,414 # Mass concentration pm1p0: 6553.5 µg/m³
2025-04-04 14:46:54,418 # Mass concentration pm2p5: 6553.5 µg/m³
2025-04-04 14:46:54,422 # Mass concentration pm4p0: 6553.5 µg/m³
2025-04-04 14:46:54,426 # Mass concentration pm10p0: 6553.5 µg/m³
2025-04-04 14:46:54,428 # Ambient humidity: n/a
2025-04-04 14:46:54,430 # Ambient temperature: n/a
2025-04-04 14:46:54,431 # Voc index: n/a
2025-04-04 14:46:54,432 # Nox index: n/a
2025-04-04 14:46:56,454 # Mass concentration pm1p0: 5.2 µg/m³
2025-04-04 14:46:56,458 # Mass concentration pm2p5: 9.3 µg/m³
2025-04-04 14:46:56,461 # Mass concentration pm4p0: 12.5 µg/m³
2025-04-04 14:46:56,466 # Mass concentration pm10p0: 14.0 µg/m³
2025-04-04 14:46:56,468 # Ambient humidity: 22.9 %RH
2025-04-04 14:46:56,471 # Ambient temperature: 28.8 °C
2025-04-04 14:46:56,472 # Voc index: 0.0
2025-04-04 14:46:56,474 # Nox index: n/a
2025-04-04 14:46:58,495 # Mass concentration pm1p0: 5.1 µg/m³
2025-04-04 14:46:58,499 # Mass concentration pm2p5: 7.2 µg/m³
2025-04-04 14:46:58,503 # Mass concentration pm4p0: 8.8 µg/m³
2025-04-04 14:46:58,506 # Mass concentration pm10p0: 9.6 µg/m³
2025-04-04 14:46:58,509 # Ambient humidity: 22.9 %RH
2025-04-04 14:46:58,512 # Ambient temperature: 28.8 °C
2025-04-04 14:46:58,513 # Voc index: 0.0
2025-04-04 14:46:58,514 # Nox index: n/a
2025-04-04 14:47:00,536 # Mass concentration pm1p0: 5.1 µg/m³
2025-04-04 14:47:00,540 # Mass concentration pm2p5: 7.2 µg/m³
2025-04-04 14:47:00,543 # Mass concentration pm4p0: 8.8 µg/m³
2025-04-04 14:47:00,547 # Mass concentration pm10p0: 9.6 µg/m³
2025-04-04 14:47:00,549 # Ambient humidity: 22.9 %RH
2025-04-04 14:47:00,552 # Ambient temperature: 28.8 °C
2025-04-04 14:47:00,554 # Voc index: 0.0
2025-04-04 14:47:00,555 # Nox index: n/a
Compiled with USEMODULE+=sen5x BOARD=nucleo-l073rz make -C examples/basic/default flash term:
2025-04-04 14:43:29,845 # main(): This is RIOT! (Version: 2025.04-devel-399-g3fa61-sen5x)
2025-04-04 14:43:29,846 # Welcome to RIOT!
> saul
2025-04-04 14:43:32,576 # saul
2025-04-04 14:43:32,577 # ID Class Name
2025-04-04 14:43:32,617 # #0 ACT_SWITCH LED(green)
2025-04-04 14:43:32,617 # #1 SENSE_BTN Button(B1 User)
2025-04-04 14:43:32,617 # #2 SENSE_PM sen5x
2025-04-04 14:43:32,618 # #3 SENSE_PM sen5x
2025-04-04 14:43:32,618 # #4 SENSE_PM sen5x
2025-04-04 14:43:32,618 # #5 SENSE_PM sen5x
2025-04-04 14:43:32,619 # #6 SENSE_PULSE_COUNT sen5x
2025-04-04 14:43:32,619 # #7 SENSE_PULSE_COUNT sen5x
2025-04-04 14:43:32,620 # #8 SENSE_PULSE_COUNT sen5x
2025-04-04 14:43:32,620 # #9 SENSE_PULSE_COUNT sen5x
2025-04-04 14:43:32,620 # #10 SENSE_PULSE_COUNT sen5x
2025-04-04 14:43:32,621 # #11 SENSE_SIZE sen5x
2025-04-04 14:43:32,621 # #12 SENSE_HUM sen5x
2025-04-04 14:43:32,621 # #13 SENSE_TEMP sen5x
> saul read 2
2025-04-04 14:43:44,482 # saul read 2
2025-04-04 14:43:44,508 # Reading from #2 (sen5x|SENSE_PM)
2025-04-04 14:43:44,511 # Data: 66e-7 g/m^3
> saul read 3
2025-04-04 14:43:51,619 # saul read 3
2025-04-04 14:43:51,644 # Reading from #3 (sen5x|SENSE_PM)
2025-04-04 14:43:51,647 # Data: 79e-7 g/m^3
> saul read 4
2025-04-04 14:43:54,043 # saul read 4
2025-04-04 14:43:54,068 # Reading from #4 (sen5x|SENSE_PM)
2025-04-04 14:43:54,071 # Data: 82e-7 g/m^3
> saul read 5
2025-04-04 14:43:56,321 # saul read 5
2025-04-04 14:43:56,347 # Reading from #5 (sen5x|SENSE_PM)
2025-04-04 14:43:56,349 # Data: 83e-7 g/m^3
> saul read 6
2025-04-04 14:44:04,681 # saul read 6
2025-04-04 14:44:04,708 # Reading from #6 (sen5x|SENSE_PULSE_COUNT)
2025-04-04 14:44:04,710 # Data: 444e-7 #/m^3
> saul read 7
2025-04-04 14:44:06,910 # saul read 7
2025-04-04 14:44:06,938 # Reading from #7 (sen5x|SENSE_PULSE_COUNT)
2025-04-04 14:44:06,940 # Data: 545e-7 #/m^3
> saul read 12
2025-04-04 14:44:11,487 # saul read 12
2025-04-04 14:44:11,511 # Reading from #12 (sen5x|SENSE_HUM)
2025-04-04 14:44:11,515 # Data: 23.82 %
> saul read 13
2025-04-04 14:44:15,068 # saul read 13
2025-04-04 14:44:15,094 # Reading from #13 (sen5x|SENSE_TEMP)
2025-04-04 14:44:15,096 # Data: 27.70 °C
>
|
It looks like you have to add a 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". |
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. |
You probably mean the vera++ checks? I've glossed over them, since the test ran trough, but it should be changed now. |
crasbe
left a comment
There was a problem hiding this comment.
Everything done now! 🥳
Unfortunately we have to wait with the merging until our build server mobi3 is fixed, but that won't be long.
|
Would you mind running |
|
@dprigoshij Thank you for your contribution and for applying all the suggestions, I know it's been a long journey :) |
Contribution description
Testing procedure
tests/drivers/sen5x:
tests/drivers/sen5xSAUL:
examples/saulUSEMODULE += sen5xtermsaul read [ID]to test the outputs