Staton.us

YAWC (Yet Another Web Camera)

You can buy prepackaged wifi networked cameras with pan and tilt.
I had all of the components to build my own and wanted to test an AJAX interface.
This was inspired by AJAX Remote Controlled Lego Robot

Linksys VWC54GC

Provides either cabled or wireless ethernet video in asf format.
asf format isn't particularly operating system or web browser netural, but that can be fixed with VideoLan.

videolan

videolan.org

Provides transcoding of video and snapshot capability along with a web browser client.

A Python module comes with VideoLan: Python binding documentation
This code runs as a CGI to grab a frame - vlc_snapshot.py

#!/usr/bin/python

import vlc
import time
import cgi

mc=vlc.MediaControl()
mc.playlist_add_item("http://192.168.1.115/img/video.asf")

vlc.Object(0).config_set("vout", "image")
vlc.Object(0).config_set("image-out-prefix", "../tmp/ptest")
vlc.Object(0).config_set("image-out-replace", 1)
vlc.Object(0).config_set("image-out-ratio", 1)
vlc.Object(0).config_set("image-out-format", "png")
mc.start(0)
time.sleep(3)
mc.stop()

print "Content-type:text/html\n\n"
print "<html>"
print "<head>"
print '<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">'
print '<meta http-equiv="Content-Language" content="en-us">'
print '<title>Web Camera</title>'
print '</head>'
print '<body>'
print '<img src="../../webtmp/ptest.png">'
print '</body>'
print '</html>'

 

gumstix + robostix

The gumstix provides the web server and a CGI for controlling the actuators and reading the sensors.

The user interface runs on a web browser using asynchronous Javascript (AJAX).
I used SAJAX with Python implementing the robot server. The server uses S.N.A.P. to talk to the robostix that controls the RC Servos for pan and tilt. The robostix is connected to the gumstix via a serial cable. The logic level of the gumstix serial port is 3.3v while the logic level of the robostix serial port is 5v. A 10K resistor in series with the robostix transmit data current limits the input clamp diode on the gumstix.

The gumstix is the SNAP master node. The Python coded implementation is snap_master_rc.py.

The robostix is an addressable SNAP node. <TODO - zip atmega code>

It is possible to have many addressable nodes connected to one master. The easiest way to do this is to use RS485 to connect the nodes.

 

Block Diagram


Block Diagram


The jumper on the Robostix must be removed so the motors in the servos can be powered separately from the Atmega CPU. If you don't use independent power supplies, a stalled motor can cause the CPU to reset.

I constructed the camera mount from materials available at a hobby shop - birch, telescoping brass, servo pushrod hardware, thick CA (cyanoacrylate), and a hot glue gun.

openWRT

Running on a WRT54GL. Makes the gumstix wifi enabled. The gumstix wifistix can't be used because the development filesystem (Python) is on a MMC card connected via the 92 pin connex position.

 

| © 2005, 2008 Ken Staton