Pages: [1] 2 3 ... 7   Go Down
Author Topic: Introducing the Webduino web server library  (Read 19719 times)
0 Members and 1 Guest are viewing this topic.
Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

On Saturday, I taught a class at NYC Resistor on a new library I've developed that I'm calling Webduino.  It's an extensible web server library for the Arduino using the Wiznet-based Ethernet shields.  I've setup a Google Code project for it at http://webduino.googlecode.com/, and it's released under the MIT license allowing all sorts of reuse.  I've also put my not-quite-complete presentation up for viewing at http://tr.im/WebduinoPressy .

I've got a few examples up right now -- the Buzz example interfaces with Zach's Danger Shield allowing you to remotely start and stop the speaker.  We had a room full of students pinging my Arduino board on Saturday, buzzing me while I was lecturing.  It was fun.  The big Demo example shows how to setup an HTML form running on the device where you can read and write pins.

You use the code like a library; you install the header in the libraries folder, pull in the code using a #include, and setup the relative URLs that you want your server to handle.  You can do different things for GETs and POSTs, making it easy to create forms that will give you the page with all the controls, then process the submission.

I hope to add a few more examples in the next few weeks, including a web-enabled fridge sign using a serial LCD and how to serve things other than just HTML text from the device.  I also need to work on more documentation and finishing up my slides, but I think it's a great base for other people to experiment.
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

You might want to take a look at some of the entries dated March onward on this page: http://code.rancidbacon.com/Flashduino

It uses what (from a quick glance at your work) seems to be a similar approach to what you have implemented--except yours seems a bit tidier at the moment. :-)

--Phil.
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool... I'll take a look at the Flashduino project.  My objective was to have a framework that the students could easily build on.  Originally, it was going to be more adhoc, but a few days before the class I realized that I could turn the server code into a class that could be extended, making the interface for changing it a lot easier for people to comprehend.

That project also pointed me at Ethernet2 which looks like a nice refinement.  I'll probably add a #define check in the 1.1 version to let people use that version of the library if they want.
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
interface for changing it a lot easier for people to comprehend.
Ditto. :-)

Quote
That project also pointed me at Ethernet2 which looks like a nice refinement.  I'll probably add a #define check in the 1.1 version to let people use that version of the library if they want.
In theory it should be a drop-in replacement, unless someone wants it to coexist with the original.

--Phil.
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I had been #including Ethernet.h from the WebServer.h file, but I think I'll just change it so the user needs to #include that header first, which means the web server code wouldn't care which one was used.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ach! understood! I try tonight! ... I was very superficial!  :-[
thank you very much!  smiley-wink
« Last Edit: April 08, 2009, 01:48:12 am by zaio73 » Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for webduino, Ben: marvellous module. I've used it for this monitor.
http://blog.fupps.com/2009/05/11/naguino-an-arduino-based-lcd-monitor-for-nagios-and-icinga/
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://code.google.com/p/webduino/issues/detail?id=1
« Last Edit: June 13, 2009, 03:34:36 pm by unwiredben » Logged

Pages: [1] 2 3 ... 7   Go Up
Jump to: