1
0
Fork 0
Use buttons connected to a Rasberry Pi GPIO to trigger Hog 4 comment macros.
Go to file
Kevin Matz 41a1b536ec systemd refuses to operate on symlinks. copy the file. 2019-11-16 16:45:20 -05:00
baconscript@c1a7ad48b2 initial comit 2019-11-01 10:34:57 -04:00
.gitignore initial comit 2019-11-01 10:34:57 -04:00
.gitmodules initial comit 2019-11-01 10:34:57 -04:00
LICENSE.md initial comit 2019-11-01 10:34:57 -04:00
README.md systemd refuses to operate on symlinks. copy the file. 2019-11-16 16:45:20 -05:00
buttond.py lamda closures to set path value at time of creation, not evaluation 2019-11-16 16:43:22 -05:00
buttons.cfg demo configuration 2019-11-16 16:43:22 -05:00
buttons.service set the working path 2019-11-16 16:43:22 -05:00
server.cfg initial comit 2019-11-01 10:34:57 -04:00

README.md

onsetswitch

Use buttons connected to a Rasberry Pi GPIO to trigger Hog 4 comment macros.

Prep

touch /Volumes/boot/ssh
  • Eject the SD card and boot the Raspberry Pi.
  • Use SSH to log into the Pi:
ssh pi@raspberrypi
  • Use raspi-config to;
sudo raspi-config
  • set locale

  • set timezone

  • enable ssh server

  • enlarge the file-system to fill the SD card

  • reboot

  • Update the Apt and install aptitude

sudo apt-get update
sudo apt-get install aptitude
  • Use aptitude to upgrade the Pi.
sudo aptitude upgrade
  • Reboot the Pi.
sudo shutdown -r now
  • Logging back into the Pi, install sane set of software packages.
sudo aptitude install git python3-pip python3-gpiozero
sudo pip3 install gpiozero antlr4-python3-runtime python-osc

Installing

cd /home/pi
git clone --recurse-submodules https://git.company235.com/kevin/onsetswitch.git
cd onsetswitch

Configuring

Input

Connect one side of the button to ground, the other to a GPIO pin.

Configure the buttons:

nano buttons.cfg

Output

Configure the Hog4 OSC server:

nano server.cfg

Enabling on Boot

Link the onsetswitch service file to systemd:

sudo cp buttons.service /lib/systemd/system/buttons.service

Enable the service at startup:

sudo systemctl daemon-reload
sudo systemctl enable buttons.service

Start the buttond service:

sudo systemctl start buttons.service
sudo systemctl status buttons.service