Arduino Mega + Ethernet shield stops working after a couple days

Hi!

I am using a arduino Mega together with a W5100 based ethernet shield and having some kind of problem that cause
everything to freeze after some time.

When the board is restarted everything is working for some time again, from a couple of days to a couple of weeks.

I am new at this so i know that the code is not perfect :slight_smile:
the code is attached.

STYRSYSTEM_POLEN_V4_FORUM.ino (14.3 KB)

greger888:
I am new at this so i know that the code is not perfect :slight_smile:

And your posting of it isn't either. Read the how to use the forum notes.

You can start by getting rid of all of your String variables and learn how to use C strings instead. The String class will eventually consume so much memory you run into trouble.

You should also learn how to write a function since your loop() program has tons of duplicate code for each button. The only difference is a tiny portion of the URL you are sending which could be passed as a parameter.