No announcement yet.

IVISTA asp web page

  • Filter
  • Time
  • Show
Clear All
new posts

    IVISTA asp web page

    Here is an asp web page I use to display my cameras. I had originally posted the page in this thread, but there was a small error. You can view the web page at GenevaDudes Web. Login as Guest/Guest. (<span class="ev_code_PURPLE">You will need to do this twice, as I use SecureLinks. Sorry but I don't know how to get around this at the moment but I'm working on it</span>.)

    Discussions are here.

    The asp page uses securelinks but it can be modified not to. In any case it does require some of the basics as provided by Jeff Farmer. You probably already have them anyway. These are the includes:
    <span class="ev_code_BLUE">
    &lt;!-- #include file="/includes/style.asp"--&gt;
    &lt;!-- #include file="/includes/misc_functions.asp" --&gt;
    &lt;!-- #include file="/includes/header.asp" --&gt;
    &lt;!-- #include file="/includes/menu_functions.asp" --&gt;
    &lt;!-- #include file="/control/menu.asp" --&gt;

    The asp page also has the ability to serve your video from another server.
    The sub that does this looks like this:
    <span class="ev_code_BLUE">
    sub GetUSerIP()
    dim userID
    thisSession = "http://" & getlink & "/inetcam"
    ' hs.WriteLog "This session", thisSession
    end sub
    It uses getlink to determine if the browser is local or outside your intranet. If you have problems you can modify the function in misc_functions.asp.
    Find line 6 in the function getlink() and change it to:
    <span class="ev_code_BLUE">if (strCompIp = "192.168") or (strCompIp = "127.0.0") Then</span>
    You may also need to include "localhost" but probably not. It depends on your Hosts file settings, if you have one.
    This sub:
    <span class="ev_code_BLUE">Sub GetContents
    ' reads the contents of a file and puts it in a variable.
    DefDir = hs.GetINISetting("Settings", "app_path", "C:\Program Files\HomeSeer")
    AlwaysLiveTxt = FileContents(DefDir & "\html\AlwaysLiveComments.txt")
    VideoServerText = FileContents(DefDir & "\html\VideoServer.txt")
    end sub</span>
    reads two text files. There is one on each side of the camera panel. I did this because it then becomes possible to present text that can change without editing the asp file. All you need to do is edit the text file and you don't need to worry about formating. You can change the sub and just enter text if you wish. The funcion filecontents is in misc_functions.asp by Jeff Farmer. You probably already have it.
    Aside from that, everything else is really straight forward.

    Finally, the cameras are triggered by a script. The html code:
    <span class="ev_code_GREEN">&lt;form action="DT_WebCam.asp" target="XGRemote"&gt;&lt;center&gt;
    &lt;input type="submit" class="linkrowbutton" name="camval" value="Foyer" &gt;
    &lt;input type="submit" class="linkrowbutton" name="camval" value="FrontDoor" &gt;
    &lt;input type="submit" class="linkrowbutton" name="camval" value="Kitchen" &gt;
    &lt;input type="submit" class="linkrowbutton" name="camval" value="Power" &gt;
    triggers the asp page to trigger an iframe, effectively reloading the page. Near the top of the page you will find this:
    <span class="ev_code_BLUE">camval = Request.QueryString("camval")</span>
    which is used in the very next line:
    <span class="ev_code_BLUE">if camval &lt;&gt; "" then l=hs.RunEX ("DT_SetIR.txt","main",camval)
    camval = ""</span>
    Rather than upload the file, this is the contents of DT_SetIR.txt:
    <span class="ev_code_RED">' Transmit IR Code
    Sub Main(aCmd)
    Dim i
    Dim Codx
    select case aCmd
    case "Foyer"
    Codx = 199
    Case "FrontDoor"
    Codx = 200
    Case "Kitchen"
    Codx = 201
    Case "Power"
    Codx = 202
    end select
    hs.SetDeviceValueByName "Ocelot IR Code", Codx
    hs.Writelog "IRXMIT", aCmd
    end sub</span>
    This sets an IR call to my Ocelot, which transmits an IR signal via a powermid to my 9 channel video switcher in the basement. It switches video sources which are sent to my Happauge card on the remote computer with Ivista.

    By the way, I noticed many of you browsing my cameras. There have been some problems with all my websites and if you can't connect, just try later.

    <span class="ev_code_RED">Additionally, if you have trouble with the page working for you, the sub that determines where your "guest" or internal viewer is comming from, comment the first few lines out then uncomment the remainder in the sub. To make the first part work, you need to have modified some of the includes or at least configured them properly in the SecureLinks setup.</span>
    This is the sub:
    <pre class="ip-ubbcode-code-pre">
    sub GetUSerIP()
    dim userID
    thisSession = "http://" & getlink & "/inetcam"
    hs.WriteLog "This session", thisSession
    ' userID = request.servervariables("REMOTE_ADDR")
    ' if (userID = "") or (InStr(userID,"localhost")) or (instr(userID,"192.168.")) then
    ' thisSession = ""
    ' else
    ' thisSession = ""
    ' end if
    end sub


    Discussions are here.

    Thanks to Jeff Farmer for his contributions, especially for SecureLinks and the core functionality used in this asp page.
    Thanks to Rupp for his help. Rupp pointed me in the right direction many many months ago on Ivista.
    Attached Files