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

How to power off a board after quitting the console? #1368

Open
sjg20 opened this issue Apr 21, 2024 · 2 comments
Open

How to power off a board after quitting the console? #1368

sjg20 opened this issue Apr 21, 2024 · 2 comments

Comments

@sjg20
Copy link
Contributor

sjg20 commented Apr 21, 2024

I have something like this:

LG_CROSSBAR=ws://kea:20408/ws labgrid-client  -c /vid/software/devel/ubtest/lab/env_rpi_try.cfg  -p rpi3 -s uboot console

This powered on the board and starts U-Boot. When I quit labgrid (with Ctrl-\ twice) I want it to power the board off again. I suppose I am saying that I want it to select the UBootStrategy 'off' state before exiting, e.g. adding a new arg like '-e off'

How would I implement that? I tried adding this logic to the end of session.loop.run_until_complete(coro) in client.py but it seems to quit that without returning

@Emantor
Copy link
Member

Emantor commented May 2, 2024

I'd not handle this in pure python code and rather employ a shell wrapper for this. Note also that Crtl-\ twice is not the correct way to quit microcom and produces a core dump.

@sjg20
Copy link
Contributor Author

sjg20 commented May 2, 2024

@Emantor Thanks for the info. I am quite reluctant to add shell scripts around the labgrid-client invocation. It is labgrid that knows how to power a particular board off. Building all the infrastructure for knowing how to do this on each board sounds like writing bits of labgrid all over again in shell script, at least to me.

What is the correct way to exit minicom? I don't see it in the docs, but might be missing it.

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