Firmware for our in-house tally light system. Jointly created by Tip of the Hats and Games Done Quick.
- Install Raspberry Pi OS to SD card using Raspberry Pi Imager
- Run
sudo raspi-configon pi- Change user password
- Set locale (For me, from en_GB. UTF-8 ; to en_US. UTF-8)
- Set time zone (For me, to America->Chicago)
- Set keyboard (For me, Generic 104-key PC -> Other -> English (US) )
- Set SSH (Interfacing Options -> SSH -> Yes)
- Set up wireless LAN and connect to a wifi network with internet
- Set up SSH:
ssh-keygen- ssh in
nano ~/.ssh/authorized_keys, paste public key from the account you are accessing from (~/.ssh/id_rsa.pub), save- on accessing account, add entry to ~/.ssh/config with correct Host (name to use to access this pi) and HostName (ip address of the pi) and User (username on pi)
- Install Node for standard Pis:
- Add Node.js repo:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - - Install Node on pi:
sudo apt install -y nodejs
- Add Node.js repo:
- Install Node for Pi Zeros:
- Manually download Node built for ARMv6:
wget https://unofficial-builds.nodejs.org/download/release/v14.17.3/node-v14.17.3-linux-armv6l.tar.xz- Other versions may be found here:
https://unofficial-builds.nodejs.org/download/release/
- Other versions may be found here:
tar xvfJ node-v14.17.3-linux-armv6l.tar.xzsudo cp -R node-v14.17.3-linux-armv6l/* /usr/local- Reboot
sudo shutdown -r now
- Manually download Node built for ARMv6:
- Update pi software: `sudo apt update && sudo apt full-upgrade -y
- Install and configure git:
sudo apt install -y gitgit config --global user.email "<github email address>"git config --global user.name "<name>"
- Pull tally-lights project from github:
git clone https://github.com/GamesDoneQuick/tally-lights.git - Reboot
sudo shutdown -r now - Build:
npm install --production=false- If there are errors, this may need to be run multiple times
npm run build
- Install pm2:
sudo npm install pm2 -g - For tally-light pis:
- Setup to run pm2 from root (root privileges are needed to access GPIO)
pm2 killsudo pm2 start apisudo pm2 start tally.config.jssudo pm2 savesudo pm2 startup
sudo raspi-configand add in SSID and password of the base station Pisudo nano /etc/wpa_supplicant/wpa_supplicant.confand comment out or delete the SSID with internet
- Setup to run pm2 from root (root privileges are needed to access GPIO)
- For base-station pi:
- Setup pm2
pm2 start base.config.jspm2 savepm2 startup- Enter the command as prompted by pm2:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
- Setup wifi hotspot
-
sudo apt install hostapd -
sudo systemctl unmask hostapd -
sudo systemctl enable hostapd -
sudo apt install dnsmasq -
sudo nano /etc/dhcpcd.confand add:interface wlan0 static ip_address=192.168.1.1/24 nohook wpa_supplicant -
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig -
sudo nano /etc/dnsmasq.confand paste in:interface=wlan0 dhcp-range=192.168.1.2,192.168.1.20,255.255.255.0,24h -
sudo nano /etc/hostapd/hostapd.confand paste in:interface=wlan0 ssid=TallyNet hw_mode=a channel=0 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=TallyRania wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
-
- Setup pm2