GPIO Control from Command Line

Jan 2017
When creating projects using the GPIO pins on a Raspberry Pi, you can control all of the GPIO functions from Python. However, after attaching some hardware to the Raspberry Pi, it can be nice to toggle the GPIO pins to check functionality (especially handy if you are controlling something visual like an LED or a motor).

Install WiringPi

WiringPi contains the command line utility gpio that we can use to control our GPIO pins. To install WiringPi, use the following command.

sudo apt-get install wiringpi

Once installed, you will have access to the gpio utility.