Introducing the Webduino web server library

I have a problem with webduino ...
"Web_helloworld " ok
but with "Web_Buzzer" and "Web_Demo" exemple, browser wrote : EPIC FAIL ! :o

You need to go to http://your.ip/buzz or /demo depending on the setting of PREFIX in the example sketches.

Ach! understood! I try tonight! ... I was very superficial! :-[
thank you very much! :wink:

I've just updated the library to version 1.1. This mainly does some code cleanup, adds a robot.txt "don't go here" response, and makes it easier to reply with custom headers. There's also additional example sketches, including one using jquery to do dynamic speaker control.

Thanks for webduino, Ben: marvellous module. I've used it for this monitor.

I'm glad it works well for you. I've heard a report of there being connection problems with Safari, but I've not tried that yet. If you have suggestions of changes, please let me know.

I am a Arduini newbie and thanks to Webduino, got a customized web application running in a couple pf days!

I'd appreciate it if you could point me to an example of reading parameters from an http GET to control a digital pin for example by sending h t t p://myip/test?d1=1&d2=0

I tried different codes and commands but always end up getting "EPIC FAIL".

Thanks!

Mat

If you're getting EPIC FAIL, look for the PREFIX setting early in the example source code. That's what you need to add to the front of the URL to access the site. Define it as "" to remove the prefix entirely.

Thanks! The EPIC FAIL is not the real problem. I am able to access the web pages without any trouble. I get the EPIC FAIL only when I am trying some examples to parse the parameters out of a GET query; ie only when I add the ?d1=1 part to the root URL. I can get to the root URL without any issues.

I am looking for a way to grab the URL query parameters from a GET query to process it further and asking for ny help here.

That's a feature request, alas. Right now, the GET handler in the Webduino library isn't setup to look for the '?' character and use that as a delimiter for reading parameters. Because of the way that processing works, this is a bit difficult because we really want to process arguments after we've read the whole incoming header. POST supports this by putting the arguments in the payload that comes after the header.

This can be done... it just requires some smarter processing and some new code.

I've added this feature request at the Google Code site to track this: Google Code Archive - Long-term storage for Google Code Project Hosting.

Thanks! I mistakenly thought this was already a feature may be because somewhere in the comments for the server I thought I read something about reading parameters from GET also. I was looking for this because I wanted to send some control commands through a shell script from my router and the router doesn't support cURL to be able to send the POST request.

Thanks again for a the great piece of code and I am good to go for now. Trying to mess with some Ajax/JSON stuff.

Curl does POST great -- we used it in my class. Try the -d / --data option to specify the payload to post to a URL.

Yes, cURL works fine from other Linux machines but the router doesn't have cURL. Will look around to see if it's possible to get this installed on it though. Thanks a lot for all the suggestions!

If it has wget, it may have a --post-file or --post-string option, although the busybox version of wget doesn't have the options.

I will try to look at supporting GET with parameters, I just don't know when.

I've made a modified version of Ben's code that supports adding parameters to URLs.

If you'd like to beta test it, drop me a private message with your email address, and I'll send you a copy.

Ran

Hi,

first of all I have to make you a big compliment for the webduino library and especially the easy to use examples, that come with it.
I am mechanical engineer an not an expert at programming in c, but with the help of the example code I managed to finish the biggest parts of the code for my "project" within an hour (I want to use an internet connected arduino to remotely monitor temperatures and humidity and to switch some relais)
My code more or less equals the "WEB_Demo" and works quite nice. The only bug that I cannot solve is that the refresh button in the browser doesn't seem to work correctly. When I reload the page by using the address all LED states are read and shown correctly and everthing works fine, but when I use the reload button, the page seems not to be updated. The output states stay the same although I changed them in a second browserwindow in the meantime.
If anyone has experienced similar problems and knows a workaround I would appreciate if he could post me a hint.

Thanks,
Felix

P.S. I just double checked with the original demo code and the bug stays the same

Which browser are you using?

When you POST values to the server, it should issue a redirect as the POST reply. It may be that we need to add additional output headers so the browser doesn't try to use a cached page (the original one fetched from the Arduino).

All my testing was with Firefox; I've heard of an issue with a version of Safari, maybe this is the same.

I work with firefox 3.5.1. When I do submit the data I get redirected to /demo/form and all the inputs/outputs are shown correctly. If I then do a reload it seems to use a cached page indeed.
For my needs, that is not really a problem since I can hit "enter" instead of the reload button, I was just wandering if this was a general problem or just something I encounter.

can this library works with seeeduino ethernet shield?

http://www.seeedstudio.com/depot/ethernet-adapter-for-mcu-projects-p-160.html?zenid=babb0608872db5555ab9ba9bbd3a869d

It uses the ENC28j60 chip, it is way too different?

thanks

Webduino won't work with the ENC28J60-based shield at this time. That chip is much more difficult to interface with than the Wiznet W5100 used in the Arduino Ethernet Shield. The ENC chip only does Ethernet for you; it doesn't implement a TCP/IP stack like the Wiznet. That means much more code running on the device.