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

src: Add support to leak detection #66

Merged

Conversation

patrickelectric
Copy link
Member

No description provided.

@patrickelectric patrickelectric force-pushed the add_support_to_leak branch 3 times, most recently from f7fb109 to aa5567e Compare February 16, 2024 12:49
@RaulTrombin
Copy link
Member

@patrickelectric Does it worked on your Rpi?
Error: Failed to set leak pin as input: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })

Try use the same method as SPI pins instead.

@patrickelectric
Copy link
Member Author

@patrickelectric Does it worked on your Rpi? Error: Failed to set leak pin as input: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })

Try use the same method as SPI pins instead.

It does work, did you run as sudo ? It's required for hardware access.

@patrickelectric
Copy link
Member Author

I just moved the pin initialization now to be done by the init call

Signed-off-by: Patrick José Pereira <[email protected]>
@RaulTrombin
Copy link
Member

@patrickelectric Does it worked on your Rpi? Error: Failed to set leak pin as input: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })
Try use the same method as SPI pins instead.

It does work, did you run as sudo ? It's required for hardware access.

didn't, the spi method pins doesn't require it, if we require sudo - we will need to pass this requirement for users under all the other libraries.

@patrickelectric
Copy link
Member Author

@patrickelectric Does it worked on your Rpi? Error: Failed to set leak pin as input: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })
Try use the same method as SPI pins instead.

It does work, did you run as sudo ? It's required for hardware access.

didn't, the spi method pins doesn't require it, if we require sudo - we will need to pass this requirement for users under all the other libraries.

can you try the latest version ?

src/lib.rs Show resolved Hide resolved
@RaulTrombin
Copy link
Member

@patrickelectric Does it worked on your Rpi? Error: Failed to set leak pin as input: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })
Try use the same method as SPI pins instead.

It does work, did you run as sudo ? It's required for hardware access.

didn't, the spi method pins doesn't require it, if we require sudo - we will need to pass this requirement for users under all the other libraries.

can you try the latest version ?

Seems fine for self-hosted runner,

Can you add :
bench!(read_leak()); to the benchmarks?

@@ -332,6 +334,8 @@ impl NavigatorBuilder {

let led = Led::new();

let leak = Pin::new(27);
Copy link
Member

Choose a reason for hiding this comment

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

//Define leakage sensor Pin

Copy link
Member Author

@patrickelectric patrickelectric Feb 16, 2024

Choose a reason for hiding this comment

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

What do you mean by it ? I'm following the same pattern as in the LED initialization. It's already clear that 27 is the pin for the leak detection in the code.

Copy link
Member

@RaulTrombin RaulTrombin Feb 16, 2024

Choose a reason for hiding this comment

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

just to have some overall explanation, which sensor.
The LEDs are self-explained, but leakage sensors need to attach an extra gadget to GPIO.

Copy link
Member Author

Choose a reason for hiding this comment

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

just to have some overall explanation, which sensor. The LEDs are self-explained, but leakage sensors need to attach an extra gadget to GPIO.

That's documented on the read_leak function.

Copy link
Member

Choose a reason for hiding this comment

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

ok.

Signed-off-by: Patrick José Pereira <[email protected]>
@patrickelectric patrickelectric merged commit ffb99c3 into bluerobotics:master Feb 16, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants