Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Webserver Serial Example

  1. #1
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default 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?

    http://www.promixis.com/forums/showt...ver-IR-Example

  2. #2
    Join Date
    Oct 2005
    Posts
    307

    Default

    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.

    Just add: <script src="girder.js" type="text/javascript"></script> in the <head> tag of your html and to trigger any event add: onclick="return SendEvent(&quot;THUMBSUP&quot;, &quot;100&quot;" inside the html tag you want to trigger an event. (You will have to change THUMBSUP and 100 to the event and device number you have setup in Girder as your event.)

    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...

  3. #3
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default

    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.

  4. #4
    Join Date
    Oct 2005
    Posts
    307

    Default

    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.

  5. #5
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default

    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
    Attached Files Attached Files

  6. #6
    Join Date
    Oct 2005
    Posts
    307

    Default

    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.

  7. #7
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default

    The script action works fine.

  8. #8
    Join Date
    Oct 2005
    Posts
    307

    Default

    You have scr vs. src for the girder.js file, so it isn't loading....

  9. #9
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default

    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.
    Attached Files Attached Files

  10. #10
    Join Date
    Oct 2005
    Posts
    307

    Default

    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");'

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •