Send IR commands to GC IR device via Applescript
Posted: Thu Jan 05, 2017 6:06 pm
I was having a problem with the Cynical Cache plugin that send IR commands to a Global Cache device, so I found a workaround that allows sending commands via an Applescript.
What You’ll Need
How To
Background
In the source referenced below, they used the “netcat-openbsd” package, as the version at the time supported the -C option, which sends CRLF as line-ending. The current version does not support this option. However, the NMAP package installed includes a version of nc called ncat – which DOES support the CRLF option. nc, or ncat in this case, is then sending the ‘sendir…’ command to the IP address and port of your iTach, thereby issuing the IR command from the command line.
Credit:
Sourced in part from https://getsatisfaction.com/irule/topics/control_itach_from_the_terminal
What You’ll Need
- NMAP for OS X (https://nmap.org/download.html)
- Your IR command in Global Cache format, such as
- Code: Select all
sendir,1:1,1,37993,1,1,342,170,22,63,22,21,22,21,22,21,22,21,22,21,22,21,22,63,22,21,22,63,22,63,22,21,22,21,22,63,22,63,22,21,22,63,22,21,22,21,22,21,22,21,22,21,22,21,22,63,22,21,22,63,22,63,22,63,22,63,22,63,22,63,22,21,22,1608,342,86,21,3651,342,86,21,3651,342,86,21,3651,342,86,21,3799”)
How To
- Install NMAP
- Create a new Action Group for your IR Command(s):
- Set type to Execute Script
- Select Embed and choose Applescript
- For the Applescript, enter as follows:
- Code: Select all
do shell script "
echo \"sendir,1:1,1,37993,1,1,342,170,22,63,22,21,22,21,22,21,22,21,22,21,22,21,22,63,22,21,22,63,22,63,22,21,22,21,22,63,22,63,22,21,22,63,22,21,22,21,22,21,22,21,22,21,22,21,22,63,22,21,22,63,22,63,22,63,22,63,22,63,22,63,22,21,22,1608,342,86,21,3651,342,86,21,3651,342,86,21,3651,342,86,21,3799\" | /usr/local/bin/ncat -C -i 1 192.168.0.126 4998"
- Press Compile and then Run; this should now execute your IR command.
Background
In the source referenced below, they used the “netcat-openbsd” package, as the version at the time supported the -C option, which sends CRLF as line-ending. The current version does not support this option. However, the NMAP package installed includes a version of nc called ncat – which DOES support the CRLF option. nc, or ncat in this case, is then sending the ‘sendir…’ command to the IP address and port of your iTach, thereby issuing the IR command from the command line.
Credit:
Sourced in part from https://getsatisfaction.com/irule/topics/control_itach_from_the_terminal