Logic Machine Forum
Control Onkyo through tcp - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Control Onkyo through tcp (/showthread.php?tid=4430)



Control Onkyo through tcp - pouralise - 07.12.2022

Hi, I want to control an Onkyo device through TCP using eISCP.  The protol information can be seen here at section 1.2
https://tascam.com/downloads/tascam/790/pa-r100_200_protocol.pdf

I found out some other code to control it using php
https://www.domoticz.com/wiki/Onkyo 
or ruby
https://gist.github.com/also/3546825


I use this python code and it work perfectly from my computer
https://github.com/miracle2k/onkyo-eiscp


I try to make some code like below to power on the Onkyo from LM but it didnt work
Code:
cmd = 'ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWR01\x0D'
require('socket')
sock=socket.tcp()
sock:settimeout(2)
a=sock:connect('192.168.1.100',60128)
b=sock:send(cmd)


Can you help me to make this code work? Thank you very much


RE: Control Onkyo through tcp - admin - 07.12.2022

The command looks correct. What do you get as a result for connect/send?


RE: Control Onkyo through tcp - pouralise - 07.12.2022

I Use

Code:
cmd = 'ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWR01\x0D'
require('socket')
sock=socket.tcp()
sock:settimeout(2)
a=sock:connect('192.168.1.100',60128)
b=sock:send(cmd)
log(a)
log(b)
log('a = ' .. a)
log('b = '  .. b)


and get:

[Image: ylU4e6C.png]


RE: Control Onkyo through tcp - pouralise - 08.12.2022

Problem solve. Thank you