Pages: [1]   Go Down
Author Topic: Embedded WebServer for online control  (Read 3498 times)
0 Members and 1 Guest are viewing this topic.
Mancester
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 70
Posts: 3726
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9671
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Commercial product that might be of interest.

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

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 98
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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

Logged

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

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 smiley

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


* WI.png (50.99 KB, 1272x307 - viewed 62 times.)
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 95
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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

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

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 smiley-roll )

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


Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1922
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Code:
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
Code:
#define ID_MowSpeed   "0"
for the Params the code is:
Code:
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  smiley-cool
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 - downloaded 49 times.)
* RobotWeb.cpp (7.37 KB - downloaded 36 times.)
* RobotWeb.h (0.5 KB - downloaded 28 times.)
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi to everybody!
I realized an embedded server for this board http://www.ethermania.com/blog/?page_id=361
The article is in Italian, but more details are at http://code.google.com/p/freedomotic/wiki/ArduinoWeathershield
This is the code link http://www.ethermania.com/blog/wp-content/uploads/WeatherStation.pde_.txt

Best regards
Logged

Freedomotic Domotica Open Source
http://freedomotic.com
We need your help. Please contact us for contributing

Pages: [1]   Go Up
Jump to: