Académique Documents
Professionnel Documents
Culture Documents
web server
introduced by
Abdullah Yahya Yassen
Abdullah Yahya Jabr
Supervisor :
Eng : Haya Sama3neh
Dr.Raed alqadi
Dr. luai malhees
Eng :sufian samara
Project Resources :
C code writing:
At first we will talk about the temperature sensors ,these
sensors will be taken on channel 0 and 1 and in the code we change
the channel so we read one channel next an other ,as we know that
the floating point operations takes a lot of clock cycles and that of
course a bad thing to so we do it by this way :
ws=*((WORD*)(&ADRESL));// take the data from the
ADC
tempreture=(ws -552);
tempreture*=.35525;// equations the only float
operations used
x1=(int)( tempreture*100);
x2=x1%100;
x1=x1/100;
itoa(x1,s1);
itoa(x2,s2);
strcpy(AN0String,s1);
strcat(AN0String,xa);//the .
strcat(AN0String,s2);
this code will take the float value the multiply it by 100 that will
shift it to the left by two digits then we divide it into two parts
before the dot and after it the concatenate the three strings to gather
and store them into a variable that can be sent when requested .
now we will discus how the hardware deals with the software
,there is a simple parser for parsing the URL of the requested page
or for the requested command this parser return the arguments one
by one then the pic can see the argument and do the command
associated with argument taken this is simple description about
what happens .
Now any button that will submit the form its name and value will
be sent with the URL that will request the set.CGI ,where this page
will change a value in the pic then it will redirect to the conf.cgi
that will show that the status of the room at this time will be
changed as requested by the client .
The first page that will appear to the user when he open
server is the login page (INDEX.CGI )that will show the user name
and password fields to be filled , and then the page will send the
request to the pic and the pic determine if the password and user
name are correct then it will send a page to the client depending on
the password and user name ,if they where correct it will redirect
the page to INDEX2.HTM and if its wrong it will resend the login
page again .
Put we couldnt forbid the user from opining the other pages
without applying the correct name and password thats due to the
pages are stored in the pic and it couldnt check the user name and
password without being loaded on the client side .we tried to solve
this problem by the HTTP Authentication put we couldnt .
Lets go to the interface of the web pages :
As the page is shown above there is two rooms each room has a
light (or a fan) and a temperature and each one of them has its
status shown and on the hardware side there exists a led, fane,
sensor , and also on the web page there is a page for each room so
that the user can configure the time that he needs the room light to
be on and at what day as this figure shows:
Now each CGI when the pic is available will display the status of
the light at this time and date then if we want to flip it we just press
the button and then it will change the value on the hardware side so
that the fan will be on or off with respect to time as its stored to be
on or off .