Controlling parallel port through web

Controlling parallel port through web

It is possible to build a system that allows you to control your parallel port pins through a web. To do this you need the following parts in your Linux system:

  • A web server software:
  • Apache is the most popular, Boa is also possible
  • The conrolling use interface web pages (you have to make those yourself, possible few web forms with control buttons)
  • Parallel port controlling CGI-BIN script (you have to write this)
  • The control program that control parallel port (the Linux controlling program described above is suitable)

Usually web based I/O-device controlling works in the following way:

  • 1. Users downloads a web pages from some page where the web pages is (web browser does this from given addess)
  • 2. The user web browser shows user the downloaded web page that has the control needed (forms, buttons, etc.)
  • 3. User presses some control button or send button on form
  • 4. The user operation at step 3 causes the web browser to send the information (that key has been pressed or form data contents) to the web address given in the web page where this button/form is (can be same or different web server where the form was leaded)
  • 5. A web server in that given address receives the data from user web browser, checks that it correct and sends in some way command to the actual hardware to do whatever needed (this could be call to hardware driver or signaling to some other application running somewhere accessable from web server)

Typically the web based uder interface building can be divided to two quite differnet parts: The web interface part (getting the controlling information form used to the computer) and the actual hardware controlling

The first part would include that web server, controlling web pages and needed scripts to take user controls. There is a wide selection of suitable scripting languages, most attractive for this could be Perl, PHP and UNIX shell script (bash). Al those can be used to do to read the user controls. The second part needs to be generally written using C language, because most scripting languages usually lack the features to do actual direct hardware controlling. For this C language is generally the best approach. The idea is tht the actual low level hardware controlling is done with simple C program, and then the script (on part 1) sends controls to this C program in some way (in simplest case runs this C program with right command line arguments every time hardware needs to be controlled).

Programming I/O

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

%d bloggers like this: