mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2024-12-23 09:47:36 +00:00
WiringPi installation from source code (#35)
* installing wiringPi from source code * gpio -vshowing custom error message
This commit is contained in:
parent
fe4ad2411f
commit
7bb5477872
@ -214,17 +214,27 @@ do
|
||||
source ~/.profile
|
||||
if [[ $? -ne 0 ]]; then colored_echo "Process failed" ${RED}; exit 1; fi
|
||||
|
||||
colored_echo "wiringpi (gpio tool) installing..."
|
||||
apt-get install wiringpi -y
|
||||
colored_echo "Installing WiringPi (gpio tool) if required..."
|
||||
|
||||
# Check the availability of the gpio.
|
||||
gpio -v > /dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then colored_echo "WiringPi not found\n" ${RED} ; fi
|
||||
|
||||
# Download WiringPi from https://github.com/WiringPi/WiringPi.git
|
||||
git clone https://github.com/WiringPi/WiringPi.git
|
||||
|
||||
# change directory to WiringPi and build from source code
|
||||
pushd WiringPi && ./build && popd
|
||||
|
||||
if [[ $? -ne 0 ]]; then colored_echo "WiringPi installation failed \nTry manual insatallation" ${RED} ; fi
|
||||
|
||||
# test wiringpi and fix if there is any issue
|
||||
gpio readall | grep Oops > /dev/null
|
||||
if [[ $? -ne 1 ]]; then
|
||||
colored_echo "Known wiringPi issue is detected! WiringPi is updating..."
|
||||
wget https://project-downloads.drogon.net/wiringpi-latest.deb
|
||||
sudo dpkg -i wiringpi-latest.deb
|
||||
fi
|
||||
# # test wiringpi and fix if there is any issue
|
||||
# gpio readall | grep Oops > /dev/null
|
||||
# if [[ $? -ne 1 ]]; then
|
||||
# colored_echo "Known wiringPi issue is detected! WiringPi is updating..."
|
||||
# # wget https://project-downloads.drogon.net/wiringpi-latest.deb
|
||||
# # sudo dpkg -i wiringpi-latest.deb
|
||||
# fi
|
||||
|
||||
colored_echo "Copying setup file..."
|
||||
cp $SOURCE_PATH/$SERVICE_NAME $SERVICE_NAME
|
||||
|
Loading…
Reference in New Issue
Block a user