May 3rd, 2012, 08:40 PM
Webserver Serial Example
I've used the Girder console and a Serial.lua to successfully send commands to my Onkyo receiver using the Integra ISCP protocol.
Is there a simple way to modify the “Webserver IR Example” to trigger the Serial commands in my GML?
May 4th, 2012, 10:41 AM
Yes. Triggering any action in Girder from a webpage is easy. There are two files (girder.js and ajax_sendevent.hmtl) that are part of the default Girder install located in the httpd directory.
This is a basic building block. There are SEVERAL variations on how this can be done, so if you have something in your head let me know...
May 4th, 2012, 05:36 PM
Thanks for your assistance.
I have a couple of basic questions;
Is the Event identified by the GML and the ASCII string that it is setup to send; [my.gml\onkyo\keys\POWER ON\!1PWR01]
Where I am using the Serial Pluggin with asimple lua to set the appropriate parameters, is the device number the Pluggin number (242 for Generic Serial))?
I've been using Girder with IR; using serial and the Webserver is a new world for me.
May 8th, 2012, 06:01 AM
You can right click on an action and choose add event. Once added change the device and event string to match what you have on the webpage and it should fire.
May 10th, 2012, 08:09 AM
Thanks for your assistance Shaun5
Can you please have a look at the simple html attached - hopefully you will be able to see where I'm going wrong - the header and the sendevent
I've checked and both girder.js and ajax_sendevent.html are in the httpd directory
May 10th, 2012, 08:38 AM
I think your page should be working. I'm away from my Girder machine, so I can't test right now. Add a script action in Girder with the folllowing: gir.TriggerEvent( "ON", "242", 0). Run the script action, if it works then there is a problem with your webpage, if it doesn't there is a problem with the event name and/or device number.
May 10th, 2012, 04:31 PM
The script action works fine.
May 10th, 2012, 09:42 PM
You have scr vs. src for the girder.js file, so it isn't loading....
May 14th, 2012, 09:13 AM
I'm still not getting the Event Triggered via the WebServer. The script gir.TriggerEvent( "RCVR OFF", "242") works fine.
I started again from scratch - built it as simple as I think it can be. One button to turn off the Receiver.
The html file and two .png files are attached. I'd appreciate your review - I can't see where it's going wrong.
May 14th, 2012, 09:28 AM
Again, I am away from Girder, but do see your statement: OnClick="return SendEvent("RCVR OFF", "242");" has nested double quotes... should be something likeOnClick='return SendEvent("RCVR OFF", "242");'