Uno + EtherCard Library

Hello guys ! :slight_smile:

I have a home automation project using Arduino Uno and Ethernet Module ENC28J60.
I got a sketch from github serving as a webpage hosted on the Arduino to be able to control LEDs and check the temperature using LM35 sensor…

The problem I have is that if I’m using the ENC28J60, I have to use one of the libraries:

  • UIPEthernet: which is very easy to use just by replacing the #include
    but in this case I get an error: Not Enough Memory

so I tried to move for the:

  • EtherCard, but I really don’t know what to replace and how to implement it.

I googled a lot and search in these forums for ways but couldn’t find any.

Please help me get this straight.

I appreciate your cooperation :slight_smile:

Regards,
Mahmoud

Control.ino (5.07 KB)

client.println("HTTP/1.1 200 OK");

Everywhere you have something like this change it to:

client.println(F("HTTP/1.1 200 OK"));

That will save you lots of SRAM so you might be able to continue using UIPEthernet. Doing this will increase your flash memory usage though so if you start running low then you might try to reword some of these strings to make them shorter.

Please, before you post code(and just as general good practice do Tools > Auto Format this will make it much easier for us to read and might help you to find bugs. It's also better to post code in code tags rather than an attachment.

Also, use strings instead of Strings to save memory.