When I published my first example about using Arduino as a webserver, many of you wrote me asking how to control Arduino using a web browser: in this blog post I’m going to show you how to control a LED from a web page.
A bit of HTML
First, you need to write an HTML page that will be the web interface Arduino sends to your web browser:
This web page is very simple: a label about LED’s actual status and a button to change it.
Looking at page’s HTML source, you can identify the variable elements; i.e. the elements that change according to the LED’s status:
From the source, you can also understand what’s going to happen when the user clicks the button: his browser will ask to Arduino a web page named:
[checklist]
- /?status=ON, if the LED has to be turned on
- /?status=OFF, if the LED has to be turned off
[/checklist]
The use of ?name=value to send data to a web server reflects the standard syntax of HTML forms using the GET method.
Arduino
Arduino’s sketch will parse browser‘s request, looking for one of the two commands listed above and change LED’s status according to them. It will then prepare an HTML page using your template and send it to the user.
The complete sketch is available on GitHub’s repository, here are the most interesting blocks:
char* on = "ON"; char* off = "OFF"; char* statusLabel; char* buttonLabel; |
Two static strings (ON, OFF) and two variables are defined: the variables will be used in HTML page creation, associating to them one of the two static strings.
pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); ledStatus = false; |
In the setup(), in addition to EtherCard library setup, LED’s initial status (off) is configured.
if(strstr((char *)Ethernet::buffer + pos, "GET /?status=ON") != 0) { Serial.println("Received ON command"); ledStatus = true; } if(strstr((char *)Ethernet::buffer + pos, "GET /?status=OFF") != 0) { Serial.println("Received OFF command"); ledStatus = false; } |
In the main loop(), our sketch parse browser’s request (saved in Ethernet::buffer buffer starting from pos position) looking for status ON/OFF commands.
if(ledStatus) { digitalWrite(ledPin, HIGH); statusLabel = on; buttonLabel = off; } else { digitalWrite(ledPin, LOW); statusLabel = off; buttonLabel = on; } |
The status of ledPin (Arduino’s PIN the LED is connected to) is updated and the two string variables are associated to the correct labels:
Finally, the HTML page is created: with $S placeholders you can ask to emit_p method to insert, in the place of them, the values of the variables listed subsequently; for example in place of the first $S will be inserted the value of statusLabel variable…
Conclusions
With this blog post, I hope I gave you some hints about how to control your Arduino via web; for any questions please post a comment!
At the end, here’s a short video about this example:
Hi there,
Is is not possible to use byte EtherCard::findKeyVal (const char *str,char *strbuf, byte maxlen,const char *key) function to do the same?
If so, how?
Thank you
Hi Johan,
yes, you can use that method which looks for a given string in the form key=value.
It is a little more complex than my example, you have to allocate a buffer to store the string found:
char returnBuffer[10];
ether.findKeyVal((char *)Ethernet::buffer + pos, returnBuffer, 10, “status”);
let me know if it works… thanks!
Hi,
Thanks for ENC28J60 tutorials. How can i do this for all digital output pins?
Thank you.
ciao luca, ottimo tutorial il tuo,
volevo sapere se per caso si poteva usare il metodo POST con questa libreria. in rete ho trovato poco o niente.
Grazie mille, Igor
Ciao Igor,
per la libreria è abbastanza “trasparente” il metodo usato: nel buffer ti ritrovi infatti tutto il pacchetto http quindi sia i dati del metodo GET (che sono nell’URL), sia quelli del metodo POST (che sono nell’header)… questa settimana eseguo qualche test e ti faccio sapere!
Salve
grazie per il tutorial, che ho letto con interesse e passione.
Fabio
grazie a te per il feedback, Fabio!
Ciao
devo dire che l’esempio di questa lezione mi ha fatto un po’ fatto impazzire perche’ l’indirizzo IP indicato entrava in conflitto con un IP gia’ presente. Non sono riuscito a capire subito la natura del problema anche perche’ il metodo ether.staticsetup non riportava failed. Ma non dovrebbe costituire un’anomalia della libreria?
Fabio
Ciao Fabio
in effetti la libreria non ha alcun meccanismo per capire se l’IP assegnato è duplicato in rete: se guardi il metodo staticsetup() semplicemente si salva i valori che tu specifichi. grazie per la segnalazione!
Thank you for taking the time to teach us! I’m having trouble getting this to work. I have created the WebLed.html, however where do i place it ?
Hi Joseph,
WebLed.html is already “embedded” into Arduino sketch: have a look to bfill.emit_p(…), so you don’t need to manually create it.
bye
Ciao
grazie per la risposta.
Ho provato a “vedere” il codice HTML ricevuto dal browser proveniente da Arduino (giusto per intenderci con Firefox facendo strumenti/sviluppo web/sorgente pagina) ed ho notato una segnalazione sintattica su . Ho pensato di modificare il parametro di emit_p togliendo ed aggiungendo alla fine il tag . Cosa ne pensi?
Fabio
Scusa riformulo il messaggio sostituendo le parentesi angolari dei tag con parentesi quadre
Ciao
grazie per la risposta.
Ho provato a “vedere” il codice HTML ricevuto dal browser proveniente da Arduino (giusto per intenderci con Firefox facendo strumenti/sviluppo web/sorgente pagina) ed ho notato una segnalazione sintattica su [/form]. Ho pensato di modificare il parametro di emit_p togliendo ed aggiungendo alla fine il tag [/html]. Cosa ne pensi?
Fabio
Ciao Fabio
effettivamente c’è un refuso nel mio sketch… confermo che le tue modifiche sono corrette (togli il tag di chiusura form e aggiungi quello di chiusura html finale)
grazie della segnalazione!
Hello, and thank for theses interesting tutorials. If I want to drive 2 led in place of one ; I assume that I have to create new variables to store StatusLabel and ButtonLabel and that I’ve also another line to create in the bfill….. section to have another button. What I do not understand is how the parameters StatusLabel and ButtonLabel are passsed dynamically to the HTML code ? Usins the $S variable I assume but not sur hox it works . Thank in advance for the reply .
Hi Christophe,
I’ve just published a blogpost about driving 2 leds 😉
hi
First of all thank you for 28j60 and ethercard tutorial.
Now,I have some questions, hope you can help me .
1.
I want to make a can control 9 LED webpage, even can control more LED.
The webpage form you webled’s example,But,when I made 9 button webpage,the Browser cannot connect to Arduino’s websever.However,8 button webpage had not this problem.
2.
I think the example HTML FORM may have a little problem,because,my I.E. Browser where I click on the button,noting happen.But when I used the Google Chrome,the button can work.
3.
I hope ,there is more your tutorial you can teach us. EtherCard Library has many function that I don’t know how use them.
thank you very much!
感谢!
Hi Raphael,
1. maybe your html code is bigger than the buffer (700bytes), you can try to increase buffer size
2. yes, I’ve just fixed the code on Github, please try again with the new version and let me know if it works with IE too
3. wait a few minutes, a new tutorial is coming 😉
Ciao,
complimenti per il tutorial!
Ho notato che è possibile inviare al browser un solo pacchetto per volta, quindi è praticamente impossibile inviare una pagina piu grande di 1500Byte?
Nel file tcpip.cpp alla riga 622 si trova:
// Comment out to enable large files, e.g. mp3 streams to be downloaded
// tcp_client_statete = 4;
Potrebbe essere un modo per risolvere il problema?
Grazie
Ciao Salvo
quello che evidenzi è proprio il limite maggiore della libreria… so che stanno rivedendo tutto il sistema di gestione dei pacchetti proprio per consentire l’invio di pacchetti di maggiori dimensioni: non ho mai provato a decommentare quella riga, fammi sapere se funziona!
Ciao Francesco,
sto preparando un paio di esempi per concludere il tutorial…
bye
Ciao Luca e complimenti per i tutorial, ho utilizzato per pasatempo il tuo time ntp con la schedina ethernet che monta il chip enc28j60, funziona ma avrei questa necessità:
ricevere il tempo dal web senza premere il tasto n in quanto nella mia applicazione non vengono usate le seriali della scheda.
ciao e grazie 1000
Ciao Claudio,
puoi tranquillamente chiamare il metodo ether.ntpRequest(ntpServer, srcPort); per richiedere l’orario in qualsiasi punto del loop, ad esempio ogni tot secondi utilizzando la funzione millis().
Ciao e grazie per la risposta, il metodo
ether.ntpRequest(ntpServer, srcPort); ho provato ad utilizzarlo eliminando i controlli della linea seriale dal loop del tuo prezioso esempio ma non ricevo nulla rimane sempre in attesa, mentre se inserisco il controllo con la seriale tutto funziona come deve che posso fare?
scusami per il continuo disturbo ma sta diventando una ossessione di seguito ti riporto la modifica del tuo file(che così com’è non funziona proponendo solamente la scritta NTP request sent ad ogni secondo.
grazie ancora Claudio
void loop() {
time= millis();
ether.packetLoop(ether.packetReceive());
if(requestSent && ether.ntpProcessAnswer(&timeStamp, srcPort)) {
Serial.println(“NTP answer received”);
Serial.println();
Serial.print(“Timestamp: “);
Serial.println(timeStamp);
Serial.println();
printDate(timeStamp + 3600 * TIME_ZONE);
requestSent = false;
}
if(time 0) {
// int incomingByte = Serial.read();
//if(incomingByte == ‘n’) {
ether.ntpRequest(ntpServer, srcPort);
Serial.println(“NTP request sent”);
delay(2000);
requestSent = true;
}
// }
}
Ciao Claudio
non mi è molto chiara la riga
if(time 0)
…se vuoi ad es. eseguire ogni 10 secondi la richiesta dell’ora dovrai fare qualcosa tipo:
actualTime = millis();
if(actualTime > previousTime + 10000) {
previousTime = actualTime;
ether.ntpRequest(ntpServer, srcPort);
requestSent = true;
}
Ciao Luca
l’esempio che ti ho inviato l’ho copiato male , la riga if(time 0) è –> if(time )…ecc ecc
ho tuttavia copiato di sana painta il tuo suggerimento ma il programma si ferma sempre su questo messaggio
“NTP request sent”
se invece invio un qualunque carattere con la porta USB (tuo esempio originale) l’ora la leggo correttamente.
Non è per caso che il parametro srcPort deve contenere qualche dato=? non capisco più nulla…..cioa scusa per il continuo disturbo…Claudio
ciao Claudio,
ecco un esempio che richiede l’ora ogni 10 secondi (modificabile cambiando la costante INTERVAL):
https://github.com/lucadentella/enc28j60_tutorial/tree/master/_13a_NTP
Hello luca,
I received today my ENC28J60 module.
I downloaded your sketches and I have to see these are very helpful.
I want to know how do you connect your ENC28J60 on Arduino.
I followed this guide
http://d.pr/i/hN5Y
but I see you connect an LED on digital pin 2.
Is my connection wrong?
Thank you
Hi John,
your connection is fine: I connected also a LED as this example is about turning a led ON/OFF using a webpage: you don’t need it for “basic” ethernet use.
Hello,
thanks for your reply.
So the INT pin on ENC28J60 is optional?
Should I have it connected with Arduino digital pin 2 or not?
Thank you.
Hi John,
the INT (= interrupt) pin is not used by Ethercard library
bye
Hi, the web page in the code can only be accessed from my home network. What will i have to do to access remotely? Thanks
Hi Sanket,
you have to configure, on your router, a “NAT” rule to route incoming connections on port 80 to Arduino’s internal IP… so you should be able to connect to your Arduino using your public IP. If you prefer a DNS name, you can use a dynamic DNS service like the one described here.
Hi, Thanks a lot for your reply. Also one more question, how do i connect the LED to my Arduino?
The Anode to one digital pin and the Cathode to ground via a resistor….right??
exactly!
ok thanks a lot mate!! cheers! 🙂
Ciao Luca,
complimenti per i tutorial, sono davvero utili.
Io sto cercando di acquisire su web server una serie di comandi, in particolare dopo aver premuto un tasto di tipo submit, viene inviata al web server la seguente stringa:
GET /?SGL=19.0&IST=0.5&END=INVIA HTTP/1.1
Per decodificare i campi e ottenere i valori di soglia e isteresi utilizzavo la classe String con funzioni come indexOf etc..
Con l’enc28j60 ho un buffer e non riesco a convertirlo in una String, perchè sebbene nel buffer ho i dati, la String rimane inesorabilmente vuota ???
Anche la funzione EtherCard::findKeyVal (const char *str,char *strbuf, byte maxlen,const char *key) non trova i le key SGL e IST che mi servono.
Hai qualche consiglio per risolvere questo problema?
Grazie
Dal tuo esempio in uno dei commenti:
char returnBuffer[10];
ether.findKeyVal((char *)Ethernet::buffer + pos, returnBuffer, 10, “status”);
La funzione non trova alcuna KEY, penso perchè lo spazio dopo il GET ferma la ricerca.
Se si aggiunge un offset di 4 al primo parametro, tutto funziona correttamente.
ether.findKeyVal(((char *)Ethernet::buffer + pos) + 4, returnBuffer, 10, “status”);
Spero possa essere utile a qualcuno. 🙂
grazie dell’aggiornamento Matteo!
hi luca, i have got a value stored as ‘double’ (double precision type)..What should i use instead of $S in html code to display in a local network using arduino webserver code??
Hi Altis, the library hasn’t a “native” function to print double values: you need to convert the value into string (using dtostrf) and then print the resulting string. In my code I’m doing the same for float values.
Ciao luca, ancora complimenti per i tuoi tutorial.
Ho notato un problemino, almeno sui miei pc.
Ho provato il webserver con 2 led e nessun problema nè con Chrome nè con IE. Il tutorial con un solo led invece funziona su Chrome ma NON su IE. Ho provato su un WinXP e su un Win7. Su entrambe l’esempio a 1 led visualizza testo e button ma il bottone sembra non spedire nulla al webserver.
Grazie per l’attenzione, igor
Non riesce a spegnersi. Riceve solo il comando ON ma non l’OFF. Come mai?
Ciao Matteo,
quando clicchi sul pulsante “OFF” cosa viene visualizzato nella barra degli indirizzi del browser?
il browser continua a caricare e non compare niente. Nel serial monitor di arduino compare la scritta del comando ON ma appena clicco su OFF il serial monitor non scrive niente e il led non si spegne!!!
veramente strano… che browser stai usando?
firefox
Hi Luca,
if i put a dc motor instead of led, How do i check motor really work ? can i take feedback from arduino? if yes how?
Please help me
Tank you
Hi Ali
you need “something” that can detect if the motor is moving or not and report the info to Arduino. For example a current sensor (that measures if the motor is consuming energy) or an encoder (that “counts” motor rotations)…
Hi Luca,
This is my university project and ı have to use button or relay to take 1 byte data from arduino and print this data to website.In my opinion, to do this i can use extra pin for button or relay. How i do print this daha to website?
Best regard
Ali, a relay is very different to a button: if you need to display on a website the status of a button (pressed / not pressed) you can follow this example: read the button with an input PIN and create a simple HTML page with the read value.
try it which you said but ı can’t do it. Please, can you send me a basic code for this, print button label(pressed/not pressed) on a website
Hello Luca, your tutorials are great!
the think is that this one works but only in my house, if i try to acces in other network nothing happens, how can i use this over the internet?
Thanks in advance.
Daniel.
Hi Daniel,
you have to configure your router to “NAT” the incoming connections on port 80 to the Arduino’s internal IP. Then connect to your public IP and you should be able to reach the webpage published by Arduino.
Ciao Luca, volevo sapere se al tuo progetto si puo associare un pulsante analogico, che funzioni assiame al pulsante web?
Io ci ho provato ma non riesco farli collaborare !
Daniele,
che indendi per “pulsante analogico”? Hai visto l’esempio 8 che mostra come gestire più pulsanti?
Fantastico tutorial!!
Thank you for sharing.
Sono stati utilizzati tutti gli aggettivi e anche in diverse lingue per farti i complimenti per il tutorial.
Ho qualche difficoltà di comprendere la parte html in particolare l’uso del segnaposto $S sebbene abbia letto con molta attenzione la spiegazione mi manca qualcosa ancora. $S è come se fosse una variabile? Tu scrivi “segnaposto $S è possibile indicare al metodo emit_p di inserire, al posto di tali segnaposto, i valori delle variabili indicate di seguito” significa che $S vale cosa?
Grazie Alessandro
Ciao Alessandro
$S viene sostituita dal valore della variabile dopo la virgola:
esempio se scrivo (“Ciao $S”, nome) e la variabile “nome” è una stringa che contiene “Alessandro” Arduino invierà la stringa “Ciao Alessandro”.
hii
i want to control led by using an android app in place of a web page…please help me how can i do that…
Hi! The easiest way is to develop ad Android app that “emulates” a web browser… are you able to develop simple android apps?
hello sir…
thanx for ur reply..;)
yes sir i am able to make simple android apps but an app for this purpose seems a little tricky…actually sir i am buliding a home automation system controlled through android app over internet. I have an enc28j60 module and arduino uno.I need an android app and i need to make it work over the internet not only a LAN…..please help….
thanxx…:)
yes sir….i have made an android app using webview….thankuu so much for your help…:)
sir one thing more i wanna ask..is it possible to send data from arduino to firebase(it is a free webserver)…www.firebase.com
Hi! I found this tutorial…
Hi,Luca
Can you give me code of Arduino and page HTML(Webled)?
because I don’t complete project when I add
bfill.emit_p(PSTR(… is te same of picture
thank you somuch!
Hi, you can download the full sketch from Github.
Ciao Luca, complimenti e grazie per i tuoi fantastici tutorial.
Ho una domanda, questo sketch è compatibile con Arduino Compatible Nano ?
Grazie
Ciao Paolo, direi di sì… vedo però che esistono due modelli di Arduino Nano: sicuramente funziona con quello con chip ATMega328.
ciao Luca,
tutorial interessanti, complimenti!
Volevo chiederti se con l’enc28j60 su può usare il DHCP.
Sto lavorando a un progetto che usa un microcontrollore della Texas in un ambiente di programmazione simile a quello di arduino. Volevo aggiungere l’ethernet. Ho trovato una libreria e tutto funziona con l’IP fisso ma mi servirebbe uno spunto per il DHCP.
Grazie
Ciao Davide
assolutamente sì, tieni conto che l’enc28j60 fa solo la parte ethernet, quindi tutti i protocolli (compreso DHCP) vanno implementati via software… prova a vedere come funziona la libreria che uso con Arduino, qui il mio tutorial che parla di DHCP.
Buon pomeriggio. A differenza della formazione. Cercando di cavarsela con l’aiuto della vostra esempi aria condizionata regolabile. aggiunto al codice. ma io appende pagina, in quello che potrebbe essere il problema?
http://arduino.ru/forum/programmirovanie/upravlenie-konditsionerom-cherez-internet-ir-led-enc28j60#comment-73017
ma io appende pagina, in quello che potrebbe essere il problema?
Hi Artem: the automatic translator didn’t a great job… I can’t understand what you wrote. Could you please post in English?
hello. I used your example number 7, but with the addition of their code. I have a task when an ir led high signal on the air conditioner to switch. But when you add my code web page hangs. what could be the problem?
Can you look at my code? and how or where you send it
Hi Artem, the problem in your sketch may be the huge amount of RAM memory you’re allocating: two images (288 bytes each) and one big (1000 bytes) buffer for enc28j60 operation… Arduino Uno has 2Kb of SRAM so you probably reached the memory limit and the microcontroller hangs. Try reducing the buffer size or remove the embedded images.
thanks, you were right about ram. 2 used arduino, now everything works. Thanks for the great examples.
Ciao Luca, ho fatto tutto il procedimento che hai fatto te ma con esito ne negativo ne positivo poichè il led rimane sempre acceso, cliccando su on o off il led aumenta o diminuisce di luminosità quindi è per forza necessaria una basetta dove collegare led e cavi?
Per curiosità nel video si vede chiaramente che un filo è collegato al pin 2 ma l’ altro filo dove è collegato?
Grazie in anticipo.
Ciao Luca, innanzitutto complimenti per la guida.
Ho però un problema..carico lo sketch e collego il led ad arduino con una tensione sul pin 2 e con il lato del cavo corto al gnd (accanto al pin 13), apro la pagina web, clicco su off e il led rimane comunque accesso.. Diminuisce solo la luminosità.. Cliccando viceversa su on la luminosità aumenta.. Il problema è dovuto dal fatto che non ho la basetta bianca come nel video?
P.s.:a dove si collega il secondo cavo del video? (Non quello che va al pin 2 ma l’altro)
Grazie e alla prossima
ciao, ho seguito tutti i tuoi tutorial, in quanto sono molto completi e il n 7 mi interessa molto, ma quando carico questo skech mi da errore la quarta riga co scritto: byte Ethernet::buffer[700]; potrebbe essere causato dall’ultimo aggiornamento dell ide?? GRAZIE
ciao, che errore ti da?
Thanks a lot for this example! 😉
Ciao Luca,
volevo chiederti se fosse possibile evitare di inserire il contenuto della pagina web nello sketch di arduino in modo da risparmiare memoria. Vorrei realizzare delle pagine html da cui comandare arduino e caricarle su un host. Spero sia stato chiaro.
Ps.:grazie per le tue utili guide
ciao Samuel
hai visto il mio ultimo tutorial? Le pagine (incluse immagini…) sono su una schedina SD. Altrimenti sì, potresti ospitare le pagine su un sito e chiamare Arduino via AJAX.
Hi Luca,
Can you please help me how to add, second web button for controlling second relay?
Hi, tutorial nr8 explains how to control two (or more…) leds/relays
hi sir, thanks for your tutorial 😀
where can i write this source code below :
if(strstr((char *)Ethernet::buffer + pos, “GET /?status=ON”) != 0) {
Serial.println(“Received ON command”);
ledStatus = true;
}
because i write in the setup(), there is an error compiling
thanks sir
Hi! If you browse my Github repository, you can download the full sketch
thanks Luca 🙂
Thanks for your tutorial. I have a question about this tutorial, does that web created by arduino? How to visit it? In your video, you just visit the IP address to visit the website, but I can’t see the web with my code as same as yours,why?
Hi! Yes the webpage is served by Arduino, just connect to the Arduino’s IP address and you should be able to get it.
Ciao luca, molto interessanti i tuoi tutorial, volevo sapere se fosse possibile creare una pagina web esterna ad arduino, e inviare i comandi ad arduino tramite quella web page, perche vorrei creare una pagina web un po’ complessa con immagini e quant’altro e quindi arduino rsulterebbe troppo lento.
Grazie in anticipo per la tua risposta
Ciao Samuele, sicuramente sì! Guarda i miei esempi successivi dove ad esempio recupero tutte le risorse esternamente… puoi fare una pagina i cui link puntano all’IP di Arduino mentre tutta la grafica rimane sul server esterno.
Great Tutorial sir!
i have a question, how to change static IP from web page?
Hi! You have to prepare a webpage with a form (to enter the new IP), parse the response and configure the IP as in the setup()
here is my form. but i don’t know to parse the response.
bfill.emit_p(PSTR(“HTTP/1.0 200 OK\r\n”
“Content-Type: text/html\r\nPragma: no-cache\r\n\r\n”
“Ubah IP Static”
“IP Address . . . ”
“SubnetMask . . . ”
“IP Gateway . . . ”
“IP DNS . . . ”
“Kembali ke halaman awal: ”
“”
));
whooops sorry. some of my code missing when i’m trying to post in here
Buon giorno Luca, sono agli albori della sperimentazione, e vorrei usare questo esempio abbinato ad un pulsante collegato all’arduino, che replicasse le stesse azioni fatte dal pulsante web ma inserendo la routine del pulsante il web non viene aggiornato con evidenti incongruenze, operando ognuno per proprio conto senza aggiornare la situazione sul web…
Chiedo un piccolo aiuto. Grazie. Franco
Luca sei un genio!!!
Sto realizzando uno sketch ad hoc basandomi su uno preesistente simile a quello descritto qui (ma senza SD e con un pulsante che cambia colore in funzione dello stato).
Studiando quello e altri sketch esempio di Ethercard, ho aggiunto un secondo pulsante che esegue il WoL al MAC del computer che accendo conl’Arduino (funziona) e il ping all’indirizzo IP del suddetto PC (funziona).
Quello che manca è colorare il pulsante aggiunto in funzione dell’esito del ping.
Vorrei usare lo stesso sistema del primo pulsante ma non ci arrivo a capire dove $S è legata a statusLabel o buttonLabel. Questo per creare un secondo segnaposto e relativo xxLabel.
Spero di essere stato chiaro nel formulare la domanda
ciao Maurizio e grazie. La funzione b_fill.emit() è posizionale, quindi il primo $S si riferisce alla prima variabile indicata, il secondo $S alla seconda variabile e così via…
Hello Luca. very grateful for the explanations on their page, they have helped me with my project. I’ve been stuck in one part. From this same post, I wanted to add more html lines copying the exact same code, in order to have more buttons and control more outputs. but there comes a time that if I add one more line the page will not load. I have been told that I should send the html code by packages and not all together because it has a limit. how I do this?
my code is:
[…]
Sorry. was an error when i want to paste the code here.. here is it: https://www.codepile.net/raw/b7NWxBQw.js
Hi Andy, please give a look to this tutorial, it explains how to split the response in more packets to solve your problem
Thanks you. im studing this. one more question, it is possible to send from another arduino+enc28j60 to the arduino1+enc28j60 a “http://192.168.0.50/?status=ON”?
Basically, simulating as if instead of me having selected the power button from the web page, that request is sent by another arduino. in order to make an arduino turn on the led, sending the request to another arduino through the website on a local network. it’s possible?