Controllare Arduino da remoto con modulo Enc28j60

Salve a tutti,

il seguente programmino mi permette di far accendere o spegnere un LED da una pagina html che genera direttamente lo sketch di arduino:

#include <EtherCard.h>

static byte mac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

static byte ip[] = { 192, 168, 1, 7 };

//La variabile seguente è il cosiddetto buffer tcp/ip e contiene la richiesta ricevuta dal browser
byte Ethernet::buffer[700];

#define ENC28J60_CS 10
#define LED 7

//La pagina html viene salvata nella memoria programma (PROGMEM) come un array di caratteri:
const char accendiLED[] PROGMEM =
 
"HTTP/1.0 200 OK\r\n"
 
"Content-Type: text/html\r\n"
 
"Pragma: no-cache\r\n\r\n"
 
"<html><head><title>ARDUINO - ENC28J60</title></head>"
 
"<body><center>"
 
"<h1> - Arduino in rete - </h1>"
 
"<h2> - Test led - </h2>"
 
"<a href='/on'><input type='button' value=' - ACCENDI LED - '/></a>"
 
"</body>"
 
"</center></html>";
 
 
 
const char spegniLED[] PROGMEM =
 
"HTTP/1.0 200 OK\r\n"
 
"Content-Type: text/html\r\n"
 
"Pragma: no-cache\r\n\r\n"
 
"<html><head><title>ARDUINO - ENC28J60</title></head>"
 
"<body><center>"
 
"<h1> - Arduino in rete - </h1>"
 
"<h2> - Test led - </h2>"
 
"<a href='/off'><input type='button' value=' - SPEGNI LED - '/></a>"
 
"</center></body>"
 
"</html>";
 
 
 
 
 
void setup () {
  pinMode(LED, OUTPUT);
  Serial.begin(115200);
  Serial.println("ARDUINO IN RETE");
  Serial.println(" - TEST LED - ");
  Serial.println(" ");
  
  if ( !ether.begin(sizeof Ethernet::buffer, mac, ENC28J60_CS) )
    Serial.println("ERROR: ether.begin!");
 
 
 
if ( !ether.dhcpSetup() )
 
if ( !ether.staticSetup(ip) )
 
Serial.println("ERROR: Set IP failed!");
 
 
 
ether.printIp("Ip locale: ", ether.myip);
 
ether.printIp("Netmask: ", ether.mymac);
 
ether.printIp("Gateway: ", ether.gwip);
 
ether.printIp("Dns: ", ether.dnsip);
 
 
 
}
 
 
 
void loop() {
 
 
//salviamo nella variabile pos il valore di ritorno del metodo packetLoop: questo valore indica la posizione, all'interno dei buffer di ricezione, in cui inizia la richesta del browser 
word pos = ether.packetLoop( ether.packetReceive() );

/*Memorizziamo la risposta da inviare al browser utilizzando l'oggetto BufferFiller. Questo oggetto deriva dalla classe Print e viene costrutito passando l'indirizzo tcp0ffset del buffer
ethernet da cui partire per memorizzare la risposta*/
BufferFiller bfill = ether.tcpOffset();
 

/*Se pos è maggiore di 0, significa che abbiamo ricevuto effettivamente una richiesta e possiamo stampare su seriale(buffer+pos indica proprio la posizione da cui partire ad estrarre
i dati dal buffer di ricezione*/ 
 
if (pos)
{
  Serial.println(" ");
Serial.println("<hr class=\"bbcode_rule\">");
Serial.println( (char *) Ethernet::buffer + pos );
 
Serial.println("<hr class=\"bbcode_rule\">");
 
Serial.println(" ");
 
Serial.println(" ");
 
 
/*la funzione strstr verifica se nella richiesta ricevuta è presente la sottostrina "GET /on"*/
if ( strstr( (char *) Ethernet::buffer + pos, "GET /on") )
 
{
 
 /*Accende il led*/
digitalWrite(LED, HIGH);
 
Serial.println("Led acceso!");
 
 
 /*Il metodo emit_p() ci consente di inserire dati nel buffer: in questo caso verrà visualizzara la pagina che è stata memorizzata nella memoria programma spegniLED. Utilizziamo 
 la macro PSTR() per risparmiare spazio in memoria RAM*/
bfill.emit_p(PSTR("$F"), spegniLED);

/*Inviamo la risposta al browser*/
ether.httpServerReply( bfill.position() );
 
}
 
else if ( strstr( (char *) Ethernet::buffer + pos, "GET /off") )
 
{
 
/*spengo il led*/
digitalWrite(LED, LOW);
 
Serial.println("Led spento!");
 
 
 
bfill.emit_p(PSTR("$F"), accendiLED);
 
ether.httpServerReply( bfill.position() );
 
}
 
else if ( strstr( (char *) Ethernet::buffer + pos, "GET /led") )
 
{
 
if ( (int) digitalRead(LED) )
 
{
 
bfill.emit_p(PSTR("$F"), spegniLED);
 
ether.httpServerReply( bfill.position() );
 
 
 
Serial.println("Spegni LED!");
 
}
 
else
 
{
 
bfill.emit_p(PSTR("$F"), accendiLED);
 
ether.httpServerReply( bfill.position() );
 
 
 
Serial.println("Accendi LED!");
 
}
 
}
 
}
 
 
 
}

Poichè tale programma occupa già il 65% della memoria RAM, vorrei sapere se è possibile ottenere lo stesso risultato senza dover scrivere l'html in questo sketch ma su una pagina web che risiede in un dominio.

Grazie.

Prova a modiificare tutte le print cosi, racchiudendole dentro F():

Serial.println( F("<hr class=\"bbcode_rule\">") );