Run remote commands with an old VCR remote and a Raspberry Pi Zero W
-
I followed this tutorial to get my Pi Zero W on wifi without even connecting a keyboard and monitor to it.
I followed this tutorial to get it setup with lirc to run commands when I press corresponding buttons on an old VCR remote.
I setup the lircrc file to call the TRIGGERcmd API using curl commands when I press those buttons.
I found the curl commands to be much faster than these commands.
I also found that some remotes work better than others - like my Window Media Center remote works, but each button alternates between two different IR codes, so it works every other time you press a button. I settled on an old Toshiba VCR remote.

My /etc/lirc/lircrc file looks like this:
begin button = KEY_PLAY prog = irexec config = export HOME=/root ; /root/triggertest.sh calculator downstairs end begin prog = irexec button = KEY_RIGHT config = export HOME=/root ; /root/triggertest.sh notepad downstairs endMy /root/triggertest.sh file looks like this:
#!/bin/sh
trigger=$1
computer=$2
token=`cat /root/.TRIGGERcmdData/token.tkn`curl -X POST https://www.triggercmd.com/api/run/triggerSave \
-H "authorization: Bearer ${token}" \
-H 'content-type: application/json' \
-d "{\"computername\":\"${computer}\",\"triggername\":\"${trigger}\"}" -
T tuicemen moved this topic from Instructions on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login