GPIO button input to execute script

Hi all,

I need my jetson to be able to run a script without having to go into the terminal and execute it. My plan is to put a button on the gpio pins to execute the script. My question is, how do I write a script that runs as soon as the jetson turns on, waiting for the gpio pin signal to be received and then runs my script?

As for gpio wiring, I am going to run a wire from pin 1, 3.3v DC, to pin 7, and have the script wait until it sees voltage at pin 7. I am using the python periphery GPIO library. Is this a correct way to do it, or am I going to fry my board? Any advice or help would be appreciated.

Thank you!

TX2 header pinout: NVIDIA Jetson TX2 J21 Header Pinout - JetsonHacks

hello peterwatsonnm,

you should looking for start-up files, and adding the commands to launch your script automatically.
please check below as an example,
thanks

$ vim ~/.profile

Thanks for the input. I have found this file and verified that I can use it to run a script on startup. Thanks!

If I need to send a signal to pin 7 (1.8v), how to I shift the 5v output of the jetson to 1.8v? Or should I use the 3.3v output and then just use pin 7 with 3.3v?

Thanks!

for anyone searching this thread later; I have written a shell script to make the jetson tx2 do a command with a button or switch input. Please see this github repo: https://github.com/peterwatsonnm/Jetson-TX2-GPIO-Interfacing

Good! Thanks for sharing!