Code Monkey home page Code Monkey logo

410-assignment3's Introduction

410 Final Assignment

Members: Peter Gilbert and Alex Thomas

Dependencies

GNUPLOT

sudo apt-get update -y
sudo apt-get install -y gnuplot

APUE Textbook Source Code
apue.h
error.c
pathalloc.c

Inspiration From:

  • Stackoverflow

Usage

The below command will make all object files, and executables:

make

The below command will delete all generated object files and executable files:

make clean

Besides those two commands, you may also type in "make" followed by the name of the file you would like to make. Example down below:

make webserv

Passing Arguments On The Webserver

We are using the convention "url?arg1&arg2&arg3" as our method of passing arguments on the URL


Example:

localhost:8080/my_histogram.cgi?testFolder

Web Server Implementation

directories: ls -l is run for whatever directory is indicated in the url
cgi files: cgi is run based on the #!/bin/... on the first line and output is redirected to the client
html files: displays html files based on their content length and writes to the client
image files: displays image files and writes to the client socket
plain text: plain text will just be written to the client in the same way

to run the web server do:

./webserv

Running Dynamic GNUPLOT

Example:

localhost:8080/my_histogram.cgi?testFolder

Physical Computing Aspect

https://www.amazon.com/ELEGOO-Project-Tutorial-Controller-Projects/dp/B01D8KOZF4/
Arduino UNO, LED, and Fan/3-6V Motor Used as well as cables,breadboard,etc...

After running our webserver we make a get request to our html page (control.html) which has two buttons that once clicked, make a get request to a cgi file that then executes a c file which connects to the Arduino through the serial port and digitalwrites to the pin based off the parameters passed in.

Example:

localhost:8080/control.html

Why we used these components:
We chose to use these components because we already had them on hand, and thought a connection through an Arduino that is controlled from a webserver would be fascinating, since we have little experience with Arduinos.

Shortcomings

  1. Additional Features not yet implemented
  2. Cgi files follow our file convention -> ?value&value rather than ?name=val&name=val ...
  3. Fairly simple Arduino sketch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.