Pages: 1 [2]   Go Down
Author Topic: plss help about ethernet shield  (Read 903 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

aww.. too bad.. uhm so is there a way to solve my problem? what i really want is to have somehow like a "webserver" who can send and receive data to my arduino.. any suggestions?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
uhm so is there a way to solve my problem?
There does not appear to be a way of correcting your misunderstanding of how client/server architecture works.

Quote
what i really want is to have somehow like a "webserver" who can send and receive data to my arduino.
A web server serves data. There is no way to make a server push data to a client. You wouldn't want google pushing data to you, would you?

A web client pulls data. It can include, in the GET request, information that the server uses to tailor the returned data. That could mean that the server does something like turning a pin on or off, too.

The server can tell the client, using meta tags, that it needs to check back later. That "check back later" part is a completely separate transaction, though.
Logged

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

what i mean is that. is there a way where i can make a simple UI with simple buttons to be displayed using a web browser where it can send and receive data from my arduino...?? please help me..
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
what i mean is that. is there a way where i can make a simple UI with simple buttons to be displayed using a web browser where it can send and receive data from my arduino.
Yes, the Arduino with Ethernet shield can serve up a web page containing a form with submit buttons.

http://www.w3schools.com/html/html_forms.asp

Designing, testing, and implementing a web page is not an Arduino-specific task. If there are Arduino-specific parts you are having problems with, this is the place to discuss them.

What you are struggling with now is not Arduino-specific, so this is not the place for it.
Logged

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

ohhh more too bad for me cause i am not good at html..
uhmm last question.. is there a way that when i open the webserver i made  will maintain the last state of my buttons when i reopen it?
Logged

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11159
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have your Arduino remember the state of the buttons and write the HTML page out next time in such a way that it shows the buttons in their previous state.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

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

Have your Arduino remember the state of the buttons and write the HTML page out next time in such a way that it shows the buttons in their previous state.

uhmm does this apply to the webserver example of ethernet shield? .. can you show me simple codes to remember such states?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
uhmm does this apply to the webserver example of ethernet shield? .. can you show me simple codes to remember such states?

Code:
const int switchCount = 5; // Use your value here
int switchStates[switchCount];

Then, in the rest of the code, update switchStates[ n ], and use switchStates[ n ] in the calls to digitalWrite().
Logged

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

thank you for the knowledge.. another problem for me, if i use a manual button like a push button to change the states of my arduino pins, and i include this for the update of the states, is there a way that my browser to get such updates? uhmm what i am thinking is that, is there like kind of "automatic refresh" feature so like for every 5 secs it would display the present states of my arduino?(if any manual buttons are used)
Logged

California
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you for the knowledge.. another problem for me, if i use a manual button like a push button to change the states of my arduino pins, and i include this for the update of the states, is there a way that my browser to get such updates? uhmm what i am thinking is that, is there like kind of "automatic refresh" feature so like for every 5 secs it would display the present states of my arduino?(if any manual buttons are used)

You asked that earlier in the thread and Paul gave you the answer:

Quote
Yes, and no. There is NO way for a server to push information to a client. The client/server relationship is stateless. Once the server sends data to the client, it forgets that the client ever existed.

The server can embed meta tags in the page that it serves that tell the client that it needs to refetch the page every n seconds. It is up to the client software to see those tags, and to act on them.

The server, though, has no idea that a client request is a result of the user loading the page initially or the client refreshing the page.

Quote
A web server serves data. There is no way to make a server push data to a client. You wouldn't want google pushing data to you, would you?

A web client pulls data. It can include, in the GET request, information that the server uses to tailor the returned data. That could mean that the server does something like turning a pin on or off, too.

The server can tell the client, using meta tags, that it needs to check back later. That "check back later" part is a completely separate transaction, though.
Logged

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

i just want to ask if there is a "auto refresh" function for the web browser of your ethernet shield? like i want it to autoamatically refresh it every 5 secs..
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5377
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i just want to ask if there is a "auto refresh" function for the web browser of your ethernet shield? like i want it to autoamatically refresh it every 5 secs..
Yes. Web browser implies web client.
http://playground.arduino.cc/Code/WebClient
Logged

New Jersey
Online Online
Faraday Member
**
Karma: 48
Posts: 3407
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can do it with the meta refresh tag on whatever is serving up your HTML pages. Here's what you were asking for, from the wikipedia page on the subject:

Code:
<meta http-equiv="refresh" content="5">
Logged

Pages: 1 [2]   Go Up
Jump to: