View Single Post
  #7   Spotlight this post!  
Unread 01-08-2013, 15:42
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,620
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Arduino + Ethernet Shield Help

I only get the 'favicon.i' if the serial monitor is open when the board first connects. Other than that just "HTTP" out of the serial monitor.

It did not appear on my DMM that either pin 7 or 8 was toggling with the webpage button presses (not sure if it's one or zero oriented).

Will look into it more later.

What I suspect is wrong here is that:

1. If you look there is only one call to serial to output from this code.
2. What you should see is what is in the buffer.
3. When you alter the form it fires a POST event.
4. That should cause the page to reload (with the same content).
5. During that post event parameters follow.
6. We both only see "HTTP".
7. However this is a POST so look at this link:
http://www.jmarshall.com/easy/http/#postmethod
(Link altered to something more related and friendly)
8. Therefore when the code reloads and tries to parse these parameters...it can not find what is not in the buffer.
9. Therefore the page simply reloads but does not change the pins (it thinks it's the first time you loaded it).
10. This *might* have worked for someone at some point but this is likely time sensitive.
11. The browser is doing all the work to display the HTML form.
12. When the browser toggles something it's just a silly drawing to the browser.
13. Even if this was a slider (it's a button) it would likely slide as you might expect.
14. Even if the browser does not successfully communicate the change it will tend to draw the changes.
15. HTTP is stateless so unless you put something more intelligent like Javascript in there you can't ask the browser after the fact what happened without another HTML form submission.
16. If your HTML forms never send valid data you are trapped in a vicious loop where things *appear* to be happening.

This is a typical problem for web applications of any sort.
Often form submissions recall the same code and that code needs to get parameters (either GET or POST).
If that code does not get parameters HTTP is stateless so it thinks you were *never there before*.

So since I am not the student here
Put a serial print statement *inside* the conditional that toggles the pin.
See if it ever prints.
You sort of did this already above just put *only* the print statement not any additional conditionals.

Then we can go from there.

BTW when was this book you have written? Look at the copyright date.
It's this book right: http://shop.oreilly.com/product/9780596802486.do

Whistles innocently:
https://bugzilla.mozilla.org/show_bug.cgi?id=260500

Last edited by techhelpbb : 02-08-2013 at 00:54.