Arduino Ethernet multiple servers

Hi, I want to build arduino with 2 servers.
one of them is for web service to change IP address from the web page(port 80)
second server is for snmp agent protocol to send temperature to the MIB manager (port 161)
both of them works great when they are not mixed with each other
but when I want to use both of them none of them works! is it possible to do this?
this is part of my code:

#include "SnmpAgent.h"
#include <TextFinder.h>
#include <EEPROM.h>
#include <avr/pgmspace.h>
#include <UIPEthernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SimpleTimer.h>

SNMPAgent SnmpAgent;
OneWire oneWire(2);
DallasTemperature Sensors(&oneWire);

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip[] = {192,168,1,15};
byte subnet[] = {255,255,255,0};
byte gateway[] = {192,168,1,1};
byte dnsserver[] = {192,168,1,1};

EthernetServer server(80);
EthernetServer server2(161);


void setup() {

  ShieldSetup();
  Sensors.begin();
  server.begin();
  server2.begin();


  // Setup default SNMP Agent information
  SnmpAgent.SetCommunity(PSTR("public"));             // Password/Community (Read-Only)
  SnmpAgent.SetDescription(PSTR("Force Sensor"));     // 1.3.6.1.2.1.1.1.0
  SnmpAgent.SetContact(PSTR("vader@deathstar.com"));  // 1.3.6.1.2.1.1.4.0
  SnmpAgent.SetLocation(PSTR("Death Star"));          // 1.3.6.1.2.1.1.6.0
  SnmpAgent.SetSystemName(PSTR("arduino"));           // 1.3.6.1.2.1.1.5.0

  // Setup custom SNMP values (1.3.6.1.4.1.49701.1.X.0),
  // where X is a value between 1 and 5 (defined by MAX_SNMP_VALUES in SnmpAgent.h)
  SnmpAgent.SetValue(1, temperature); // 1.3.6.1.4.1.49701.1.1.0
  SnmpAgent.SetValue(2, &lastMillis); // 1.3.6.1.4.1.49701.1.2.0
}

void ShieldSetup() {
  int idcheck = EEPROM.read(0);

  if (idcheck != ID){

  }
  if (idcheck == ID){
    
    for (int i = 0; i < 4; i++){
      ip[i] = EEPROM.read(i+7);
    }
    for (int i = 0; i < 4; i++){
      subnet[i] = EEPROM.read(i+11);
    }
    for (int i = 0; i < 4; i++){
      gateway[i] = EEPROM.read(i+15);
    }
  }       
  Ethernet.begin(mac, ip);
}

void loop() {
  
      EthernetClient client = server.available();
      if (client) {
      TextFinder  finder(client );
      while (client.connected()) {      
      if (client.available()) {
       
        if( finder.find("GET /") ) {
          
          if (finder.findUntil("setup", "\n\r")){
           
          if (finder.findUntil("SBM", "\n\r")){
            byte SET = finder.getValue();
            
              while(finder.findUntil("DT", "\n\r")){
                int val = finder.getValue();
                // if val from "DT" is between 1 and 6 the according value must be a MAC value.
                if(val >= 1 && val <= 6) {
                  mac[val - 1] = finder.getValue();
                }
                // if val from "DT" is between 7 and 10 the according value must be a IP value.
                if(val >= 7 && val <= 10) {
                  ip[val - 7] = finder.getValue();
                }
                // if val from "DT" is between 11 and 14 the according value must be a MASK value.
                if(val >= 11 && val <= 14) {
                  subnet[val - 11] = finder.getValue();
                }
                // if val from "DT" is between 15 and 18 the according value must be a GW value.
                if(val >= 15 && val <= 18) {
                  gateway[val - 15] = finder.getValue();
                }
              }
            // Now that we got all the data, we can save it to EEPROM
            //for (int i = 0 ; i < 6; i++){
              //EEPROM.write(i + 1,mac[i]);
            //}
            for (int i = 0 ; i < 4; i++){
              EEPROM.write(i + 7, ip[i]);
            }
            for (int i = 0 ; i < 4; i++){
              EEPROM.write(i + 11, subnet[i]);
            }
            for (int i = 0 ; i < 4; i++){
              EEPROM.write(i + 15, gateway[i]);
            }
            EEPROM.write(0, 0x92); 
           }
          // and from this point on, we can start building our setup page
          // and show it in the client's browser.
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          for (int i = 0; i < 4; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table0[i])));
            client.print( buffer );
            }
          for (int i = 0; i < 3; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[i])));
            client.print( buffer );
            }
          client.print(mac[0],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[3])));
          client.print( buffer );
          client.print(mac[1],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[4])));
          client.print( buffer );
          client.print(mac[2],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[5])));
          client.print( buffer );
          client.print(mac[3],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[6])));
          client.print( buffer );
          client.print(mac[4],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[7])));
          client.print( buffer );
          client.print(mac[5],HEX);
          for (int i = 0; i < 4; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[i])));
            client.print( buffer );
            }
          client.print(ip[0],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[4])));
          client.print( buffer );
          client.print(ip[1],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[5])));
          client.print( buffer );
          client.print(ip[2],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[6])));
          client.print( buffer );
          client.print(ip[3],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[0])));
          client.print( buffer );
          client.print(subnet[0],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[1])));
          client.print( buffer );
          client.print(subnet[1],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[2])));
          client.print( buffer );
          client.print(subnet[2],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[3])));
          client.print( buffer );
          client.print(subnet[3],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[0])));
          client.print( buffer );
          client.print(gateway[0],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[1])));
          client.print( buffer );
          client.print(gateway[1],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[2])));
          client.print( buffer );
          client.print(gateway[2],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[3])));
          client.print( buffer );
          client.print(gateway[3],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[4])));
          client.print( buffer );
          for (int i = 0; i < 7; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table5[i])));
            client.print( buffer );
            }
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[5])));
          client.print( buffer );
          client.println();
          client.println();
          client.println("<tr><td><font color=\"red\" size=\"2\" face=\"Verdana\">&nbspYou can not change the MAC address</font></td></tr></table>
");
          
      }}}}
    delay(1);
    client.stop();
  }
   EthernetClient client1 = server2.available();
      if (client1) {
        while (client1.connected()) {      
      if (client1.available()) {
   SnmpAgent.listen();
  if (millis() - lastMillis > 10000) {
    Sensors.requestTemperatures(); // Send the command to get temperatures
    dtostrf(Sensors.getTempCByIndex(0), 1, 1, temperature);
    lastMillis = millis();
      }}}
    delay(1);
    client1.stop();
    }
}

do you have the newest version of the UIPEthernet library?

Juraj:
do you have the newest version of the UIPEthernet library?

yes i have

what memory usage IDE reports?

btw: why don't you use the IPAddress class?

the SNMP client stays connected?

Juraj:
what memory usage IDE reports?

btw: why don't you use the IPAddress class?

93% memory usage
what you mean by IPAddress class?

smead:
93% memory usage

That right there suggests the problem if that is RAM. You'll need to reduce that quite a bit or get a bigger Arduino. Reducing it isn't trivial either as I see you're already putting stuff in progmem.

IPAddress ip(192,168,1,15);

client.print(ip);

ip.fromStrng(buffer)

put the long HTML string into F macro.
client.println(F("<font color="red" size="2" face="Verdana">&nbspYou can not change the MAC address
"));

what is variable string_table?

Juraj:
IPAddress ip(192,168,1,15);

client.print(ip);

ip.fromStrng(buffer)

put the long HTML string into F macro.
client.println(F("<font color="red" size="2" face="Verdana">&nbspYou can not change the MAC address
"));

what is variable string_table?

I don't know where to use IPAddress class...
I put that HTML and now it's 87% memory usage
and the string_table is the code for building text box for changing IP,Gateway and...
I've removed it from the above code due to limitation. this is the code:

const char htmlx0[] PROGMEM = "<html><title>VSR - Sensor Setup Page</title><body marginwidth=\"0\" marginheight=\"0\" ";
const char htmlx1[] PROGMEM = "leftmargin=\"0\" style=\"margin: 0; padding: 0;\"><table bgcolor=\"#02978E\" border";
const char htmlx2[] PROGMEM = "=\"0\" width=\"100%\" cellpadding=\"10\" style=\"font-family:Verdana;color:#fff";
const char htmlx3[] PROGMEM = "fff;font-size:18px;\"><tr><td>&nbspVSR - Sensor Setup Page v1.0</td></tr></table>
";
PGM_P const string_table0[] PROGMEM = {htmlx0, htmlx1, htmlx2, htmlx3};

const char htmla0[] PROGMEM = "<script>function hex2num (s_hex) {eval(\"var n_num=0X\" + s_hex);return n_num;}";
const char htmla1[] PROGMEM = "</script><table><form><input type=\"hidden\" name=\"SBM\" value=\"1\"><tr><td>MAC:";
const char htmla2[] PROGMEM = "<input id=\"T1\" type=\"text\" size=\"2\" maxlength=\"2\" name=\"DT1\" value=\"";
const char htmla3[] PROGMEM = "\">.<input id=\"T3\" type=\"text\" size=\"2\" maxlength=\"2\" name=\"DT2\" value=\"";
const char htmla4[] PROGMEM = "\">.<input id=\"T5\" type=\"text\" size=\"2\" maxlength=\"2\" name=\"DT3\" value=\"";
const char htmla5[] PROGMEM = "\">.<input id=\"T7\" type=\"text\" size=\"2\" maxlength=\"2\" name=\"DT4\" value=\"";
const char htmla6[] PROGMEM = "\">.<input id=\"T9\" type=\"text\" size=\"2\" maxlength=\"2\" name=\"DT5\" value=\"";
const char htmla7[] PROGMEM = "\">.<input id=\"T11\" type=\"text\" size=\"2\" maxlength=\"2\" name=\"DT6\" value=\"";
PGM_P const string_table1[] PROGMEM = {htmla0, htmla1, htmla2, htmla3, htmla4, htmla5, htmla6, htmla7};

const char htmlb0[] PROGMEM = "\"><input id=\"T2\" type=\"hidden\" name=\"DT1\"><input id=\"T4\" type=\"hidden\" name=\"DT2";
const char htmlb1[] PROGMEM = "\"><input id=\"T6\" type=\"hidden\" name=\"DT3\"><input id=\"T8\" type=\"hidden\" name=\"DT4";
const char htmlb2[] PROGMEM = "\"><input id=\"T10\" type=\"hidden\" name=\"DT5\"><input id=\"T12\" type=\"hidden\" name=\"D";
const char htmlb3[] PROGMEM = "T6\"></td></tr><tr><td>IP: <input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT7\" value=\"";
const char htmlb4[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT8\" value=\"";
const char htmlb5[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT9\" value=\"";
const char htmlb6[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT10\" value=\"";
PGM_P const string_table2[] PROGMEM = {htmlb0, htmlb1, htmlb2, htmlb3, htmlb4, htmlb5, htmlb6};

const char htmlc0[] PROGMEM = "\"></td></tr><tr><td>MASK: <input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT11\" value=\"";
const char htmlc1[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT12\" value=\"";
const char htmlc2[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT13\" value=\"";
const char htmlc3[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT14\" value=\"";
PGM_P const string_table3[]  PROGMEM = {htmlc0, htmlc1, htmlc2, htmlc3};

const char htmld0[] PROGMEM = "\"></td></tr><tr><td>GW: <input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT15\" value=\"";
const char htmld1[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT16\" value=\"";
const char htmld2[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT17\" value=\"";
const char htmld3[] PROGMEM = "\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT18\" value=\"";
const char htmld4[] PROGMEM = "\"></td></tr><tr><td>
</td></tr><tr><td><input id=\"button1\"type=\"submit\" value=\"SUBMIT\" ";
const char htmld5[] PROGMEM = "></td></tr></form></table></body></html>";
PGM_P const string_table4[] PROGMEM = {htmld0, htmld1, htmld2, htmld3, htmld4, htmld5};

const char htmle0[] PROGMEM = "Onclick=\"document.getElementById('T2').value ";
const char htmle1[] PROGMEM = "= hex2num(document.getElementById('T1').value);";
const char htmle2[] PROGMEM = "document.getElementById('T4').value = hex2num(document.getElementById('T3').value);";
const char htmle3[] PROGMEM = "document.getElementById('T6').value = hex2num(document.getElementById('T5').value);";
const char htmle4[] PROGMEM = "document.getElementById('T8').value = hex2num(document.getElementById('T7').value);";
const char htmle5[] PROGMEM = "document.getElementById('T10').value = hex2num(document.getElementById('T9').value);";
const char htmle6[] PROGMEM = "document.getElementById('T12').value = hex2num(document.getElementById('T11').value);\"";
PGM_P const string_table5[] PROGMEM = {htmle0, htmle1, htmle2, htmle3, htmle4, htmle5, htmle6};

const byte ID = 0x92; //used to identify if valid data in EEPROM the "know" bit,

Juraj:
the SNMP client stays connected?

so lets focus on networking.
the SNMP client stays connected?

Juraj:
so lets focus on networking.
the SNMP client stays connected?

no it’s not working unless I remove web service client

smead:
no it’s not working unless I remove web service client

what is SnmpAgent? how is it related to server2 and client1? you don't use client1 to read and print

Juraj:
what is SnmpAgent? how is it related to server2 and client1? you don't use client1 to read and print

Its a protocol to send and receive data from Arduino(Agent) to manager (MIB) via LAN
it doesn't related to client 1; client 1 is just for being able to change the IP address of device(Agent).
there is comment “SnmpAgent.begin();” for starting snmp server on port 161. when I put it in the setup() it doesn't work; then I replaced it with EthernetServer(161)

smead:
Its a protocol to send and receive data from Arduino(Agent) to manager (MIB) via LAN
it doesn't related to client 1; client 1 is just for being able to change the IP address of device(Agent).
there is comment “SnmpAgent.begin();” for starting snmp server on port 161. when I put it in the setup() it doesn't work; then I replaced it with EthernetServer(161)

client is for the web page, not client1. you have confusing variable names

so delete server2(161) from your code and let SnmpAgent.listen(); handle the port 161

Juraj:
client is for the web page, not client1. you have confusing variable names

so delete server2(161) from your code and let SnmpAgent.listen(); handle the port 161

Ok so I did it and none of them working yet...
but when I delete SnmpAgent.listen(); , web server works fine or by removing web server, snmp protocol works.
here you can see my edited code:

void setup() {

  ShieldSetup();
  Sensors.begin();
  server.begin();
  SnmpAgent.begin();

  SnmpAgent.SetCommunity(PSTR("public"));             // Password/Community (Read-Only)
  SnmpAgent.SetDescription(PSTR("Force Sensor"));     // 1.3.6.1.2.1.1.1.0
  SnmpAgent.SetContact(PSTR("vader@deathstar.com"));  // 1.3.6.1.2.1.1.4.0
  SnmpAgent.SetLocation(PSTR("Death Star"));          // 1.3.6.1.2.1.1.6.0
  SnmpAgent.SetSystemName(PSTR("arduino"));           // 1.3.6.1.2.1.1.5.0

  // Setup custom SNMP values (1.3.6.1.4.1.49701.1.X.0),
  // where X is a value between 1 and 5 (defined by MAX_SNMP_VALUES in SnmpAgent.h)
  SnmpAgent.SetValue(1, temperature); // 1.3.6.1.4.1.49701.1.1.0
  SnmpAgent.SetValue(2, &lastMillis); // 1.3.6.1.4.1.49701.1.2.0
}

void ShieldSetup() {
  int idcheck = EEPROM.read(0);

  if (idcheck != ID){

  }
  if (idcheck == ID){
    
    for (int i = 0; i < 4; i++){
      ip[i] = EEPROM.read(i+7);
    }
    for (int i = 0; i < 4; i++){
      subnet[i] = EEPROM.read(i+11);
    }
    for (int i = 0; i < 4; i++){
      gateway[i] = EEPROM.read(i+15);
    }
  }       
  Ethernet.begin(mac, ip);
}

void loop() {
  
      EthernetClient client = server.available();
      if (client) {
      TextFinder  finder(client );
      while (client.connected()) {      
      if (client.available()) {
       
        if( finder.find("GET /") ) {
          
          if (finder.findUntil("setup", "\n\r")){
           
          if (finder.findUntil("SBM", "\n\r")){
            byte SET = finder.getValue();
            
              while(finder.findUntil("DT", "\n\r")){
                int val = finder.getValue();
                // if val from "DT" is between 1 and 6 the according value must be a MAC value.
                if(val >= 1 && val <= 6) {
                  mac[val - 1] = finder.getValue();
                }
                // if val from "DT" is between 7 and 10 the according value must be a IP value.
                if(val >= 7 && val <= 10) {
                  ip[val - 7] = finder.getValue();
                }
                // if val from "DT" is between 11 and 14 the according value must be a MASK value.
                if(val >= 11 && val <= 14) {
                  subnet[val - 11] = finder.getValue();
                }
                // if val from "DT" is between 15 and 18 the according value must be a GW value.
                if(val >= 15 && val <= 18) {
                  gateway[val - 15] = finder.getValue();
                }
              }
            // Now that we got all the data, we can save it to EEPROM
            //for (int i = 0 ; i < 6; i++){
              //EEPROM.write(i + 1,mac[i]);
            //}
            for (int i = 0 ; i < 4; i++){
              EEPROM.write(i + 7, ip[i]);
            }
            for (int i = 0 ; i < 4; i++){
              EEPROM.write(i + 11, subnet[i]);
            }
            for (int i = 0 ; i < 4; i++){
              EEPROM.write(i + 15, gateway[i]);
            }
            EEPROM.write(0, 0x92); 
           }
          // and from this point on, we can start building our setup page
          // and show it in the client's browser.
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          for (int i = 0; i < 4; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table0[i])));
            client.print( buffer );
            }
          for (int i = 0; i < 3; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[i])));
            client.print( buffer );
            }
          client.print(mac[0],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[3])));
          client.print( buffer );
          client.print(mac[1],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[4])));
          client.print( buffer );
          client.print(mac[2],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[5])));
          client.print( buffer );
          client.print(mac[3],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[6])));
          client.print( buffer );
          client.print(mac[4],HEX);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table1[7])));
          client.print( buffer );
          client.print(mac[5],HEX);
          for (int i = 0; i < 4; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[i])));
            client.print( buffer );
            }
          client.print(ip[0],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[4])));
          client.print( buffer );
          client.print(ip[1],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[5])));
          client.print( buffer );
          client.print(ip[2],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table2[6])));
          client.print( buffer );
          client.print(ip[3],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[0])));
          client.print( buffer );
          client.print(subnet[0],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[1])));
          client.print( buffer );
          client.print(subnet[1],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[2])));
          client.print( buffer );
          client.print(subnet[2],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table3[3])));
          client.print( buffer );
          client.print(subnet[3],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[0])));
          client.print( buffer );
          client.print(gateway[0],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[1])));
          client.print( buffer );
          client.print(gateway[1],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[2])));
          client.print( buffer );
          client.print(gateway[2],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[3])));
          client.print( buffer );
          client.print(gateway[3],DEC);
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[4])));
          client.print( buffer );
          for (int i = 0; i < 7; i++)
            {
            strcpy_P(buffer, (char*)pgm_read_word(&(string_table5[i])));
            client.print( buffer );
            }
          strcpy_P(buffer, (char*)pgm_read_word(&(string_table4[5])));
          client.print( buffer );
          client.println();
          client.println();
          (F("<tr><td><font color=\"red\" size=\"2\" face=\"Verdana\">&nbspYou can not change the MAC address</font></td></tr></table>
"));
      }}}}
    delay(1);
    client.stop();
  }
  
   SnmpAgent.listen();
  // Update the temperature variable every 10 seconds
  if (millis() - lastMillis > 10000) {
    Sensors.requestTemperatures(); // Send the command to get temperatures
    dtostrf(Sensors.getTempCByIndex(0), 1, 1, temperature);
    lastMillis = millis();
  }
}

use GitHub - mpflaga/Arduino-MemoryFree: basic functions and example to use show used RAM and use less of it. to print free memory

Serial.println(freeMemory());

Juraj:
use GitHub - mpflaga/Arduino-MemoryFree: basic functions and example to use show used RAM and use less of it. to print free memory

Serial.println(freeMemory());

It's 106!

any solution?! :frowning:

smead:
any solution?! :frowning:

Mega