8000 Soil Moisture Sensor Support by alistair23 · Pull Request #4144 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Soil Moisture Sensor Support #4144

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 8 commits into from
Nov 11, 2024

Conversation

alistair23
Copy link
Contributor

Pull Request Overview

This adds support for reading the soil moisture (from the new moisture HIL). This also includes support for the soil moisture sensor from the Chirp project.

This is all based on the existing humidity sensor, as they are both similar concepts, but slightly different so I think they need a new sensor type.

This also unfortunately adds another Cargo feature to the Apollo3 board, which is a bit clunky. But there isn't really a better way to allow adding support for sensors

Testing Strategy

The unit tests in the PR

TODO or Help Wanted

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@github-actions github-actions bot added HIL This affects a Tock HIL interface. component labels Aug 21, 2024
@alevy
Copy link
Member
alevy commented Aug 22, 2024

The HIL looks fine to me. @bradjc you have a moisture sensor where, I believe, you're just passing the ADC up to userspace? Would this HIL work for your case as well?

@alistair23 alistair23 force-pushed the alistair/soil-moisture branch from e157210 to 1d4ce90 Compare August 22, 2024 01:24
@alistair23
Copy link
Contributor Author

Whoops, I forgot to add a paragraph in the PR description.

The moisture HIL and userspace interface is an exact copy of the humidity API. The idea is that humidity and moisture are similar so they should have the same interface. This should make it easy for HIL users and applications to switch between the two. It's also simple to implement.

This comes at a cost of inheriting the issues of the original humidity HIL and API, most notably a lack of error reporting.

I'm happy to improve the moisture HIL and syscall API, breaking compatibility with the existing humidity users if that's the preferred approach. @bradjc seems to think it's worth fixing the issues for the moisture API. I'll give this a few days to see if anyone else feels strongly either way.

@alevy
Copy link
Member
alevy commented Aug 23, 2024

@alistair23 I think @bradjc's comments on error reporting are split in two (two specific comments in his otherwise comprehensive review):

  1. Does the HIL bubble errors up?
  2. Does the system call driver bubble errors up?

It seems pretty clear to me the HIL should bubble errors up. The humidity HIL is just old and not up to the times. Note, for example, that the temperature HIL and others do have errors. It probably just makes sense to update the humidity HIL (separately).

The humidity system call driver can't be changed except in backwards compatible ways until 2.0. This is true for other sensor drivers, like the temperature stack, that do bubble errors up from the HIL but ignore errors in the system call driver.

I'm personally fine with either making the pre-2.0 system call driver for moisture the aligned with other sensor drivers or improving over them in the moisture driver by bubbling an error up in the first argument.

@alistair23 alistair23 force-pushed the alistair/soil-moisture branch from 1d4ce90 to 7260184 Compare August 26, 2024 04:32
@alistair23
Copy link
Contributor Author

Updated! I just went with updating to provide errors to the HIL and the userspace API as that seems to be the consensus

@alistair23 alistair23 force-pushed the alistair/soil-moisture branch 2 times, most recently from e625331 to 70c82f2 Compare August 26, 2024 05:09
@alistair23
Copy link
Contributor Author

Ping!

2 similar comments
@alistair23
Copy link
Contributor Author

Ping!

@alistair23
Copy link
Contributor Author

Ping!

Copy link
Contributor
@bradjc bradjc left a comment
8000

Choose a reason for hiding this comment

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

Just a couple small things.

@alistair23 alistair23 force-pushed the alistair/soil-moisture branch 3 times, most recently from 5165f3d to 987f496 Compare October 8, 2024 03:11
alevy
alevy previously approved these changes Oct 11, 2024
@alevy alevy added the last-call Final review period for a pull request. label Oct 11, 2024
@alistair23 alistair23 force-pushed the alistair/soil-moisture branch from 987f496 to f794c54 Compare October 22, 2024 22:26
@alistair23
Copy link
Contributor Author

Rebased, this is ready to go

Copy link
Member
@lschuermann lschuermann left a comment

Choose a reason for hiding this comment

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

Reviewed just the HIL and tests right now.

@alistair23 alistair23 force-pushed the alistair/soil-moisture branch from f794c54 to f378216 Compare October 23, 2024 01:52
bradjc
bradjc previously approved these changes Oct 25, 2024
Copy link
Contributor
@bradjc bradjc left a comment

Choose a reason for hiding this comment

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

Looked at capsules and not the tests.

< 67ED span data-view-component="true"> Copy link
Member
@lschuermann lschuermann left a comment

Choose a reason for hiding this comment

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

@alistair23 alistair23 force-pushed the alistair/soil-moisture branch from 70de90b to 695612b Compare November 5, 2024 04:01
alevy
alevy previously approved these changes Nov 6, 2024
lschuermann
lschuermann previously approved these changes Nov 10, 2024
A3DB Copy link
Member
@lschuermann lschuermann left a comment

Choose a reason for hiding this comment

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

Seems good other than my one comment.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
We no longer need to copy the linker files around, so let's delete the
operations.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@alistair23 alistair23 dismissed stale reviews from lschuermann and alevy via 9d84bc1 November 11, 2024 06:13
@alistair23 alistair23 force-pushed the alistair/soil-moisture branch from 695612b to 9d84bc1 Compare November 11, 2024 06:13
@lschuermann
Copy link
Member

This is already last-call, let's wait another few hours before merge.

@lschuermann lschuermann added this pull request to the merge queue Nov 11, 2024
Merged via the queue into tock:master with commit 29ebb95 Nov 11, 2024
12 checks passed
@alistair23 alistair23 deleted the alistair/soil-moisture branch November 11, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component HIL This affects a Tock HIL interface. last-call Final review period for a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0