Hey guys recently i decided to open a webserver using an ethernet shield my server will have multiple html files stored in a sd card and will be used by maximum of 30 people. But i saw some posts saying arduino is freezing after couple of hours so do you think i can use it without problems? What do you think i should be aware of?
P.S. I am using an Arduino Mega 2560
Running 24/7 is no problem for the Arduino hardware.
However if the software is not carefully written it may crash after extended use. The use the String (capital S) class can be a major contributor to that type of instability.
Robin2:
Running 24/7 is no problem for the Arduino hardware.
However if the software is not carefully written it may crash after extended use. The use the String (capital S) class can be a major contributor to that type of instability.
...R
On subject...
Why does this occur? Are String values in RAM say "permanently" allocated?
The String (capital S) class can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.
The String class allocates memory dynamically and frequently.
Cstrings use memory allocated by the programmer when writing the program which allows the programmer to know and control how the memory is used. IMHO that is absolutely essential for the success of a long-lived program on an Arduino.
Thanks for all of your replies so now i know that i can run this server 7/24 but can an ethernet shield and a Arduino Mega 2560 handle 30 people and multiple html files?
NewStudent:
but can an ethernet shield and a Arduino Mega 2560 handle 30 people and multiple html files?
I have no practical experience but I suspect not. That sounds like a job for a cheap laptop or a RaspberryPi. And the programming would be much easier on either of them.
A lot depends on how often the server gets page requests and how much data is required to respond to the request.
My server will have 4 html files and all html files will contain only text data and maximum of 3 people will join at the same time BTW i can not get a raspberry pi or a laptop
NewStudent:
My server will have 4 html files and all html files will contain only text data and maximum of 3 people will join at the same time BTW i can not get a raspberry pi or a laptop
Then all you can do is build the project on your Mega and see if it performs OK.