Go Down

Topic: Embedded WebServer for online control (Read 3 times) previous topic - next topic

KG4MXV

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?



Jantje

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: [Select]
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: [Select]
#define ID_MowSpeed   "0"
for the Params the code is:
Code: [Select]
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.

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 -

freedomotic

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

Go Up