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

Dynamically calculating MONITOR_PORT? #504

Closed
chrisspen opened this issue Jun 19, 2017 · 3 comments
Closed

Dynamically calculating MONITOR_PORT? #504

chrisspen opened this issue Jun 19, 2017 · 3 comments
Labels

Comments

@chrisspen
Copy link

Is there any way to dynamically calculate MONITOR_PORT while running make upload?

I have several Arduino's connected to my host, and I've written a Python script to figure how which ones correspond to each /dev/ttyACM* file. I'd like to plug in this script to the makefile so when I run make upload it will automatically set MONITOR_PORT to the right file. However, I can't find any documentation on how to do this.

@sej7278
Copy link
Collaborator

sej7278 commented Jun 19, 2017

You could run your python script and pipe the input into MONITOR_PORT in your local Makefile in a similar way as we call shell commands within Arduino.mk, e.g.

MONITOR_PORT = $(shell /path/to/my/script.py)

and of course have your script output "/dev/ttyACM0" or whatever.

There's also PRE_BUILD_HOOK which may be of interest.

@sej7278
Copy link
Collaborator

sej7278 commented Jul 31, 2017

can we close this?

@chrisspen
Copy link
Author

Thanks for the update. It might be helpful if the make monitor was explicitly mentioned in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants