-
Notifications
You must be signed in to change notification settings - Fork 85
WebCam
The USB connector is under the RJ-45 network jack at the bottom of the control board. With a USB connector plugged in, there is very little space for a fan or cooling for the stepper drivers. A small fan can be offset to the side of the cables even if it doesn't fit completely.
In Linux, webcams show up as /dev/video# (where # is 0, 1, 2, etc...). If the camera has audio, it should appear as /dev/audio#. Since Dexter doesn't have any built in audio or video devices, /dev/video0 and /dev/audio0 (if it has audio).
To install a simple tool for capturing images or video:
sudo apt-get install fswebcam
Then to test it:
fswebcam test.jpg
and you should see a new image file appear in the folder.
To use the webcam with a NodeJS webserver, install:
https://github.com/chuckfairy/node-webcam
by downloading the repo as a zip or tz and extracting it into a temp folder on Dexters SAMBA share at \\<dexters-ip>\share
. (Note: This is needed because NPM crashes on Ubuntu 12 trying to install this directly) On the command prompt in Dexter, mv
the temp folder contents in the node_modules
folder. (Note: This is needed to avoid changing permissions on the node_modules folder to let Windows write to it directly)
In node, you should be able to:
var cam = require("node-webcam")
var pic = cam.capture("test", {skip:2}, function(e,data) { })
pic.shots
will show [ Shot { location: 'test.jpg', data: '' } ]
. If it's empty, pic.clear()
make sure test.jpg is deleted and capture again. The skip:2
option is there to keep it from throwing an "nodejs JPEG library reports unrecoverable error: Not a JPEG file" error. Not sure why that works.
There is a sample of using the web cam with a ws socket on a nodejs service at:
https://github.com/chuckfairy/node-webcam/tree/master/examples/websocket
To search the Wiki, use the main search box in the black bar at the top, then select WiKi to filter the results or go to https://github.com/HaddingtonDynamics/Dexter/search?type=Wikis&q= and then add your search terms to the end of the URL.
To report errors, or request additional data, please chat with us on discord and/or raise a new issue