Announcement

Collapse
No announcement yet.

WEB PAGE HELP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • WEB PAGE HELP

    I have a web page I am serving that does streaming video. I want to add buttons to be able to switch camera's. I am using Zoomkats El-cheapo switcher, which works GREAT (THANKS ZOOM, it is sweet and ran first time). I just need code that will tell the batch files to run ON THE SERVER. Probably very simple, but I've no idea how. The code I have for the webcams was provided by the webcam software people.

    Basically, If you press a button, it needs to execute a bat ON THE SERVER ITSELF.

  • #2
    Try something like this:
    <pre class="ip-ubbcode-code-pre"> &lt;%@ Language=VBScript %&gt;
    &lt;HTML&gt;
    &lt;HEAD&gt;
    &lt;%
    if request.form ("button1") = "runBatFile" then
    hs.launch "c:\program files\homeseer\html\test.bat"
    end if

    %&gt;

    &lt;form action="pushbutton.asp" method="post"&gt;
    &lt;input type=submit name="button1" value=runBatFile&gt;
    &lt;/form&gt;

    &lt;/HEAD&gt;
    &lt;BODY&gt;

    &lt;/BODY&gt;
    &lt;/HTML&gt; </pre>
    -Rupp
    sigpic

    Comment


    • #3
      Nope, did not work. Said it could not find the webpage. Probably the simplest of things, but
      I know very little regarding html, script coding etc. I use dreamweaver to create pages, but utilize about 1% of its ability. :-(

      What I was hoping for is 3 buttons, side by side, that execute .pif files INDEPENDENTLY of Homeseer and on the same server as the website exists on. I am using AnalogX Simpleserver:WWW


      The three .pif files are in the root directory of c:

      front.pif, Carport.pif, and back.pif

      Executing these ON THE SERVER switches cams via a el-cheapo#2 on a xp machine. THAT part works great. Its just getting the 3 buttons on the same webpage as the javascript that already serves up the realtime video that is hosing me. :-(

      Comment


      • #4
        To do the cgi functions on the analogx simpleserver, you need to make a cgi-bin folder under the simpleserver root folder, and put the batch files in the cgi-bin folder. Then you would execute them by using a url in your brouser like http://127.0.0.1:86/cgi-bin/front.bat (assuming you are running the server on port like 86).
        Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

        Comment


        • #5
          Tried your suggestion Zoom, Again, when I click the link, it fails. Could you email me directly so we could experiment.

          waydavis@cox.net - Thanks :-)

          Comment


          • #6
            Post the contents of your batch file here for a look.
            Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

            Comment


            • #7
              THIS IS WHAT IS RETURNED (address removed):

              The page cannot be found
              The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

              --------------------------------------------------------------------------------

              Please try the following:

              If you typed the page address in the Address bar, make sure that it is spelled correctly.

              Open the XX.XX.XX.XX:xxxx home page, and then look for links to the information you want.
              Click the Back button to try another link.
              Click Search to look for information on the Internet.



              HTTP 404 - File not found
              Internet Explorer

              ----------------------------------------------
              HERE IS THE CODE FOR THE PAGE

              The IP addresses have been changed to X for the video server and N for the AnalogX links I'm trying to get running.
              ----------------------------------------------
              &lt;head&gt;
              &lt;title&gt;Automation System Security Feed&lt;/title&gt;
              &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;&lt;/head&gt;
              &lt;body background="Backgrounds/bg70.jpg"&gt;
              &lt;H1 align="center"&gt;Security Cam&lt;/H1&gt;
              &lt;!--&lt;html&gt;

              Do NOT edit this next section. This is the Image Pull JavaScript
              --&gt;
              &lt;div align="center"&gt;
              &lt;script LANGUAGE="JavaScript"&gt;
              &lt;!--
              browserType = navigator.appName;
              newImage = new Image();
              document.onstop = document_onstop;

              function startstop_onclick()
              {
              if (startstop.value == "Stop")
              {
              stopLoad();
              }
              else
              {
              startstop.value = "Stop";
              newImage.onload=loadNewImage;
              loadNewImage();
              }
              }

              function document_onstop()
              {
              stopLoad();
              }

              function stopLoad()
              {
              newImage.onload="";
              startstop.value = "Start";
              window.status = "Live video STOPPED ...";
              }

              function loadNewImage()
              {
              uniq = new Date();
              uniq = uniq.getTime();
              document.images.webcam32.src=newImage.src;
              newImage.src="http://XX.XX.XX.XX:xxxxxx/video/pull?"+uniq;
              window.status = "Displaying live Security Cam video ...";
              }
              function initialImage()
              {
              uniq = new Date();
              uniq = uniq.getTime();
              newImage.onload=loadNewImage;
              newImage.src="http://XX.XX.XX.XX:xxxxxx/video/pull?"+uniq;
              document.images.webcam32.onload="";
              }

              function imageError()
              {
              window.status = "Sorry ... Server is temporarily hosed.";
              image = document.images.webcam32;
              image.onload = "";
              image.onerror = "";
              startstop.disabled = true;
              document.images.webcam32.src = "/Anigifs/flash5.gif";
              }

              if (browserType == "Netscape")
              {
              document.write('&lt;IMG SRC="http://XX.XX.XX.XX:xxxxxx/video/push" width=320 height=240&gt;');
              }
              else
              {
              document.write('&lt;IMG SRC="http://XX.XX.XX.XX:xxxxxx/video/pull" name=webcam32 onload="initialImage()" onerror="imageError()" width=320 height=240&gt;');
              }
              //--&gt;
              &lt;/script&gt;

              &lt;/div&gt;
              &lt;P align="center"&gt;&lt;font size="-1"&gt;Please do not run for extended periods of time,
              Thanks!&lt;/font&gt;
              &lt;P align="center"&gt;
              &lt;INPUT id=startstop type=button value="Stop" LANGUAGE=javascript onclick="return startstop_onclick()"&gt;
              &lt;P align="center"&gt;&lt;a href="http://NN.NN.NN.NN:nnnnn/SSWebDir/cgi-bin/Front.pif"&gt;Front&lt;/a&gt; - &lt;a href="http://NN.NN.NN.NN:nnnnn/SSWebDir/cgi-bin/Carport.pif" target="_parent"&gt;Carport&lt;/a&gt; - &lt;a href="http://NN.NN.NN.NN:nnnnn/SSWebDir/cgi-bin/Back.bat"&gt;Back&lt;/a&gt;
              &lt;!--
              This is the end of the Image Pull section
              --&gt;


              &lt;/body&gt;
              &lt;/html&gt;

              Comment


              • #8
                I need to see the contents of the back.bat file. It needs to contain some particular coding to communicate with the webserver or you will get the error you are getting. I've not tried running pif files as cgi files with the simple server, so they may not work (I notice that 2 are .pif and one is a .bat).
                Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                Comment


                • #9
                  Here is one of them: Carport.bat

                  out.com 02 03bc


                  Out.com is in the cgi-bin directory.

                  Comment


                  • #10
                    For use as a cgi application with the web server, Carport.bat needs to be like below.

                    @echo off
                    echo status: 204
                    echo.
                    echo.
                    out.com 02 03bc
                    cls
                    Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                    Comment


                    • #11
                      Got the same 404 response.

                      Comment


                      • #12
                        You will need to start with simple trouble shooting to find what your problem is. Again, trying to run the bat files using a .pif setup will probably not work. Does the cam switch when you try the link and get the 404 error? Try the below test.bat batch file with out out.com involved using your link below. With the brouser on some web page, putting the link in the url box and hitting enter should result in the brouser not updating with an error. If you get an error, then you may have some issue with the server setup.

                        http://127.0.0.1:nnnnn/SSWebDir/cgi-bin/test.bat

                        ========test.bat========

                        @echo off
                        echo status: 204
                        echo.
                        echo.
                        cls
                        Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                        Comment


                        • #13
                          I use a hardware firewall on the network. I wonder... Is there a second port needed like FTP uses? FTP needs 20 & 21 open to function. It makes no sense. I can VNC into the server and run the batch files fine.

                          Comment


                          • #14
                            Performing the simple test described above on the computer with the simple server will eliminate any issues with hardware firewalls, as it is all performed internally to the computer itself.
                            Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                            Comment


                            • #15
                              It failed using loopback.

                              Comment

                              Working...
                              X