New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Raspberry Pi Hardware and Software Stack for Image Capture and Sharing
1.
2. The recipe
Hardware Stack
• Raspberry Pi Model B (512 MB Ram)
• Raspberry Pi Camera Module (2 MP) or
any compatible USB Cam *
• Ethernet Cable
• Wifi dongle: Edimax EW-7811Un 150Mbps Wireless
• SD Card ( 4 GB ++)
6. Connecting to your raspberry pi
ssh-ing
#Avahi Deamon should be installed
ssh pi@raspberrypi.local
#Static IP
shh pi@192.168.5.10
Usefull Links:
http://elinux.org/RPi_Advanced_Setup
7. * Testing USB Cam
Resurrecting ancient technologies
#Test USB Camera
Lsusb
#Take images from RaspberryPi USB Camera
fswebcam -d /dev/video0 -r 640x480 test.jpeg
11. Twitter stream api
The communication layer is built upon Twitter’s infrastructure
var twit = new twitter(config);
// Check Credentials
twit.verifyCredentials(function (err, data) {
if(err) console.log(err);
})
.stream('user', {track:watch}, function(stream) {
console.log("Twitter stream is ready and waiting for inc
tweets...")
stream.on('data', function (data) {
//Check if tweet is not empty
if (data.text !== undefined) {
//Action Code here
}
});
//Catch errors
stream.on('error', function (err, code) {
console.log("err: "+err+" "+code)
});
12. Child process
Control anything you can do in the terminal
child = exec("raspistill -o "+ image_path +" -w 640 -h 480",
function (err, stdout, stderr) {
//trigger another event
})