Skip to content

A simple server that serves webcam pictures to a website, using Raspberry Pi

License

Notifications You must be signed in to change notification settings

zweedao/Webcam-Pi

 
 

Repository files navigation

Video Doorbell, Lab 7

A lab report by Zwee Dao

In This Report

  1. Upload a video of your version of the camera lab to your lab Github repository
  2. As usual, update your class Hub repository to add your forked IDD-Fa18-Lab7 repository.
  3. Answer the questions in-line below on your README.md.

Part A. HelloYou from the Raspberry Pi

a. Link to a video of your HelloYou sketch running.

HelloYou video

Part B. Web Camera

a. Compare helloYou/server.js and IDD-Fa18-Lab7/pictureServer.js. What elements had to be added or changed to enable the web camera? (Hint: It might be good to know that there is a UNIX command called diff that compares files.)

I edit the SERIAL COMMUNICATION (Arduino) part to be like below:

//---------------------- SERIAL COMMUNICATION (Arduino) ----------------------//
// start the serial port connection and read on newlines
const serial = new SerialPort(process.argv[2], {});
const parser = new Readline({
  delimiter: '\r\n'
});

// Read data that is available on the serial port and send it to the websocket
serial.pipe(parser);
parser.on('data', function(data) {
  console.log('Data:', data);
  io.emit('server-msg', data);
  if (data == 'light') {
    var imageName = new Date().toString().replace(/[&\/\\#,+()$~%.'":*?<>{}\s-]/g, '');
    console.log('making a making a picture at'+ imageName);
    NodeWebcam.capture('public/'+imageName, opts, function( err, data ) {
      io.emit('newPicture',(imageName+'.jpg'));
    })
  }
});
//----------------------------------------------------------------------------//

b. Include a video of your working video doorbell

Video doorbell video

Part C. Make it your own

a. Find, install, and try out a node-based library and try to incorporate into your lab. Document your successes and failures (totally okay!) for your writeup. This will help others in class figure out cool new tools and capabilities.

b. Upload a video of your working modified project

About

A simple server that serves webcam pictures to a website, using Raspberry Pi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.0%
  • C++ 10.9%
  • HTML 7.1%