Loading...
Pages: [1]   Go Down
Author Topic: Re: Aquarium Controller  with Ethernet  (Read 603 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 336
Posts: 36476
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why is this code in loop?
Code:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,3};

Server server(80);
During every execution of loop, you want to create a new server?

You would be doing yourself, and us, a huge favor if you were to learn to create functions.

Each case in loop should call a separate function.

Some indentation would be useful, too.

Code:
for (;;){
key = lcd.keypad();
if(key == -1){break;}
}
Magic numbers with no comments are to be avoided. What does the -1 from lcd.keypad() mean?

More code that does not belong in loop:
Code:
//******************************Web Server******************************
{
  Ethernet.begin(mac, ip);
  server.begin();

  Client client = server.available();
  if (client) {
You are restarting the server on every pass through loop. It's no wonder an external system can not connect to it.
Logged

0
Offline Offline
Tesla Member
***
Karma: 58
Posts: 6781
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry the origional post got deleted. There are actually people that can try to help.
Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Hamilton, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just delete this thread thanks
Logged

Hamilton, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With no thanks to a member's helpful post
Today I went back to the drawing board and after 9 straight hours have something to show for it



I even have managed to get the web page to refresh every 20 sec
Logged

0
Offline Offline
Tesla Member
***
Karma: 58
Posts: 6781
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I even have managed to get the web page to refresh every 20 sec

I've seen meta refresh and possibly javascripts do that type of thing.
Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Hamilton, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used meta......"client.print("<META HTTP-EQUIV=REFRESH content=20 url='http://192.168.1.9' >");"


Not too bad for a Plumber  :-/
« Last Edit: December 26, 2010, 10:41:02 pm by kiwikid_1 » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 283
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't you need a counter to show the number of present 'floaters'.  smiley-wink
Logged

Hamilton, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

don't know what you just said....but as you see it is how I entered it to the code

Code:
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.print("<META HTTP-EQUIV=REFRESH content=20 url='http://192.168.1.9' >");
client.println("<body style=background-color:yellow>");
client.println("<font color='red'><h1>ReefController parameters</h1></font>");
client.println("<hr/>");
client.println("<hr/>");
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 283
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry poor joke I guess. Floaters are what I/we call fish that die and tend to float on the top surface of the water.

Lefty

Logged

Hamilton, New Zealand
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I lost 2K's worth of fish 18 months ago......with MV and it wasn't a joke.

This controller will be looking after my new setup....it's 7 1/2 foot (2mtrs) x 3.3ft (1mtr)

Still got some work to do on the server as you can see....then I want to try and upload it to my website as well....(I know a big ask for a plumber)
Logged

Pages: [1]   Go Up
Print
 
Jump to: