and passes them to the Netduino to control the position of a webcam.
It is similar to the SkyDuino project by Hari Wiguna for the Arduino.
After creating the Pan and Tilt project for the Netduino, I was using VNC to remotely to view my home (host) PC from my office (remote). I used a webcam viewer to see the webcam image and a web browser to send the commands on the host PC.
I thought it will would really nice to simplify this by viewing the image and controlling the webcam remotely using only one application. Skype seem like a good canidate for this.
To use this you will need two Skype accounts. The first account is for the host PC where Netduino is located.
Skype needs to be set up to automatically answer calls and to allow video calls.
The first time SkyNet is run, Skype will display 'SkyNet.exe wants to use Skype'. Select 'Allow Access' to proceed.
SkyNet is run on the host PC and it automatically starts Skype if it is not running.
It intercepts any chat messages received by Skype on the Host PC that are meant for the Netduino.
It then sends these commands to the Netduino via a socket connection. You can use the buttons on
the SkyNet form to send commands direcly to the Netduino for testing purposes. There is also
a checkbox available labeled 'Send To Netduino. You can uncheck this box if the Netduino is not connect and you wish to test SkyNet. There is also a box where you must enter the Netduino's IP address.
Code to send commands via socket to the Netduino Pan and Tilt application:
public void SendCommand(string cmd) { ... string header = "GET /PanTilt.htm?c=" + cmd + " HTTP/1.0\n"; byte[] bytes = Encoding.ASCII.GetBytes(header.ToString()); IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(txtSkyNet.Text), 80); Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); sock.Connect(remoteEP); sock.Send(bytes); sock.Close(); ... }
On the Netduino you will need to run the Pan and Tilt which is a web server that uses these commands to control the orientation of the webcam mounted on pan and tilt servos.
On the remote PC you will use the second Skype account to make a video call to the first account.
You can use the Skype chat messaging system to send any of the following commands to the host PC:
u - up
d - down
l - left
r - right
c - center
skynet on - skynet will send commands to the Netduino
skynet off - skynet will not send commands (for debugging)