Winsock - Controling an IP Camera

gilmorenator

New member
Joined
Jan 11, 2008
Messages
2
Location
Dundee, Scotland
Programming Experience
Beginner
Hi Guys,

I'm pretty new to controlling devices using vb.net, I have used the Winsock control to create chat applications etc.

I now wish to control an IP camera using a forms application, I am able to get the video etc back no problems; the problem arises when attempting to move the camera; left, right, up and down.

The camera has it's own webpage http://193.160.171.38 - and has controls to pan the camera - it seems to use CGI for this so to move left the url is http://193.160.171.39/cgi-bin/camctrl.cgi?move=left so I want to replicate this using buttons on the form - I have attempted to do this using the winsock control but it keeps returning an error so I hope you can point me in the right direction.

Here is a code snippet of the form load event and the button click to move the camera right:

VB.NET:
Private Sub frmHouseControl_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        picTimer.Enabled = True
        wSock.Connect(193.160.171.38, 80)
End Sub

Private Sub btnPanRight_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPanRight.Click
     
        Try
            wSock.SendData("/cgi-bin/camctrl.cgi?move=right")

        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
End Sub

Hope you can tell me were i'm going wrong or point me in the direction of a sample / tutorial.

Thanks in advance,

Dave
 
hi,
i think you need to get data from those addess ("/cgi-bin/camctrl.cgi?move=right") because CGI like other server-sided tools are invoked to be executed as result u'll get camera pan...
 
Hi Danieleb,

Thanks for taking the time to reply,

In the end I ditched the winsock method and used a non-visible web browser component,

Then all I did was navigate to the specific URL

Thanks again,

Dave
 
Back
Top