Files
USB4VC/user_program/setup.txt
2022-01-10 00:14:06 +00:00

124 lines
2.2 KiB
Plaintext

-----------
Fresh install setup
raspbi-config
enable SPI, I2C, Serial (NO LOGIN SHELL)
set up ssh:
ssh-keygen
copy PC pub key to rpi ~/.ssh/authorized_keys
--------------
Serial setup:
serial clock is tied to GPU clock, need to fix it for it to be stable
sudo nano /boot/config.txt, add:
gpu_freq=250
gpu_freq_min=250
also, use /dev/serial0 to maintain compatibility for all models of pi
--------------
Luma OLED driver
https://luma-oled.readthedocs.io/en/latest/software.html
sudo apt-get update
sudo apt-get install python3 python3-pip python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 -y
sudo -H pip3 install luma.oled
--------------
Nintendo Pro controller
https://retropie.org.uk/docs/Nintendo-Switch-Controllers/
sudo apt install git
sudo apt install dkms
sudo apt-get install libudev-dev
sudo apt-get install libevdev-dev
git clone https://github.com/nicman23/dkms-hid-nintendo
cd dkms-hid-nintendo
sudo dkms add .
sudo dkms build nintendo -v 3.2
sudo dkms install nintendo -v 3.2
git clone https://github.com/DanielOgorchock/joycond.git
cd joycond
cmake .
sudo make install
sudo systemctl enable --now joycond
-------------------
remove CTRL+ALT+DELETE reboot
sudo rm /lib/systemd/system/ctrl-alt-del.target
sudo ln -s /dev/null /lib/systemd/system/ctrl-alt-del.target
sudo systemctl daemon-reload
-------------------
run script on launch:
MAKE SURE SERIAL LOGIN SHELL IS TURNED OFF
https://raspberrypi-guide.github.io/programming/run-script-on-boot
sudo su
pip3 install evdev
sudo nano /etc/rc.local
cd /home/pi/usb4vc; python3 usb4vc_main.py &
kill -SIGINT pid
---------------
relaunch if exits:
while true; do echo think; sleep 1; done
---------
serial format:
U4 CMD_TYPE PAYLOAD
U4 header, any command not beginning with U4 is ignored
CMD TYPE:
SC: Shell Command, execute whatever follows in shell
RF: Read File
WF: Write File
GG: get gamepad file
QUIT: quit program
U4 RF /home/pi/usb4vc_data/config.json
U4 WF /home/pi/usb4vc_data/test.txt c3NoIHBpQDE5Mi4xNjguMS41Ng==
------------
boot speedup:
sudo nano /boot/config.txt
disable_splash=1
boot_delay=0
sudo nano /boot/cmdline.txt
Add quiet after rootwait
raspberry pi 3
before speedup:
19.16
18.07
19.11
18.37
after speedup:
16.95
16.45