"Full version" of Electronoobs code will also work on arduino UNO or NANO (ATmega328P) if you store all string in program memory (flash) via "F( )" macro.
e.g.: Serial.println(F("READY TO SEND")); ( or lcd.print(F("...")); )
Like this I reduce the used RAM to 70% (595 bytes left).
original code: 2185 byte (RAM) - 2048max 16566 byte (FLASH) - 30720max
modified code: 1453 byte (RAM) 16950 byte (FLASH)
//part of code for demonstrate lcd.clear(); lcd.setCursor(0,0); lcd.print(F("N1: ")); lcd.print(received_nr_1); lcd.print(F(" N2: ")); lcd.print(received_nr_2); lcd.setCursor(0,1); lcd.print(F("N3: ")); lcd.print(received_nr_3); lcd.print(F(" N4: ")); lcd.print(received_nr_4); delay(1000);//5 seconds between tries
Also I have problem with compiling the sketch because my I2C LCD library does not include member "init()" but instead of it I just write "begin()". lcd.begin();
It depends on version of your library, just try which one would work for you. And if you have still problem with it open example sketch of your LCD I2C library and find the correct form of initializing command.
Or in some libraries you have to write some variables in this command like "lcd.begin(0x27,20,4);" (address and size).
LiquidCrystal_I2C lcd(0x27,20,4); lcd.begin(); lcd.init(); // one of these should work for you
Due to your modifications of code, if 595 bytes in RAM would not be enough (if it will still cause stability problems) you can also write other string (e.g.: const char SSID_ESP = "..."; const char SSID_KEY = "..."; ...) to program memory via PROGMEM macro.
e.g.: PROGMEM const char SSID_ESP = "...";
But you will need to write a little bit of code.
You will need to create a buffer (in RAM) where you will write one of strings from flash which will be use in next piece of code.
PROGMEM const char SSID_ESP = "someSSID";
unsigned char buffer[bufferMaxLength];
buffer[i] = pgm_read_byte_near(&SSID_ESP+i);
if(buffer[i]=='\0' /*end of string*/) break;