-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
56 lines (42 loc) · 1.21 KB
/
Copy pathinstall.sh
File metadata and controls
56 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
#
# Author: hyunsungkim (hyunsungkim@postech.ac.kr)
# Last modified: 2021-03-09
MODE=$1
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "ERROR: Run the script with sudo"
exit
fi
export python=python3
export pip=pip3
if [ $# -ne 1 ]; then
echo "ERROR: Cannot resolve run mode. Run script must be either 'sudo ./install.sh --install' or 'sudo ./install.sh --debug'"
exit
elif [ $MODE == "--install" ]; then
echo "install mode"
sudo apt update
sudo apt install -y python-setuptools python3-setuptools vim
cd /home/pi
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install
elif [ $MODE == '--debug' ]; then
echo "debug mode"
cd /home/pi/pigpio-master
gcc --version
dpkg -l python*-setuptools
# inspect pigpio
sudo ./x_pigpio # check C I/F
sudo pigpiod # start daemon
./x_pigpiod_if2 # check C I/F to daemon
./x_pigpio.py # check Python I/F to daemon
./x_pigs # check pigs I/F to daemon
./x_pipe # check pipe I/F to daemon
gpio readall
sudo killall pigpio
# python --version
# pip --version
# python debug.py
fi