Small Ethernet Library

Hi all
Not sure if this is the correct thread

Im building a small project using a nano and ethernet shield
and I found that when compiling, the ethernet library is using 50-60% of my memory.

I dont need any of the extra stuff that comes with some libraries, such as http servers
is there a small library that will give just enough for a MQTT communication to happen?

Thanks in advance :slight_smile:

model of the shield?

Deek Robot
Nano Ethernet Shield V1.0

it has the enc28j60 chip. the Ethernet library can't work with it. UIPEthernet could, but it is even larger.
so your only option is the EtherCard library

Iv tried ethercard, but when I load the library my memory goes to 50% usage, and thats before i'v even added any of my own code.

#include <EtherCard.h>

static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
byte Ethernet::buffer[700];
void setup() {
Serial.begin(9600);
Serial.println("Start");
ether.dhcpSetup();
ether.printIp("My IP: ", ether.myip);
}

void loop() {

}

pomtom44:
Iv tried ethercard, but when I load the library my memory goes to 50% usage, and thats before i'v even added any of my own code.

yes. the chip leaves too match work on network handling to the MCU.

Thats a bugger
Ok looks like ill have to get a larger memory arduino then

You could probably save some memory by switching to a W5100 or W5500 Ethernet controller. Unlike the ENC28J60, the W5x00 has the TCP/IP stack built in. When you use the ENC28J60, the TCP/IP stack must be implemented in your Arduino's memory, which uses a lot.