------------------------------------------------------------------------
A poll associated with this post was created, to vote and see the
results, please visit http://forums.slimdevices.com/showthread.php?t=79524
------------------------------------------------------------------------
Question: Are you interested in IR-over-IP?
    
- Yes, I'd like to have IRoIP.
- No, I don't care.
------------------------------------------------------------------------

indifference_engine;574860 Wrote: 
> you want to use the controller to send commands over wi-fi to your amp? 
> I was unaware there were network-controllable amplifiers available.  How
> does that work?  Do you just send the amp an http request and it
> performs some action based on the request?  It might not be too hard
> once I have a better idea of how these things work.

Well the way I do it is that I use the lua socket to connect to the
receiver to its IP address on port 80 and then I send the contents of
an xml file with the command itself. Yamaha provides an excel file,
that can generate any function as an xml for you. This way you can
control every thinkable feature of the receiver. For the testing
purposes I have used an xml file for each command I issue, but I
believe, that this could be solved more elegantly (like putting all the
commands in one file and then just read the needed command and send it).
The code below is quite simple but it works.

I have also attached the MuteOn.xml file so you can see how the
commands look (Of course that it is also possible to issue commands to
read information from the receiver, like the volume level, if a feature
is on or off etc.).


Code:
--------------------
    
  -- What I need for my function
  local socket          = require("socket.core")
  local io                = require("io")
  .
  .
  .
  -- Call the function (in the test applet from a button)
  TestIt('MuteOn.xml')
  .
  .
  .
  
  function TestIt(self, OnOff)
  log:info("TestIt is running")
  
  -- Set the input file (I am testing on squeezeplay so it's a local file)
  io.input("C:/Program Files 
(x86)/Squeezebox/SqueezePlay/lua/applets/Doomsnight/" .. OnOff)
  
  -- Read the whole contents of the file to a string
  local YamahaCommand = io.read("*all")
  log:info(YamahaCommand)
  
  -- Create a tcp socket to the receiver IP on port 80 and send the command
  local xml = socket.tcp()
        xml:connect("192.168.1.100", "80")
        xml:send(YamahaCommand)
        xml:close()
  end 
  
--------------------


+-------------------------------------------------------------------+
|Filename: MuteOn.zip                                               |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=10582|
+-------------------------------------------------------------------+

-- 
Dextrosan
------------------------------------------------------------------------
Dextrosan's Profile: http://forums.slimdevices.com/member.php?userid=39296
View this thread: http://forums.slimdevices.com/showthread.php?t=79524

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to