/lircServer

API Server for controlling Roku TV with LIRC, written in Go

Primary LanguageGo

Installing LIRC Server

For quick installation, run the install.sh script. Other wise, read on...

  1. Compile app.go for target system. For example, compiling for Raspberry Pi Zero:
GOOS=linux GOARCH=arm GOARM=5 go build -v app.go
  1. SCP app binary to system
  2. Install supervisor: apt install supervisor
  3. Copy over supervisor.conf to /etc/supervisord/conf.d/
  4. Create logs: touch /var/log/lirc_server.log
  5. Start supervisor: supervisorctl reread && supervisorctl update

Setting up a remote

To generate a remote configuration file, run the following commands:

# Stop lirc to free up /dev/lirc0
sudo /etc/init.d/lirc stop
# Create a new remote control configuration file (using /dev/lirc0) and save the output to ~/lircd.conf
irrecord -d /dev/lirc0 ~/lircd.conf
# Make a backup of the original lircd.conf file
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf
# Copy over your new configuration file
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
# Start up lirc again
sudo /etc/init.d/lirc start

Rename the configuration file by editing the 'name' in /etc/lirc/lircd.conf Restart LIRC: sudo /etc/init.d/lirc restart

Transmit examples using LIRC

  • List all of the commands that LIRC knows for 'your-remote': irsend LIST your-remote ""
  • Send the KEY_POWER command once: irsend SEND_ONCE your-remote KEY_POWER