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

refactor(api): add info to debug warning on how IS_ROBOT is determined #5783

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

theosanderson
Copy link
Contributor

@theosanderson theosanderson commented Jun 1, 2020

If you run a robot without RUNNING_ON_PI in the environment you get this warning message (and substantially reduced functionality), but it is not clear how to resolve it. This provides that information. In my case it was because I was invoking one Python script from another with subprocess launching a Python script without the conventional shell.

overview

changelog

review requests

risk assessment

If you run a robot without RUNNING_ON_PI in the environment you get this warning message (and substantially reduced functionality), but it is not clear how to resolve it. This provides that information. In my case it was because I was invoking one Python script from another with subprocess.
@theosanderson theosanderson requested a review from a team as a code owner June 1, 2020 11:49
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

Out of curiosity, what situation were you in where running this on the robot didn't have the environment variable set? Shells on the ot-2 in our buildroot build should have it set

@theosanderson
Copy link
Contributor Author

Awesome.

I wrote a basic launcher script which essentially lists .py files in a directory for you to choose a protocol (requiring input) to run, which it does with subprocess python script.py. Then it was a bit confusing to debug why this issue happened specifically in that case (confounded by wondering if it was the unrelated GPIO-lock issue).

@theosanderson theosanderson changed the title feat(api): add info to debug warning on how IS_ROBOT is determined refactor(api): add info to debug warning on how IS_ROBOT is determined Jun 1, 2020
@sfoster1 sfoster1 merged commit fbbf1b6 into Opentrons:edge Jun 1, 2020
@sfoster1
Copy link
Member

sfoster1 commented Jun 1, 2020

Awesome.

I wrote a basic launcher script which essentially lists .py files in a directory for you to choose a protocol (requiring input) to run, which it does with subprocess python script.py. Then it was a bit confusing to debug why this issue happened specifically in that case (confounded by wondering if it was the unrelated GPIO-lock issue).

Hmm, and that was running from ssh shell? or from a jupyter terminal? I think subprocess should mirror the env vars from the parent I guess unless you're specifying other ones.

@theosanderson
Copy link
Contributor Author

Ahhh.. you're right, misdiagnosis on my part. The issue is that I was starting the launcher script not from the shell but from ttyd (and then screen), and so lost the environment. Still think this is a (very slightly) useful change as it also would happen when running on e.g. Raspbian.

@sfoster1
Copy link
Member

sfoster1 commented Jun 2, 2020

Agreed, yeah.

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