Embedded WebServer for online control

Hi Everybody.

My name is Mohsin.

I am planning to implement a webserver using Arduino micro-controller (with ethernet) for online control of the devices connected with the micro-controller. I have searched a lot on the internet but found nothing.

I will implement my own TCP/IP stack for communication. I am not sure about which device to use and how to get it started.
I am implementing everything myself from scratch and just need some guidance.

Can somebody please help me in the selection of the micro-controller and any information that might be helpful?

Regards,
Mohsin

An Uno with an ethernet shield will do it, or an Arduino ethernet. If your web page is large, a mega might make it easier. The ethernet library that comes with the IDE will take care of the network stack, no need to rewrite it. There are example webserver and webclient sketches too.

Thanks for the information Wildbill.

Actually I am doing it for my project so I will have to write my own TCP/IP stack.
Secondly I want my webserver to get information from the device attached to the microcontroller and send it back to me in some sort of dynamic webpage or something.

I will make a webpage for the control of my microcontroller.

What if i dont want to use Ethernet shield? Will Uno be the still the best option?

I want to make it as simple as possible.

Regards,
Mohsin

You will have to use some sort of physical ethernet interface, so that means you either use an Uno/Mega (etc) with an ethernet sheild or you use an Arduino Ethernet (basically an uno with the shield built in).

Everything else you want is relatively easy, there are plenty of examples that display inputs and/or allow you to set outputs.

Writting your own TCP/IP stack would be hard work and unless it is a requirement of your project, I would recomend you use the existing library.

Commercial product that might be of interest.

http://store.iobridge.com/IO_204_p/a0019.htm

I am not sure if it is a good idea to implement a web server stack and upload it directly to Arduino. From software engineering perspective, I would rather prefer to create a gateway between Arduino and end user. This solution is more loss coupled, adaptable and flexible.

Y

I would also recommend to check out the NaNode , it is an Arduino compatible with ethernet capabilities. Price is quite attractive as well.

http://nanode.eu

I will implement my own TCP/IP stack for communication. I am not sure about which device to use and how to get it started.
I am implementing everything myself from scratch and just need some guidance.

If you were capable to implement a tcp/ip stack on bare bones hardware you would not be asking the above.
May I suggest the following:

Split the project into 3 parts

  1. web content.
  2. web-server.
  3. Hardware interface to real world.

Start by using an off the shelf web server (TinyWebserver), writing the web pages and interfacing the logic.
ONCE that is working, THEN start writing your own TCP/IP stack for serving content and throw away TWS.

HC

Hey,
Unless you've an Ardiuno Mega, you won't have much space to spend, so I would avoid having html on it. I found out a good solution is:

  • A basic webserver on ardiuno (respecting htttp protocol and givving responses in json format)
  • A secundary webserver elsewhere for the html/php content

With ajax you can easily make asyncronous requests to your ardiuno and show them on an eye catching way :slight_smile:

(I've attached how my implementation looks like on my project)

sspt:
Hey,
Unless you've an Ardiuno Mega, you won't have much space to spend, so I would avoid having html on it. I found out a good solution is:

  • A basic webserver on ardiuno (respecting htttp protocol and givving responses in json format)
  • A secundary webserver elsewhere for the html/php content

With ajax you can easily make asyncronous requests to your ardiuno and show them on an eye catching way :slight_smile:

(I've attached how my implementation looks like on my project)

Hi, I would really like to see the code for this (arduino and html/php).

Sorry to jump on the thread but I have a similar project.
I do have a mega and a ethernet shield plus a 16 relay board.
It is a aquarium water change system for two aquariums (at the moment.)

I too want to have a web server to show system status what solenoids are open and closed.
The pump running or not. ect ect.

I am mac user and have used iWeb a lot.
www.kg4mxv.com ( haven't updated it in years :roll_eyes: )

Can I use iWeb to make a simple one line operational display modify it for the controls and upload it to the mega?

Hi
I am doing something very simular at the moment. It is very dynamic but not flashy.
It is based on html, java script and webduino.
Basically I have a html page with 2 tables. 1 table shows the content of variables and the other table allows to set variables.
The server serves following URL's robot, robot/Params?, robot/Change and robot/Param?[variable name]
The Robot page returns the attached html
The robot/Params? page is called by the Robot page and updates the HTML to contain the variable names and the variable values.
Then with a timer function the html requests robot/Change which will return changed values.
I'm no longer using robot/Param?[variable name] as this assumes you know the name of the variable.
The arduino code heavily uses macro's to avoid coding mistakes.
for instance the changed page is build up by

PRINTIFCHANGED(MowSpeed);

The only extra code you need is to have Speeddirection somewhere defined and following defenition which linkes the variable to the html page

#define ID_MowSpeed  		"0"

for the Params the code is:

server.print(MAKELABELRESPONSE(MowSpeed));

I'm using a wifi connection to my Robot and this allows me to see what is going on in the robot without USB cable 8)
The html page is on the sd card. Therefore big files do not have to be an issue.
Best regards
Jantje

Attached
The html file
My code for the server. Note that I use eclipse and the code is part of a bigger project so it will probably not compile.

index.htm (2.47 KB)

RobotWeb.cpp (7.37 KB)

RobotWeb.h (513 Bytes)

Hi to everybody!
I realized an embedded server for this board Arduino Weather Station
The article is in Italian, but more details are at Google Code Archive - Long-term storage for Google Code Project Hosting.
This is the code link ARDUINO WEATHER STATION

Best regards