Re: Aquarium Controller  with Ethernet

Why is this code in loop?

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.

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:

//******************************Web Server******************************
  Ethernet.begin(mac, ip);

  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.

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

Just delete this thread thanks

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

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.

I used meta…“client.print(”");"

Not too bad for a Plumber :-/

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

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

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

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.


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'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)