If you have wondered how you can control your network enabled Onkyo Receiver via LAN you may find this interesting:
The commands are the same as used in the Onkyo Serial plugin, however they are sent via LAN.
1. Make sure you have enabled this function in the Onkyo menu
2. set the port to 60128
3. save the settings
4. restart the receiver
5. get the IP Address of your receiver (here it is 192.168.0.123)
Code: Select all
import socket
# create a socket connection
s = socket.socket()
s.connect(('192.168.0.123', 60128))
# setup command - in this case, 'power on'
cmd="!1PWR01"
length=len(cmd)
print cmd
length=length+1
code = chr( length )
# setup the string we are sending ...
line = "ISCP\x00\x00\x00\x10\x00\x00\x00code\x01\x00\x00\x00cmd\x0D";
line = line.replace("code", code)
line = line.replace("cmd", cmd)
# send it !
s.send(line)
# close the socket
#data = s.recv(1024)
data = s.recvfrom(65565)
s.close()
print data