gpio_control_from_command_line
This is an old revision of the document!
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.
As a quick test, from the command line type:
gpio -v
This will display the version of WiringPi you have installed.
gpio version: 2.32 Copyright (c) 2012-2015 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty Unable to determine hardware version. I see: Hardware : BCM2835 , - expecting BCM2708 or BCM2709. If this is a genuine Raspberry Pi then please report this to projects@drogon.net. If this is not a Raspberry Pi then you are on your own as wiringPi is designed to support the Raspberry Pi ONLY.
gpio_control_from_command_line.1485093259.txt.gz · Last modified: 2023/03/09 22:35 (external edit)