First, I have a simple shell script to pass the commands to the AVR using netcat:
- Code: Select all
#!/bin/bash
echo -ne $1\\r| /usr/bin/nc -w1 denon 23
This just takes the first argument ($1) and passes it to the AVR on the telnet port (23). I named the shell "dencmd" and, for now, I have left it in my home directory. The -ne arg for echo tells it to not add any line ending character and the \\r places a carriage return alone after $1 (the command). The -w1 arg for nc tells it to quit 1 second after sending it's input. The arg denon is the host name I created in /etc/hosts and 23 is the port number to connect to.
Then, I created actions for all of the commands I wanted and used the following embedded applescript as the action of the action:
- Code: Select all
do shell script "/Users/rdp/dencmd CMDPRM"
Where CMD is the command and PAR is the parameter from the Denon AVR command set. For example, to turn on the AVR I used:
- Code: Select all
do shell script "/Users/rdp/dencmd PWON"
The commands and parameters are the same as for the RS-232 interface. For my AVR they are listed here.
I placed all of actions in a folder for convenience and can now control my AVR from my iPod Touch. I will probably create a web page do provide the interface, but that will have to wait a while.
Richard