user28084: I have connected some sensors to an Arduino Uno (but the final code should run on a Pro-Mini) with an ENC28J60 shield. The sensor code works fine - until I add EtherCard. I tried UIPEthernet first, but it's even worse. The problem is the memory footprint. The ethernet libraries are consuming so much memory that random malfunctions do occur.
So I was thinking about removing TCP from the EtherCard library, because I don't need it anyway. I only need IP, ARP, UDP, and based on that DHCP, DNS and NTP.
Has someone already done this?
Is there a stripped-down library?
The file tcp.cpp is pretty big (the biggest in this lib). Is it safe to remove all methods with "tcp" in their name?
Or is there a better solution for this situation?

user37622: My EthernetENC library based on the original UIPEthernet library by Norbert Truchsess has settings to balance performance and memory usage. These settings are in utility/uipethernet-conf.h file or can be specified as -D parameters for compilation.
UIP_CONF_MAX_CONNECTIONS is a maximum number of connected EthernetClient connections. The default value s 4. You can set it to 0 if you don't use EthernetClient TCp connections. It will save a lot of dynamic memory.
Arduino IDE doesn't have the possibility to set defines for a sketch (For example Sloeber has it). As some workaround to set the defines for different boards for Arduino IDE, you can create a file boards.local.txt next to boards.txt file in hardware package. Set build.extra_flags for individual boards.
comment by OP:

Setting uno.build.extra_flags= -DUIP_CONF_MAX_CONNECTIONS=0 in "boards.txt" in the arduino IDE folder reduced program memory usage by 2442 bytes and dynamic memory usage by 290 bytes.


28084: <p>I have connected some sensors to an Arduino Uno (but the final code should run on a Pro-Mini) with an ENC28J60 shield. The sensor code works fine - until I add EtherCard. I tried UIPEthernet first, but it's even worse. The problem is the memory footprint. The ethernet libraries are consuming so much memory that random malfunctions do occur.</p>
<p>So I was thinking about removing TCP from the EtherCard library, because I don't need it anyway. I only need IP, ARP, UDP, and based on that DHCP, DNS and NTP.</p>
<p>Has someone already done this?<br />
Is there a stripped-down library?</p>
<p>The file <code>tcp.cpp</code> is pretty big (the biggest in this lib). Is it safe to remove all methods with &quot;tcp&quot; in their name?</p>
<p>Or is there a better solution for this situation?</p>
 37622: <p>My EthernetENC library based on the original UIPEthernet library by Norbert Truchsess has <a href="https://github.com/jandrassy/EthernetENC/wiki/Settings" rel="nofollow noreferrer">settings</a> to balance performance and memory usage. These settings are in utility/uipethernet-conf.h file or can be specified as -D parameters for compilation.</p>
<p><code>UIP_CONF_MAX_CONNECTIONS</code> is a maximum number of connected EthernetClient connections. The default value s 4. You can set it to 0 if you don't use EthernetClient TCp connections. It will save a lot of dynamic memory.</p>
<p>Arduino IDE doesn't have the possibility to set defines for a sketch (For example Sloeber has it). As some workaround to set the defines for different boards for Arduino IDE, you can create a file boards.local.txt next to boards.txt file in hardware package. Set build.extra_flags for individual boards.</p>
<p>comment by OP:</p>
<blockquote>
<p>Setting uno.build.extra_flags= -DUIP_CONF_MAX_CONNECTIONS=0 in &quot;boards.txt&quot; in the arduino IDE folder reduced program memory usage by 2442 bytes and dynamic memory usage by 290 bytes.</p>
</blockquote>
