2021-02-06 10:40:52 +00:00
|
|
|
#!/bin/bash -x
|
|
|
|
# Usage: bash install.sh
|
|
|
|
|
2021-10-22 14:33:59 +00:00
|
|
|
NODEVER=16.5.0
|
|
|
|
#14.17.0
|
2021-09-09 08:41:39 +00:00
|
|
|
|
2021-10-31 12:13:26 +00:00
|
|
|
# Enable i2c bus 6 to use the pins NOT pulledup
|
2021-10-31 14:23:29 +00:00
|
|
|
# AE-AQM0802 can be used
|
2021-10-31 12:13:26 +00:00
|
|
|
echo 'dtoverlay=i2c6,pins_22_23' | sudo tee -a /boot/config.txt
|
|
|
|
|
|
|
|
# install some packages used in ocoge
|
2021-09-09 08:41:39 +00:00
|
|
|
sudo apt update
|
2021-10-08 13:30:52 +00:00
|
|
|
sudo apt install fswebcam -y
|
|
|
|
# enable pigpiod service
|
|
|
|
sudo systemctl enable pigpiod.service
|
|
|
|
sudo systemctl start pigpiod.service
|
2021-09-09 08:41:39 +00:00
|
|
|
|
2021-02-06 10:40:52 +00:00
|
|
|
# install node.js (=electron node version) via n (https://github.com/tj/n)
|
2021-05-22 07:59:32 +00:00
|
|
|
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
|
2021-10-08 13:30:52 +00:00
|
|
|
sudo bash n $NODEVER
|
2021-08-28 14:28:26 +00:00
|
|
|
# install python code formatter
|
2021-08-29 14:44:58 +00:00
|
|
|
python3 -m pip install black
|
2021-02-06 10:40:52 +00:00
|
|
|
# install desktop entry
|
|
|
|
cp -r ./files/share ~/.local/
|
|
|
|
# install binary files if exists
|
2021-02-06 12:09:25 +00:00
|
|
|
FILE="./files/binary.zip"
|
2021-02-06 10:40:52 +00:00
|
|
|
if [ -e $FILE ]; then
|
|
|
|
unzip $FILE -d ..
|
|
|
|
else
|
|
|
|
echo 'binary.zip not found. plz install manually.'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# build ocoge
|
|
|
|
cd ..
|
2021-10-31 14:23:29 +00:00
|
|
|
npm install --legacy-peer-deps
|
2021-10-31 12:13:26 +00:00
|
|
|
|
|
|
|
echo 'Installation finished. To use i2c devices, reboot computer.'
|