-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.txt
164 lines (127 loc) · 4.11 KB
/
setup.txt
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
################################################
# make card
################################################
download and install headless(no desktop) pi os image to sd card
https://www.raspberrypi.org/software/
################################################
# modify card and enable serial console
################################################
#install usb serial driver (mac side)
http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41
# mount card
# edit /boot/config.txt add...
dtoverlay=dwc2
enable_uart=1
# edit /boot/cmdline.txt add...
modules-load=dwc2,g_serial
# create a symlink
cd /Volumes/rootfs/etc/systemd/system/getty.target.wants
ln -s /lib/systemd/system/[email protected] [email protected]
# usage & quit = Ctrl-A Ctrl-D
screen /dev/tty.usbmodem14101 115200,cs8
################################################
# install stewie sources
################################################
sudo apt-get -y install git
mkdir git && cd git
git clone https://github.com/smdjeff/stewie-pinball
make
chmod +x ./stewie
mkdir sounds; cd sounds
gdown.pl https://drive.google.com/file/d/1Z2kLpOeDKzqBpQP47zslXBqrTpA0zDV_
gdown.pl https://drive.google.com/file/d/1S2_zKztEICtA-cRrjxmtiKpKuOaNHaBl
unzip gdown*
################################################
# installs
################################################
# wifi setup
sudo raspi-config
# pigpio
sudo apt install python-setuptools python3-setuptools
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install
# install scroll-phat-hd (via source, not old apt-get package)
'''
git clone https://github.com/pimoroni/scroll-phat-hd.git
cd scroll-phat-hd/library
sudo python setup.py install
'''
# install PhatDAC
curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash
# ZeroMQ RPC (python side)
sudo apt-get -y install libzmq3-dev
pip install pyzmq
# ZeroMQ RPC (C side)
# C side ref: https://github.com/zeromq/czmq#building-on-linux-and-macos
# note: only need czmq, not big libzmq
'''
cd ~
git clone git://github.com/zeromq/czmq.git
cd czmq
./autogen.sh && ./configure && make check
sudo make install
sudo ldconfig
cd ..
'''
################################################
# setup autostart
################################################
# box start script (may start prior to required services)
nano /etc/rc.local
'''
iwconfig wlan0 power off # disable problematic wifi power savings features
'''
# user login script (runs on login only)
wget https://raw.githubusercontent.com/akkana/scripts/master/termsize .
chmod +x termsize
nano ~/.bash_profile
'''
./termsize
sudo ip link set wlan0 up
#sudo wpa_cli -i wlan0 reconfigure
sudo systemctl daemon-reload
sudo systemctl restart dhcpcd
'''
# systemd service (which calls startup.sh)
cd ~/git/stewie-pinball
sudo cp ./stewie.service /lib/systemd/system/stewie.service
sudo cp ./stewie.service /lib/systemd/system/stewie-display.service
sudo chmod 644 /lib/systemd/system/stewie*
sudo systemctl daemon-reload
sudo systemctl enable stewie.service
sudo systemctl enable stewie-display.service
sudo reboot
################################################
# speedups
################################################
sudo apt purge avahi*
sudo systemctl disable hciuart.service
sudo systemctl disable bluealsa.service
sudo systemctl disable bluetooth.service
#sudo systemctl disable dhcpcd.service
#sudo systemctl disable networking.service
#sudo systemctl disable ntp.service
#sudo systemctl disable wifi-country.service
#sudo systemctl disable raspi-config.service
sudo systemctl disable ssh.service
sudo systemctl disable dphys-swapfile.service
sudo systemctl disable keyboard-setup.service
sudo systemctl disable apt-daily.service
sudo systemctl disable avahi-daemon.service
sudo systemctl disable triggerhappy.service
sudo nano /boot/cmdline.txt
# add quiet before rootwait
sudo nano /boot/config.txt
'''
# Set the bootloader delay
boot_delay=0
# Disable the rainbow splash screen
disable_splash=1
# Disable Bluetooth
dtoverlay=disable-bt
# Put Stewie's FETs in input mode to avoid firing during boot
gpio=4,5,17,22,27=ip
'''