Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Veetrik

Member Since 27 Mar 2011
Offline Last Active Sep 24 2011 03:55 PM
-----

Topics I've Started

SkyNet

22 May 2011 - 11:52 PM

This SkyNet project uses a windows form to intercepts messages from a remote Skype connection
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)

PanAndTilt

13 May 2011 - 04:01 AM

Pan And Tilt Project

This project is used to control a webcam's orientation from any web browser. I developed this so that I could monitor my back yard remotely (via VNC while at work) to see what animal(s) are eating my plants.

The project hardware consists of two servos for controlling the pan and tilt of a webcam by the Netdunio+. The Netduino accepts commands via the network and moves the appropriate servo using the Servo_API from Chris Seto. It uses pins 9 and 10 for the servos. Make sure that you hook the Netduino via the power jack to a 9v brick since the USB connector can not supplied the required current for the servos.

Posted Image

The commands are sent from any browser by using the Netduino+ IP address (e.c: http://192.168.0.104) followed by /PanTilt.htm as the URL. In my setup I use: http://192.168.0.104/PanTilt.htm.

PanTilt.htm is a small HTML file that resides on the Netduino+ SD card. It displays arrows for controlling the camera position. When you press on the left arrow, the browser send a 'L' to the netduino via Javascript. The Netduino+ PantAndTilt application (which is a modification of my MicroServer application) server the page of the SD card and translate the commands, in this case into a 'left' command for the servo that controls the x-axis. There are commands for up, down, left, right and center.

I got the following Parts from SparkFun for this project:

Servo - Medium (ROB-10333)
Pan/Tilt Bracket (ROB-10335)

I believe SparkFun recommends the smaller servos for the bracket, but I was able use the
medium servos. You will need to play around with the servos, especially the one for the Y-axix (tilt) to make sure the alignment is straight one the application starts the servo's at the default 90 degrees.

Posted Image

Make sure you copy the contents of the web folder to the root directory of the SD card before testing the application. Good luck finding those animals!

MicroServer

06 May 2011 - 03:51 AM

I finally got my hand on the N+ and this is my first app. It's a websever that serves pages off the micro SD card and gives the ability to maintain those pages directly from the browser client side. I wish to give thanks to Fred for his NetduinoPlusWebServer and Valyrie-MT for his Extensions.cs nd time. The server allows the for the maintenance of these pages via the client browser using a special page named mUpdate.htm This page is included in the web folder along with a few other support files. The mUpdate page displays a list of the files that are on the SD card and using javascript, allows to view the contents of any .htm, .js and .css files. These files can be loaded, modified and saved back to the SD card from the browser. This page also allows you to add, rename and delete pages or files on the SD card. In this way you can avoid having to take out the card to update the files. In order to use this application, first copy the contents of the web folder into the root directory of the SD card and put the card into the card slot. Then compile and run the MicroServer on the N+. Enter the url in your browser to access the page. In my case I use http://192.168.0.104/mUpdate.htm.

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.