Arduino Ethernet shield illustrates inner workings of servers

Arduino Ethernet Shield
With the Arduino Ethernet shield that I recently purchased I have been doing a lot of programming involving making a web page. The pages that I have programmed are somewhat simple and use all of the usual HTML tags but since i'm not using any server at all this has been very interesting. My current setup for the arduino web server on the robot is using the Ethernet shield as an adapter to send the code over the internet via a wireless router. Why I think this is so cool is that it is just like a real server in the sense that it is giving information to a user's computer. I have set up servers before and I have designed web pages to go on them but part of programming them to run from the arduino shows something that most people never think of. When you learn how a website works; how a server sends the information to your browser you don't usually think about what it takes beyond a few HTML and PHP files to generate the webpage that you are looking at. With the arduino relay shield you can see in the code that it really is sending the information.

This is a sample of the code that I have been talking about:


   client.println("<html><head><title>arduino web page</title></head><body>");
   client.println("<h1>Example Web Page</h1>");
   client.println("<p>This is some page text.</p>");
   client.println("<p>You should visit http://salviusrobot.blogspot.com for more information.</p>");
   client.println("</body></html>")

This code is sent by the Arduino and received by a user's browser and is indistinguishable from any other webpage that could be displayed by a real server. I thought it was interesting because the " client.println " part that tells the Arduino to send the code to the user's browser is actually visible. Normally servers handle these requests using separately installed software but with the Arduino it is actually the worlds smallest server!

4 comments:

  1. Anonymous3/07/2012

    Hmm so you could eliminate a need for LCD or other output in order to see the values via a web browser?

    ReplyDelete
  2. Absolutely, and it would be very easy to do so. Basically all you would have to do is set up the web browser and use client.PrintIn instead of any serial.print or digitalWrite methods.

    ReplyDelete
  3. Being a Dell employee, I think your blog on "Arduino Ethernet shield illustrates inner workings of servers" is quite impressive. Accordingt to me, the term server is used quite broadly in information technology and there are vaiors types of servers.

    ReplyDelete
  4. Interesting and brilliant post.Thanks for your time and another brilliant article.

    ReplyDelete