loading
Aim:

Switch relays from the ethernet or the internet, using your mobile, tablet or computer with a nice graphical user interface.

Update V4.06
Please read the below steps to Step 2 if you are viewing this article for the first time.
Please go to step 3 for the latest revision which is V4.06
A user modified version with logon option is placed in step 5 for easy download.

Material:

    * Arduino MEGA 2560
    * Arduino Ethernet Shield
    * Relay board
    * RJ45 cable


Tools:

    * Arduino Software version 1.0.1 (downloadable from Arduino Website )
    * A / B USB cable


Infrastructure:

    * Internet access with fixed IP for Arduino
    * Access to your router to share the port for internet access
    * Testing devices - your pc, mobile etc


Disclaimer:

    * This project was tested with iPhone 3GS, iPad 2 and MacBook Pro running Safari and PC running Safari, Firefox, Opera and IE.
    * This project was created on October 2012 with the mentioned material.
    * Binary sketch size: 22,322 bytes (of a 258,048 byte maximum).
    * This sketch does not offer any sort of authentification, therefore if required to be used from outside the network or from the internet, I suggest to configure your network to connect trough VPN. Nowadays many routers and smartphones support VPN.



Step 1: Ethernet Switching - with Arduino - Description

Description:

    * With this project, I had not included any images, or links to images from the internet. It only make use of CSS3 and HTML5.
    * The simulated LEDs are created from CSS3 code.
    * Some browsers does not make full use of CSS3 and HTML5. Thus I suggest using Safari.
<p>Hello and thank you for this great project.</p><p>In my case I had to edit it and remove the OFF buttons. I renamed the ON button to ON/OFF button and I added a delay of 500ms. Thus by pressing the button the relay stays on for 500ms. </p><p>The problem I am facing is with the html LED (Green/Black). I want the LED display to be Black (off) and turn to ON once the button is pressed once. Eventhough the replay will turn off again due to the 500ms delay, I want the LED to stay ON (Green) until the next time the button is pressed.</p><p>Could anyone help me editing the coding here to get the LEDs turn ON and OFF based on the press of the button and not the actual relay status.</p><p>Thanking you in advance</p><p>Lambros</p>
<p>Why can't I even verify the sketch? I'm getting memory errors..</p>
<p>#include &lt;Ethernet.h&gt;</p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;EEPROM.h&gt;</p><p>////////////////////////////////////////////////////////////////////////</p><p>//CONFIGURATION</p><p>////////////////////////////////////////////////////////////////////////</p><p>//IP manual settings</p><p>byte ip[] = {192, 168, 137, 100 }; //Manual setup only</p><p>byte gateway[] = {192, 168, 1, 1 }; //Manual setup only</p><p>byte subnet[] = {255, 255, 255, 0 }; //Manual setup only</p><p>byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };</p><p>//Ethernet Port</p><p>EthernetServer server = EthernetServer(80); //default html port 80</p><p>//The number of outputs going to be switched.</p><p>int outputQuantity = 16; //should not exceed 10 </p><p>//Invert the output of the leds</p><p>boolean outputInverted = false; //true or false</p><p>// This is done in case the relay board triggers the relay on negative, rather then on positive supply</p><p>//Html page refresh</p><p>int refreshPage = 15; //default is 10sec. </p><p>//Beware that if you make it refresh too fast, the page could become inacessable.</p><p>//Display or hide the &quot;Switch on all Pins&quot; buttons at the bottom of page</p><p>int switchOnAllPinsButton = false; //true or false</p><p>int outputAddress[] = { 22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37}; //Allocate 10 spaces and name the output pin address.</p><p>String buttonText[16] = {</p><p> &quot;01. Right Lamp&quot;,&quot;02. Left Lamp&quot;,&quot;03. Bedroom&quot;,&quot;04. Kitchen&quot;,&quot;05. Water Heater&quot;,&quot;06. Gate&quot;,&quot;07. Toilet&quot;,&quot;08. Main Heater&quot;,&quot;09. Roof Light&quot;,&quot;10. Basement&quot;,&quot;11. Test&quot;,&quot;12. TEST2&quot;,&quot;13. TEST3&quot;,&quot;14. TEST4&quot;,&quot;15. TEST5&quot;,&quot;16. TEST6&quot;};</p><p>// Set the output to retain the last status after power recycle.</p><p>int retainOutputStatus[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};//1-retain the last status. 0-will be off after power cut.</p><p>////////////////////////////////////////////////////////////////////////</p><p>//VARIABLES DECLARATION</p><p>////////////////////////////////////////////////////////////////////////</p><p>int outp = 0;</p><p>boolean printLastCommandOnce = false;</p><p>boolean printButtonMenuOnce = false;</p><p>boolean initialPrint = true;</p><p>String allOn = &quot;&quot;;</p><p>String allOff = &quot;&quot;;</p><p>boolean reading = false;</p><p>boolean outputStatus[16]; //Create a boolean array for the maximum ammount.</p><p>String rev = &quot;V4.06&quot;;</p><p>unsigned long timeConnectedAt;</p><p>boolean writeToEeprom = false;</p><p>/////////////////////////////////////////////////</p><p>// Temperature Related Reading</p><p>const int tempInPin = A1;</p><p>int tempInValue = 0; //temperature read</p><p>int tempScaleOutValue = 0; //temperature formatted</p><p>int tempOutValue = 0; //temperature formatted</p><p>float tempOutDeg = 0.0;</p><p>////////////////////////////////////////////////////////////////////////</p><p>//RUN ONCE</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Beginning of Program</p><p>void setup(){</p><p> Serial.begin(9600);</p><p> initEepromValues();</p><p> readEepromValues();</p><p> //Set pins as Outputs </p><p> boolean currentState = false;</p><p> int var;</p><p> for (int i = 0; i &lt; outputQuantity; i++){</p><p> pinMode(outputAddress[i], OUTPUT); </p><p> var = outputAddress[i];</p><p> //Switch all outputs to either on or off on Startup</p><p> if(outputInverted == true) {</p><p> //digitalWrite(outputAddress[var], HIGH);</p><p> if(outputStatus[i] == 0){currentState = true;}else{currentState = false;} //check outputStatus if off, switch output accordingly</p><p> digitalWrite(var, currentState);</p><p> }</p><p> else{</p><p> //digitalWrite(outputAddress[var], LOW);</p><p> if(outputStatus[i] == 0){currentState = false;}else{currentState = true;}//check outputStatus if off, switch output accordingly</p><p> digitalWrite(var, currentState);</p><p> }</p><p> }</p><p> //Setting up the IP address. Comment out the one you dont need.</p><p> //Ethernet.begin(mac); //for DHCP address. (Address will be printed to serial.)</p><p> Ethernet.begin(mac, ip, gateway, subnet); //for manual setup. (Address is the one configured above.)</p><p> server.begin();</p><p> Serial.print(&quot;Server started at &quot;);</p><p> Serial.println(Ethernet.localIP());</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//LOOP</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Run once</p><p>void loop(){</p><p> //Read Temperature Sensor</p><p> tempInValue = analogRead(tempInPin); </p><p> // Connecting a 10K3 Thermistor to the Arduino Input</p><p> // +5V �&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;[10Kohms]&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;[Thermistor]&mdash;&mdash;� 0V</p><p> // To Arduino IP �&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;|</p><p> tempScaleOutValue = map(tempInValue, 0, 1023, 1023, 0); //Arduino value and NTC of the 10K3 Thermistor</p><p> tempOutValue = map(tempScaleOutValue, 130, 870, -170, 730); //range of Arduino Value compared with Temperature</p><p> tempOutValue = tempOutValue -45; //Adjustments</p><p> tempOutDeg = tempOutValue / 10.0;</p><p> checkForClient();</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//checkForClient Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//</p><p>void checkForClient(){</p><p> EthernetClient client = server.available();</p><p> if (client) {</p><p> boolean currentLineIsBlank = true;</p><p> boolean sentHeader = false;</p><p> int temp,temp1;</p><p> while (client.connected()) {</p><p> if (client.available()) {</p><p> char c = client.read();</p><p> if(c == '*'){</p><p> printHtmlHeader(client); //call for html header and css</p><p> printLoginTitle(client);</p><p> printHtmlFooter(client);</p><p> break;</p><p> }</p><p> if(!sentHeader){</p><p> printHtmlHeader(client); //call for html header and css</p><p> printHtmlButtonTitle(client); //print the button title</p><p> sentHeader = true;</p><p> }</p><p> if(reading &amp;&amp; c == ' '){</p><p> reading = false;</p><p> }</p><p> if(c == '?') {</p><p> reading = true; //found the ?, begin reading the info</p><p> }</p><p> if(reading){</p><p> //if user input is H set output to 1</p><p> if(c == 'H') {</p><p> outp = 1;</p><p> }</p><p> if(c == 'L') {</p><p> outp = 0;</p><p> }</p><p>// Serial.println(c); //print the value of c to serial communication</p><p>//---------------------------------------------------------------------------------------------</p><p>// ? H 1 0</p><p>// ^ ^ ^ ^</p><p>// | | | |____________read 4 ( 10,11,12,13....)</p><p>// | | |______________read 3 ( 1....9)</p><p>// | |________________read 2 if user input is H set output to L</p><p>// |__________________read 1</p><p>//---------------------------------------------------------------------------------------------</p><p> if( c == '1'){</p><p> char c = client.read();</p><p> switch (c) {</p><p> case '0':</p><p> triggerPin(outputAddress[10], client, outp);</p><p> break; </p><p> case '1':</p><p> triggerPin(outputAddress[11], client, outp);</p><p> break; </p><p> case '2':</p><p> triggerPin(outputAddress[12], client, outp);</p><p> break;</p><p> case '3':</p><p> triggerPin(outputAddress[13], client, outp);</p><p> break;</p><p> case '4':</p><p> triggerPin(outputAddress[14], client, outp);</p><p> break;</p><p> case '5':</p><p> triggerPin(outputAddress[15], client, outp);</p><p> break;</p><p> default:</p><p> char c = client.read();</p><p> triggerPin(outputAddress[1], client, outp);</p><p> }</p><p> }</p><p> else {</p><p> switch (c) {</p><p> case '0':</p><p> triggerPin(outputAddress[0], client, outp);</p><p> break; </p><p> // case '1':</p><p> // triggerPin(outputAddress[1], client, outp);</p><p> // break; </p><p> case '2':</p><p> triggerPin(outputAddress[2], client, outp);</p><p> break;</p><p> case '3':</p><p> //add code here to trigger on 3</p><p> triggerPin(outputAddress[3], client, outp);</p><p> break;</p><p> case '4':</p><p> //add code here to trigger on 4</p><p> triggerPin(outputAddress[4], client, outp);</p><p> break;</p><p> case '5':</p><p> //add code here to trigger on 5</p><p> triggerPin(outputAddress[5], client, outp);</p><p> //printHtml(client);</p><p> break;</p><p> case '6':</p><p> //add code here to trigger on 6</p><p> triggerPin(outputAddress[6], client, outp);</p><p> break;</p><p> case '7':</p><p> //add code here to trigger on 7</p><p> triggerPin(outputAddress[7], client, outp);</p><p> break;</p><p> case '8':</p><p> //add code here to trigger on 8</p><p> triggerPin(outputAddress[8], client, outp);</p><p> break;</p><p> case '9':</p><p> //add code here to trigger on 9</p><p> triggerPin(outputAddress[9], client, outp);</p><p> break;</p><p> } //end of switch case</p><p> } </p><p> }//end of switch switch the relevant output </p><p> //if user input was blank</p><p> if (c == '\n' &amp;&amp; currentLineIsBlank){</p><p> printLastCommandOnce = true;</p><p> printButtonMenuOnce = true;</p><p> triggerPin(777, client, outp); //Call to read input and print menu. 777 is used not to update any outputs</p><p> break;</p><p> }</p><p> }</p><p> }</p><p> printHtmlFooter(client); //Prints the html footer</p><p> } </p><p> else{ </p><p> if (millis() &gt; (timeConnectedAt + 60000)){ </p><p> if (writeToEeprom == true){ </p><p> writeEepromValues(); //write to EEprom the current output statuses</p><p> Serial.println(&quot;No Clients for more then a minute - Writing statuses to Eeprom.&quot;);</p><p> writeToEeprom = false;</p><p> }</p><p> }</p><p> }</p><p>}// END</p><p>////////////////////////////////////////////////////////////////////////</p><p>//triggerPin Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//</p><p>void triggerPin(int pin, EthernetClient client, int outp){</p><p> if (pin != 777){ </p><p>// Serial.println(pin);</p><p> if(outp == 1) {</p><p> if (outputInverted ==false){ </p><p> digitalWrite(pin, HIGH);</p><p> } </p><p> else{</p><p> digitalWrite(pin, LOW);</p><p> }</p><p> }</p><p> if(outp == 0){</p><p> if (outputInverted ==false){ </p><p> digitalWrite(pin, LOW);</p><p> } </p><p> else{</p><p> digitalWrite(pin, HIGH);</p><p> }</p><p> }</p><p> }</p><p> //Refresh the reading of outputs</p><p> readOutputStatuses();</p><p> //Prints the buttons</p><p> if (printButtonMenuOnce == true){</p><p> printHtmlButtons(client);</p><p> printButtonMenuOnce = false;</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//printHtmlButtons Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//print the html buttons to switch on/off channels</p><p>void printHtmlButtons(EthernetClient client){</p><p> //Start to create the html table</p><p> client.println(&quot;&quot;);</p><p> //client.println(&quot;&lt;p&gt;&quot;);</p><p> client.println(&quot;&lt;FORM&gt;&quot;);</p><p> client.println(&quot;&lt;table border=\&quot;0\&quot; align=\&quot;center\&quot;&gt;&quot;);</p><p> //Printing the Temperature</p><p> client.print(&quot;&lt;tr&gt;\n&quot;); </p><p> client.print(&quot;&lt;td&gt;&lt;h4&gt;&quot;);</p><p> client.print(&quot;Temperature&quot;);</p><p> client.print(&quot;&lt;/h4&gt;&lt;/td&gt;\n&quot;);</p><p> client.print(&quot;&lt;td&gt;&lt;/td&gt;&quot;); </p><p> client.print(&quot;&lt;td&gt;&quot;);</p><p> client.print(&quot;&lt;h3&gt;&quot;);</p><p> client.print(tempOutDeg);</p><p> client.print(&quot; &deg;C&lt;/h3&gt;&lt;/td&gt;\n&quot;);</p><p> client.print(&quot;&lt;td&gt;&lt;/td&gt;&quot;);</p><p> client.print(&quot;&lt;/tr&gt;&quot;);</p><p> //Start printing button by button</p><p> for (int var = 0; var &lt; outputQuantity; var++) { </p><p> //set command for all on/off</p><p> allOn += &quot;H&quot;;</p><p> allOn += outputAddress[var];</p><p> allOff += &quot;L&quot;;</p><p> allOff += outputAddress[var];</p><p> //Print begining of row</p><p> client.print(&quot;&lt;tr&gt;\n&quot;); </p><p> //Prints the button Text</p><p> client.print(&quot;&lt;td&gt;&lt;h4&gt;&quot;);</p><p> client.print(buttonText[var]);</p><p> client.print(&quot;&lt;/h4&gt;&lt;/td&gt;\n&quot;);</p><p> //Prints the ON Buttons+++++++++++++++++++++++++++++++++++++++++++++++</p><p> client.print(&quot;&lt;td&gt;&quot;);</p><p> client.print(&quot;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;ON &quot;);</p><p> client.print(&quot;\&quot; onClick=\&quot;parent.location='/?H&quot;);</p><p> client.print(var);</p><p> client.print(&quot;'\&quot;&gt;&lt;/td&gt;\n&quot;);</p><p> //Prints the OFF Buttons ---------------------------------------------</p><p> client.print(&quot; &lt;td&gt;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;OFF&quot;);</p><p> client.print(&quot;\&quot; onClick=\&quot;parent.location='/?L&quot;);</p><p> client.print(var);</p><p> client.print(&quot;'\&quot;&gt;&lt;/td&gt;\n&quot;);</p><p> //Invert the LED display if output is inverted.</p><p> if (outputStatus[var] == true ){ //If Output is ON</p><p> if (outputInverted == false){ //and if output is not inverted </p><p> client.print(&quot; &lt;td&gt;&lt;div class='green-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;); //Print html for ON LED</p><p> }</p><p> else{ //else output is inverted then</p><p> client.print(&quot; &lt;td&gt;&lt;div class='black-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;); //Print html for OFF LED</p><p> }</p><p> }</p><p> else //If Output is Off</p><p> {</p><p> if (outputInverted == false){ //and if output is not inverted</p><p> client.print(&quot; &lt;td&gt;&lt;div class='black-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;); //Print html for OFF LED</p><p> }</p><p> else{ //else output is inverted then </p><p> client.print(&quot; &lt;td&gt;&lt;div class='green-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;); //Print html for ON LED </p><p> }</p><p> } </p><p> //Print end of row</p><p> client.print(&quot;&lt;/tr&gt;\n&quot;); </p><p> }</p><p> //Display or hide the Print all on Pins Button</p><p> if (switchOnAllPinsButton == true ){</p><p> //Prints the ON All Pins Button</p><p> client.print(&quot;&lt;tr&gt;\n&lt;td&gt;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;Switch ON All Pins&quot;);</p><p> client.print(&quot;\&quot; onClick=\&quot;parent.location='/?&quot;);</p><p> client.print(allOn);</p><p> client.print(&quot;'\&quot;&gt;&lt;/td&gt;\n&quot;);</p><p> //Prints the OFF All Pins Button </p><p> client.print(&quot;&lt;td&gt;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;Switch OFF All Pins&quot;);</p><p> client.print(&quot;\&quot; onClick=\&quot;parent.location='/?&quot;);</p><p> client.print(allOff);</p><p> client.print(&quot;'\&quot;&gt;&lt;/td&gt;\n&lt;td&gt;&lt;/td&gt;\n&lt;td&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&quot;);</p><p> }</p><p> //Closing the table and form</p><p> client.println(&quot;&lt;/table&gt;&quot;);</p><p> client.println(&quot;&lt;/FORM&gt;&quot;);</p><p> //client.println(&quot;&lt;/p&gt;&quot;); </p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//readOutputStatuses Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Reading the Output Statuses</p><p>void readOutputStatuses(){</p><p> for (int var = 0; var &lt; outputQuantity; var++) { </p><p> outputStatus[var] = digitalRead(outputAddress[var]);</p><p> //Serial.print(outputStatus[var]);</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//readEepromValues Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Read EEprom values and save to outputStatus</p><p>void readEepromValues(){</p><p> for (int adr = 0; adr &lt; outputQuantity; adr++) { </p><p> outputStatus[adr] = EEPROM.read(adr); </p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//writeEepromValues Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Write EEprom values</p><p>void writeEepromValues(){</p><p> for (int adr = 0; adr &lt; outputQuantity; adr++) { </p><p> EEPROM.write(adr, outputStatus[adr]);</p><p> }</p><p>} </p><p>////////////////////////////////////////////////////////////////////////</p><p>//initEepromValues Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Initialiaze EEprom values</p><p>//if eeprom values are not the correct format ie not euqual to 0 or 1 (thus greater then 1) initialize by putting 0</p><p>void initEepromValues(){</p><p> for (int adr = 0; adr &lt; outputQuantity; adr++){ </p><p> if (EEPROM.read(adr) &gt; 1){</p><p> EEPROM.write(adr, 0);</p><p> } </p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//htmlHeader Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html header</p><p> void printHtmlHeader(EthernetClient client){</p><p> // Serial.print(&quot;Serving html Headers at ms -&quot;);</p><p> timeConnectedAt = millis(); //Record the time when last page was served.</p><p> // Serial.print(timeConnectedAt); // Print time for debbugging purposes</p><p> writeToEeprom = true; // page loaded so set to action the write to eeprom</p><p> // send a standard http response header</p><p> client.println(&quot;HTTP/1.1 200 OK&quot;);</p><p> client.println(&quot;Content-Type: text/html&quot;);</p><p> client.println(&quot;Connnection: close&quot;);</p><p> client.println();</p><p> client.println(&quot;&lt;!DOCTYPE HTML&gt;&quot;);</p><p> client.println(&quot;&lt;head&gt;&quot;);</p><p> // add page title </p><p> client.println(&quot;&lt;title&gt;Ethernet Switching&lt;/title&gt;&quot;);</p><p> client.println(&quot;&lt;meta name=\&quot;description\&quot; content=\&quot;Ethernet Switching\&quot;/&gt;&quot;);</p><p> // add a meta refresh tag, so the browser pulls again every x seconds:</p><p> client.print(&quot;&lt;meta http-equiv=\&quot;refresh\&quot; content=\&quot;&quot;);</p><p> client.print(refreshPage);</p><p> client.println(&quot;; url=/\&quot;&gt;&quot;);</p><p> // add other browser configuration</p><p> client.println(&quot;&lt;meta name=\&quot;apple-mobile-web-app-capable\&quot; content=\&quot;yes\&quot;&gt;&quot;);</p><p> client.println(&quot;&lt;meta name=\&quot;apple-mobile-web-app-status-bar-style\&quot; content=\&quot;default\&quot;&gt;&quot;);</p><p> client.println(&quot;&lt;meta name=\&quot;viewport\&quot; content=\&quot;width=device-width, user-scalable=no\&quot;&gt;&quot;); </p><p> //inserting the styles data, usually found in CSS files.</p><p> client.println(&quot;&lt;style type=\&quot;text/css\&quot;&gt;&quot;);</p><p> client.println(&quot;&quot;);</p><p> //This will set how the page will look graphically</p><p> client.println(&quot;html { height:100%; }&quot;); </p><p> client.println(&quot; body {&quot;);</p><p> client.println(&quot; height: 100%;&quot;);</p><p> client.println(&quot; margin: 0;&quot;);</p><p> client.println(&quot; font-family: helvetica, sans-serif;&quot;);</p><p> client.println(&quot; -webkit-text-size-adjust: none;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;body {&quot;);</p><p> client.println(&quot; -webkit-background-size: 100% 21px;&quot;);</p><p> client.println(&quot; background-color: #c5ccd3;&quot;);</p><p> client.println(&quot; background-image:&quot;);</p><p> client.println(&quot; -webkit-gradient(linear, left top, right top,&quot;);</p><p> client.println(&quot; color-stop(.75, transparent),&quot;);</p><p> client.println(&quot; color-stop(.75, rgba(255,255,255,.1)) );&quot;);</p><p> client.println(&quot; -webkit-background-size: 7px;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.view {&quot;);</p><p> client.println(&quot; min-height: 100%;&quot;);</p><p> client.println(&quot; overflow: auto;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.header-wrapper {&quot;);</p><p> client.println(&quot; height: 44px;&quot;);</p><p> client.println(&quot; font-weight: bold;&quot;);</p><p> client.println(&quot; text-shadow: rgba(0,0,0,0.7) 0 -1px 0;&quot;);</p><p> client.println(&quot; border-top: solid 1px rgba(255,255,255,0.6);&quot;);</p><p> client.println(&quot; border-bottom: solid 1px rgba(0,0,0,0.6);&quot;);</p><p> client.println(&quot; color: #fff;&quot;);</p><p> client.println(&quot; background-color: #8195af;&quot;);</p><p> client.println(&quot; background-image:&quot;);</p><p> client.println(&quot; -webkit-gradient(linear, left top, left bottom,&quot;);</p><p> client.println(&quot; from(rgba(255,255,255,.4)),&quot;);</p><p> client.println(&quot; to(rgba(255,255,255,.05)) ),&quot;);</p><p> client.println(&quot; -webkit-gradient(linear, left top, left bottom,&quot;);</p><p> client.println(&quot; from(transparent),&quot;);</p><p> client.println(&quot; to(rgba(0,0,64,.1)) );&quot;);</p><p> client.println(&quot; background-repeat: no-repeat;&quot;);</p><p> client.println(&quot; background-position: top left, bottom left;&quot;);</p><p> client.println(&quot; -webkit-background-size: 100% 21px, 100% 22px;&quot;);</p><p> client.println(&quot; -webkit-box-sizing: border-box;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.header-wrapper h1 {&quot;);</p><p> client.println(&quot; text-align: center;&quot;);</p><p> client.println(&quot; font-size: 20px;&quot;);</p><p> client.println(&quot; line-height: 44px;&quot;);</p><p> client.println(&quot; margin: 0;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.group-wrapper {&quot;);</p><p> client.println(&quot; margin: 9px;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.group-wrapper h2 {&quot;);</p><p> client.println(&quot; color: #4c566c;&quot;);</p><p> client.println(&quot; font-size: 17px;&quot;);</p><p> client.println(&quot; line-height: 0.8;&quot;);</p><p> client.println(&quot; font-weight: bold;&quot;);</p><p> client.println(&quot; text-shadow: #fff 0 1px 0;&quot;);</p><p> client.println(&quot; margin: 20px 10px 12px;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.group-wrapper h3 {&quot;);</p><p> client.println(&quot; color: #4c566c;&quot;);</p><p> client.println(&quot; font-size: 12px;&quot;);</p><p> client.println(&quot; line-height: 1;&quot;);</p><p> client.println(&quot; font-weight: bold;&quot;);</p><p> client.println(&quot; text-shadow: #fff 0 1px 0;&quot;);</p><p> client.println(&quot; margin: 20px 10px 12px;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> client.println(&quot;.group-wrapper h4 {&quot;); //Text for description</p><p> client.println(&quot; color: #212121;&quot;);</p><p> client.println(&quot; font-size: 14px;&quot;);</p><p> client.println(&quot; line-height: 1;&quot;);</p><p> client.println(&quot; font-weight: bold;&quot;);</p><p> client.println(&quot; text-shadow: #aaa 1px 1px 3px;&quot;);</p><p> client.println(&quot; margin: 5px 5px 5px;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;); </p><p> client.println(&quot;.group-wrapper table {&quot;);</p><p> client.println(&quot; background-color: #fff;&quot;);</p><p> client.println(&quot; -webkit-border-radius: 10px;&quot;);</p><p> client.println(&quot; -moz-border-radius: 10px;&quot;);</p><p> client.println(&quot; -khtml-border-radius: 10px;&quot;);</p><p> client.println(&quot; border-radius: 10px;&quot;);</p><p> client.println(&quot; font-size: 17px;&quot;);</p><p> client.println(&quot; line-height: 20px;&quot;);</p><p> client.println(&quot; margin: 9px 0 20px;&quot;);</p><p> client.println(&quot; border: solid 1px #a9abae;&quot;);</p><p> client.println(&quot; padding: 11px 3px 12px 3px;&quot;);</p><p> client.println(&quot; margin-left:auto;&quot;);</p><p> client.println(&quot; margin-right:auto;&quot;);</p><p> client.println(&quot; -moz-transform :scale(1);&quot;); //Code for Mozilla Firefox</p><p> client.println(&quot; -moz-transform-origin: 0 0;&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> //how the green (ON) LED will look</p><p> client.println(&quot;.green-circle {&quot;);</p><p> client.println(&quot; display: block;&quot;);</p><p> client.println(&quot; height: 23px;&quot;);</p><p> client.println(&quot; width: 23px;&quot;);</p><p> client.println(&quot; background-color: #0f0;&quot;);</p><p> //client.println(&quot; background-color: rgba(60, 132, 198, 0.8);&quot;);</p><p> client.println(&quot; -moz-border-radius: 11px;&quot;);</p><p> client.println(&quot; -webkit-border-radius: 11px;&quot;);</p><p> client.println(&quot; -khtml-border-radius: 11px;&quot;);</p><p> client.println(&quot; border-radius: 11px;&quot;);</p><p> client.println(&quot; margin-left: 1px;&quot;);</p><p> client.println(&quot; background-image: -webkit-gradient(linear, 0% 0%, 0% 90%, from(rgba(46, 184, 0, 0.8)), to(rgba(148, 255, 112, .9)));@&quot;);</p><p> client.println(&quot; border: 2px solid #ccc;&quot;);</p><p> client.println(&quot; -webkit-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px;&quot;);</p><p> client.println(&quot; -moz-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;);</p><p> client.println(&quot; box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> //how the black (off)LED will look</p><p> client.println(&quot;.black-circle {&quot;);</p><p> client.println(&quot; display: block;&quot;);</p><p> client.println(&quot; height: 23px;&quot;);</p><p> client.println(&quot; width: 23px;&quot;);</p><p> client.println(&quot; background-color: #040;&quot;);</p><p> client.println(&quot; -moz-border-radius: 11px;&quot;);</p><p> client.println(&quot; -webkit-border-radius: 11px;&quot;);</p><p> client.println(&quot; -khtml-border-radius: 11px;&quot;);</p><p> client.println(&quot; border-radius: 11px;&quot;);</p><p> client.println(&quot; margin-left: 1px;&quot;);</p><p> client.println(&quot; -webkit-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px;&quot;);</p><p> client.println(&quot; -moz-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;); </p><p> client.println(&quot; box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> //this will add the glare to both of the LEDs</p><p> client.println(&quot; .glare {&quot;);</p><p> client.println(&quot; position: relative;&quot;);</p><p> client.println(&quot; top: 1;&quot;);</p><p> client.println(&quot; left: 5px;&quot;);</p><p> client.println(&quot; -webkit-border-radius: 10px;&quot;);</p><p> client.println(&quot; -moz-border-radius: 10px;&quot;);</p><p> client.println(&quot; -khtml-border-radius: 10px;&quot;);</p><p> client.println(&quot; border-radius: 10px;&quot;);</p><p> client.println(&quot; height: 1px;&quot;);</p><p> client.println(&quot; width: 13px;&quot;);</p><p> client.println(&quot; padding: 5px 0;&quot;);</p><p> client.println(&quot; background-color: rgba(200, 200, 200, 0.25);&quot;);</p><p> client.println(&quot; background-image: -webkit-gradient(linear, 0% 0%, 0% 95%, from(rgba(255, 255, 255, 0.7)), to(rgba(255, 255, 255, 0)));&quot;);</p><p> client.println(&quot; }&quot;);</p><p> client.println(&quot;&quot;);</p><p> //and finally this is the end of the style data and header</p><p> client.println(&quot;&lt;/style&gt;&quot;);</p><p> client.println(&quot;&lt;/head&gt;&quot;);</p><p> //now printing the page itself</p><p> client.println(&quot;&lt;body&gt;&quot;);</p><p> client.println(&quot;&lt;div class=\&quot;view\&quot;&gt;&quot;);</p><p> client.println(&quot; &lt;div class=\&quot;header-wrapper\&quot;&gt;&quot;);</p><p> client.println(&quot; &lt;h1&gt;Ethernet Switching&lt;/h1&gt;&quot;);</p><p> client.println(&quot; &lt;/div&gt;&quot;);</p><p>//////</p><p> } //end of htmlHeader</p><p>////////////////////////////////////////////////////////////////////////</p><p>//htmlFooter Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html footer</p><p>void printHtmlFooter(EthernetClient client){</p><p> //Set Variables Before Exiting </p><p> printLastCommandOnce = false;</p><p> printButtonMenuOnce = false;</p><p> allOn = &quot;&quot;;</p><p> allOff = &quot;&quot;;</p><p> //printing last part of the html</p><p> client.println(&quot;\n&lt;h3 align=\&quot;center\&quot;&gt;Development - Chinh Truc &lt;br&gt; 01 - August - 2014 - V5.0&quot;);</p><p> client.println(&quot;\n&lt;h3 align=\&quot;center\&quot;&gt;&copy; Author - Claudio Vella &lt;br&gt; Malta - October - 2012 - &quot;);</p><p> client.println(rev);</p><p> client.println(&quot;&lt;/h3&gt;&lt;/div&gt;\n&lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt;&quot;);</p><p> delay(1); // give the web browser time to receive the data</p><p> client.stop(); // close the connection:</p><p> Serial.println(&quot; - Done, Closing Connection.&quot;);</p><p> delay (2); //delay so that it will give time for client buffer to clear and does not repeat multiple pages.</p><p> } //end of htmlFooter</p><p>////////////////////////////////////////////////////////////////////////</p><p>//printHtmlButtonTitle Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html button title</p><p>void printHtmlButtonTitle(EthernetClient client){</p><p> client.println(&quot;&lt;div class=\&quot;group-wrapper\&quot;&gt;&quot;);</p><p> client.println(&quot; &lt;h2&gt;Switch Device output.&lt;/h2&gt;&quot;);</p><p> client.println();</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//printLoginTitle Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html button title</p><p>void printLoginTitle(EthernetClient client){</p><p> // client.println(&quot;&lt;div class=\&quot;group-wrapper\&quot;&gt;&quot;);</p><p> client.println(&quot; &lt;h2&gt;Please enter the user data to login.&lt;/h2&gt;&quot;);</p><p> client.println();</p><p>}</p>
<p>Hey , its very nice, but the all on and all of function , does not work properly. It can't turn on and off all relays only the first 10. </p><p>Can you help me solve this problem ? Best regards Kalin !</p>
<p>please help me to make 32 relays.....</p>
<p>Hi</p><p>How to combine with the bluetooth code I wrote this code you developed?</p><p>Thanks to our contributors</p><p>//-------------------DO NOT EDIT AFTER THIS LINE------------------------// </p><p>String voice;</p><p>int </p><p>rel1 = 2,</p><p>rel2 = 3,</p><p>rel3 = 4,</p><p>rel4 = 5,</p><p>rel5 = 6,</p><p>rel6 = 7,</p><p>rel7 = 8,</p><p>rel8 = 9;</p><p>void alloff(){</p><p>digitalWrite(rel1, LOW); </p><p>digitalWrite(rel2, LOW); </p><p>digitalWrite(rel3, LOW); </p><p>digitalWrite(rel4, LOW); </p><p>digitalWrite(rel5, LOW); </p><p>digitalWrite(rel6, LOW); </p><p>digitalWrite(rel7, LOW); </p><p>digitalWrite(rel8, LOW); </p><p>}</p><p>void allon(){</p><p>digitalWrite(rel1, HIGH); </p><p>digitalWrite(rel2, HIGH); </p><p>digitalWrite(rel3, HIGH); </p><p>digitalWrite(rel4, HIGH); </p><p>digitalWrite(rel5, HIGH);</p><p>digitalWrite(rel6, HIGH); </p><p>digitalWrite(rel7, HIGH); </p><p>digitalWrite(rel8, HIGH);</p><p>}</p><p>void setup() {</p><p>Serial.begin(9600);</p><p>pinMode(rel1, OUTPUT); </p><p>pinMode(rel2, OUTPUT); </p><p>pinMode(rel3, OUTPUT); </p><p>pinMode(rel4, OUTPUT); </p><p>pinMode(rel5, OUTPUT); </p><p>pinMode(rel6, OUTPUT); </p><p>pinMode(rel7, OUTPUT); </p><p>pinMode(rel8, OUTPUT);</p><p>//----------------------Set Relays state the begin-------------------//</p><p>digitalWrite(rel1, HIGH);</p><p>digitalWrite(rel2, HIGH);</p><p>digitalWrite(rel3, HIGH);</p><p>digitalWrite(rel4, HIGH);</p><p>digitalWrite(rel5, HIGH);</p><p>digitalWrite(rel6, HIGH);</p><p>digitalWrite(rel7, HIGH);</p><p>digitalWrite(rel8, HIGH);</p><p>}</p><p>void loop() {</p><p>while (Serial.available()){</p><p>delay(10);</p><p>char c = Serial.read();</p><p>if (c == '#') {break;}</p><p>voice += c;</p><p>} </p><p>if (voice.length() &gt; 0) {</p><p>Serial.println(voice); </p><p>//-------------------DO NOT EDIT BEFORE THIS LINE------------------------// </p><p>//</p><p>//</p><p>//</p><p>//</p><p>//----------****************START USER DEFINED CODE**********************-------------//</p><p>//--------------------------Control all relays state----------------------------------//</p><p>//--Here is place where can edit words that must be told to change the state of all relays at the same time.Please edit words &quot;*all on&quot; and &quot;*all off&quot; with words that you prefer to control all outputs. ex. &quot;*panic on&quot; and &quot;*panic off&quot;. Please keep structure of the algorithm, &quot; and * are important, dont delete them when edit words.--//</p><p>if(voice == &quot;*hepsini kapat&quot;) {allon();} //Turn Off All Relays outputs</p><p>if(voice == &quot;*sini kapat&quot;) {allon();} //Turn Off All Relays outputs</p><p>if(voice == &quot;*kapat&quot;) {allon();} //Turn Off All Relays outputs</p><p>else if(voice == &quot;*hepsini a&ccedil;&quot;){alloff();} //Turn On All Relays outputs</p><p>else if(voice == &quot;*sini a&ccedil;&quot;){alloff();} //Turn On All Relays outputs</p><p>else if(voice == &quot;*a&ccedil;&quot;){alloff();} //Turn On All Relays outputs</p><p>//--------------------------Control seperate relay state------------------------------//</p><p>//--------------------------It can work in many languages-----------------------------//</p><p>//---------------------------Example Bulgarian and English---------------------------//</p><p>else if(voice == &quot;*ışıkları a&ccedil;&quot;) {digitalWrite(rel1, LOW);} //Turn On 1 Relay output</p><p>else if(voice == &quot;*tv a&ccedil;&quot;) {digitalWrite(rel2, LOW);} //Turn On 2 Relay output</p><p>else if(voice == &quot;*tv yi a&ccedil;&quot;) {digitalWrite(rel2, LOW);} //Turn On 2 Relay output</p><p>else if(voice == &quot;*server a&ccedil;&quot;) {digitalWrite(rel3, LOW);} //Turn On 3 Relay output</p><p>else if(voice == &quot;*s&ouml;z ver bağlan&quot;) {digitalWrite(rel3, LOW);} //Turn On 3 Relay output</p><p>else if(voice == &quot;*s&ouml;zver bağlan&quot;) {digitalWrite(rel3, LOW);} //Turn On 3 Relay output</p><p>else if(voice == &quot;*s&ouml;z ver a&ccedil;&quot;) {digitalWrite(rel3, LOW);} //Turn On 3 Relay output</p><p>else if(voice == &quot;*klima a&ccedil;&quot;) {digitalWrite(rel4, LOW);} //Turn On 4 Relay output</p><p>else if(voice == &quot;*klima yı a&ccedil;&quot;) {digitalWrite(rel4, LOW);} //Turn On 4 Relay output</p><p>else if(voice == &quot;*klimayı a&ccedil;&quot;) {digitalWrite(rel4, LOW);} //Turn On 4 Relay output</p><p>else if(voice == &quot;*alarm a&ccedil;&quot;) {digitalWrite(rel5, LOW);} //Turn On 5 Relay output</p><p>else if(voice == &quot;*kapıyı a&ccedil;&quot;) {digitalWrite(rel6, LOW);} //Turn On 6 Relay output</p><p>else if(voice == &quot;*kapı a&ccedil;&quot;) {digitalWrite(rel6, LOW);} //Turn On 6 Relay output</p><p>else if(voice == &quot;*garaj kapısını a&ccedil;&quot;) {digitalWrite(rel7, LOW);} //Turn On 7 Relay output</p><p>else if(voice == &quot;*garaj kapı a&ccedil;&quot;) {digitalWrite(rel7, LOW);} //Turn On 7 Relay output</p><p>else if(voice == &quot;*perde a&ccedil;&quot;) {digitalWrite(rel8, LOW);} //Turn On 8 Relay output</p><p>else if(voice == &quot;*perdeyi a&ccedil;&quot;) {digitalWrite(rel8, LOW);} //Turn On 8 Relay output</p><p>else if(voice == &quot;*ferdi a&ccedil;&quot;) {digitalWrite(rel8, LOW);} //Turn On 8 Relay output</p><p>else if(voice == &quot;*ferdiyi a&ccedil;&quot;) {digitalWrite(rel8, LOW);} //Turn On 8 Relay output</p><p>//</p><p>else if(voice == &quot;*ışıkları kapat&quot;) {digitalWrite(rel1, HIGH);} //Turn Off 1 Relay output</p><p>else if(voice == &quot;*tv kapat&quot;) {digitalWrite(rel2, HIGH);} //Turn Off 2 Relay output</p><p>else if(voice == &quot;*tv yi kapat&quot;) {digitalWrite(rel2, HIGH);} //Turn Off 2 Relay output</p><p>else if(voice == &quot;*server kapat&quot;) {digitalWrite(rel3, HIGH);} //Turn Off 3 Relay output</p><p>else if(voice == &quot;*s&ouml;z ver kapat&quot;) {digitalWrite(rel3, HIGH);} //Turn Off 3 Relay output</p><p>else if(voice == &quot;*klima kapat&quot;) {digitalWrite(rel4, HIGH);} //Turn Off 4 Relay output</p><p>else if(voice == &quot;*klima kapa&quot;) {digitalWrite(rel4, HIGH);} //Turn Off 4 Relay output</p><p>else if(voice == &quot;*klimayı kapat&quot;) {digitalWrite(rel4, HIGH);} //Turn Off 4 Relay output</p><p>else if(voice == &quot;*klima yı kapat&quot;) {digitalWrite(rel4, HIGH);} //Turn Off 4 Relay output</p><p>else if(voice == &quot;*klima yı kapa&quot;) {digitalWrite(rel4, HIGH);} //Turn Off 4 Relay output</p><p>else if(voice == &quot;*alarm kapat&quot;) {digitalWrite(rel5, HIGH);} //Turn Off 5 Relay output</p><p>else if(voice == &quot;*kapıyı kapat&quot;) {digitalWrite(rel6, HIGH);} //Turn Off 6 Relay output</p><p>else if(voice == &quot;*kapı kapat&quot;) {digitalWrite(rel6, HIGH);} //Turn Off 6 Relay output</p><p>else if(voice == &quot;*kapıyı kapat&quot;) {digitalWrite(rel6, HIGH);} //Turn Off 6 Relay output</p><p>else if(voice == &quot;*garaj kapı kapat&quot;) {digitalWrite(rel7, HIGH);} //Turn Off 7 Relay output</p><p>else if(voice == &quot;*garaj kapısını kapat&quot;) {digitalWrite(rel7, HIGH);} //Turn Off 7 Relay output</p><p>else if(voice == &quot;*perde kapat&quot;) {digitalWrite(rel8, HIGH);} //Turn Off 8 Relay output</p><p>else if(voice == &quot;*perdeyi kapat&quot;) {digitalWrite(rel8, HIGH);} //Turn Off 8 Relay output</p><p>else if(voice == &quot;*ferdi kapat&quot;) {digitalWrite(rel8, HIGH);} //Turn Off 8 Relay output</p><p>else if(voice == &quot;*ferdiyi kapat&quot;) {digitalWrite(rel8, HIGH);} //Turn Off 8 Relay output</p><p>//--------------*****************END USER DEFINED CODE*******************-------------//</p><p>//</p><p>//</p><p>//</p><p>//</p><p>//</p><p>//-------------------DO NOT EDIT AFTER THIS LINE------------------------// </p><p>voice=&quot;&quot;;}}</p><p>//-------------------DO NOT EDIT BEFORE THIS LINE-----------------------//</p>
<p>I tried some weeks to let it run on the arduino WiFi Shield. but it dosn&acute;t run well.</p><p>You have any idea?</p><p>Thanks</p>
<br><br>Hello sir Tcvella ,<br><br>First of all, sorry for my poor English!<br>I'm Sri lankan,so<br>I'm a beginner with Arduino, but this awesome Project is my favorite &amp; liked.<br>The gounda version worked for me very well (thank you Tcvella), but now i have a &quot;problem&quot; with the last iphone softweare,<br><br>I was looking for the any androide phone softwere, but I did not find iphone softweare them.Can somebody help me with a link, to download the iphone softweare.........manjulagraphic@gmail.com<br><br>Regard's from Manjula,<br><br><br>
<p>Very nice project! </p><p>i want to make a similar but i want to add an sd card to save there the html code </p><p>can anyone help?</p><p>thenks in advance</p>
<p>I have a question...<br>How would we do if we wanted to turn on and off a PC ?.<br>Both for one thing to the other , we need the relay a couple of seconds and then turn off.<br>Bye.</p>
<p>Hi iam narasimha from india, i saw your interesting code and started working on this i have successfully ported ethernet to wificlient using cc3200 TI and its wroking too.</p><p>Now iam facing a issue some times the web page not accessible even though iam using port forwarding concept for router.i have set the refresh rate as 10seconds some times it gets timeout how to fix it please suggest.</p><p>Narasimha jagirdar</p><p>+91-9901544165/+91-8892507761</p>
<p>The web page not accessible when i have tried to connect multiple clients to routers, that mean i flashed code in 5 devices , initially all are communicating but after 1hour or sometime some devices webpage notaccessible , why this timeout occuring, please suggest some fix.Tested on chrome,mozilla,safari browsers. same issue.</p><p>Best regards</p><p>narasimha</p>
<p>Hi Narasimhaj,</p><p>There was one person mentioned that it got stuck after a while running. He suggested that some IOs cannot be used as outputs, as they are used to drive the ethernet module. I had no time to check what is actually happening. So I dont know what is actually going on. There could be possible solutions such as close the connection if there is no response, or as a final workaround to restart the arduino.</p><p>If you would have some time to spare, check the above, and please reply if you find a solution.</p><p>Thanks</p><p>Claudio </p>
<p>Hi Claudio,</p><p> Thanks for the reply, i am working on it,currently iam suspecting the router which iam using ie TP-link as its going on standby after some time, i will update in this forum based on rigorous testing.</p><p>Thanks in advance</p><p>narasimhaj</p>
<p>can i implement this code with the enc28j60 module?</p>
<p>Hello sir, thank you so much for sharing your wonderful idea. I used your code with the login authentication. But when i login from my device, it is also accessible from other device without logging in on their own device.. :( </p>
<p>The login feature has been added by somebody else to my sketch. Unfortunately I have not yet tested it. I gave credit to the person that had done the login feature. Thus please find his name and contact him, maybe he can help.</p>
<p>Thanks for the reply sir, i already solved the problem in login feature.. But i got another problem. I am currently using 4 relay on my web switch.. But sometimes the Graphical user interface got broken like the html codes is being revealed.. </p>
Hello Mr. Vella .. I ask your help . I want to make the control 32 relays and 5 door monitoring sensor based on data from the web control arduino sketch . I want to control door sensor , if input = &lt; 2 volts then the &quot; safe &quot; . if input&gt; 2 then the &quot; danger &quot; . but the monitoring system is not connected to relay control systems . Thank you for your help.
<p>I could notfigure out what do you want to do. Please explain in moredetail.</p>
<p>32 control relays to keep using the ethernet web control like that you created in version 4.6, just add 5 sensors monitoring the door. door sensors using on / off switch, the first switch in place between + VCC 5 volts to pin A1, the second switch is placed between + VCC 5 volts to pin A2, as well until the fifth switch. when the door is opened, the pin goes high so that the show text &quot;safe&quot;, if the door is closed, the pin low value and appear the text &quot;danger&quot;. Thank you.</p>
<p>Ciao,<br>mi potreste aiutare ad inserire un sensore dht11 per leggere la temperatura?<br>Grazie<br>Walter</p>
Ciao Walter, dipende dal tipo del sensore. Io suggererei di cercare la datasheet sub web, e poi se il sensore varia la resistenza allora, predi un po di giacco vicino al sensore e prede anche u termometro vicino all giaccio, e misura la resistenza. Fa la stessa cosa con aqua calda. Questa tipo di scala e applicabile se il sensore e lineare. Se e logaritmico, allora e piu difficile.
Ol&aacute;, gostaria de saber qual &eacute; o endere&ccedil;o que coloco no navegador para ter acesso a p&aacute;gina. HTML que est&aacute; dentro do arduino?
Yes, you give the ip address on the arduino. Then from a browser on your mobile you type the ip address you inserted in the arduino.
<p>Hello,</p><p>First of all, sorry for my poor English!</p><p>I'm a beginner with Arduino, but this awesome Project is my favorite. </p><p>The gound version worked for me very well (thank you Tcvella), but now i have a &quot;problem&quot; with the last (Drewpalmer's version) upgrade..... </p><p>I was looking for the libraries to the translation, but I did not find all of them.</p><p>Can somebody help me with a link, to download the missing Libraries, or share with me a *.zip file, what implies the libraries..</p><p>Regard's from Hungary,</p><p>Tam&aacute;s</p>
Which libraries do you have missing?
Can somebody help me?
<p>Hello , how can I adapt this code for android ?</p>
It is html, thus should be fine. Graphics might vary a bit from browser to browser however.
<p>Hello, mr. Vella.<br>I loved this work and how available you are helping everyone out around here.<br>What is making me curious is how did you manage to transfer all the program to your arduino, once it's said that the ammount of variables is equivalent to 246% of my Mega capacity... Did you implemented a SD card or something?</p>
No it is saving on the arduino mega only. Eeprom is used to save the latest statuses in case of power failure, so that outputs remain to the last known status.
Ciao, ho tre sensori di temperatura mcp9700a, vorrei utilizzarli per indicare temp piano 1, temp piano 2 e temp ext, come posso adattare al tuo fantastico sketch, nel senso sia nella parte int che in quella della formula per fare leggere temperatura al termistore.<br>Ho scritto uno sketch dove posso regolare la temperatura e far accendere le elettrovalvole della caldaia per ogni singolo piano , e' possibile farlo sul tuo sketch? Mi aiuteresti ?<br>Grazie !!!!<br>Resto in attesa di una tua risposta.<br>
Ok...ci sono riuscito !!!<br>Mi manca solo la regolazione della temperatura e l'accensione delle elettrovalvole per piano...e poi una user e password per accedere! !!<br>Se puoi aiutarmi te ne sarei grato. <br>Intanto posto lo sketch, potrebbe essere utile !!!<br><br>Grazie e scusate se non scrivo in inglese !!!?
<p>How to turn on or off light without tablet or smartphone ????????</p>
<p>zoomx - Thank you, I know about it. But how to control without a browser? Need to add inputs for buttons. must be in control of the browser and the buttons.</p>
<p>I have messed around with this and adapted it to my needs I added code for buttons here is an example of what I did. It might give you an idea of how to get started</p><p>// Controling relays with pusch buttons</p><p>// Relays </p><p>int Hall = 22;</p><p>int LivingRoom = 23;</p><p>int Balcony = 24;</p><p>int Kitchen = 25;</p><p>// Button Pins</p><p>int button1 = 38; // Hall light button</p><p>int button2 = 39; // Living Room light button</p><p>int button3 = 40; // Balcony light button</p><p>int button4 = 41; // Kitchen light button</p><p>// This remembers the buttons last state</p><p>boolean lastButton = LOW;</p><p>boolean currentButton = LOW;</p><p>boolean ledOn = false;</p><p>boolean lastButton2 = LOW;</p><p>boolean currentButton2 = LOW;</p><p>boolean ledOn2 = false;</p><p>boolean lastButton3 = LOW;</p><p>boolean currentButton3 = LOW;</p><p>boolean ledOn3 = false;</p><p>boolean lastButton4 = LOW;</p><p>boolean currentButton4 = LOW;</p><p>boolean ledOn4 = false;</p><p>void setup() {</p><p> // These are the relays conected to the lights</p><p> pinMode(Hall, OUTPUT); //pin selected to control</p><p> pinMode(LivingRoom, OUTPUT); //pin selected to control</p><p> pinMode(Balcony, OUTPUT); //pin selected to control</p><p> pinMode(Kitchen, OUTPUT); //pin selected to control</p><p> // These are the puch buttons the switch the lights on or off</p><p> pinMode(button1, INPUT);</p><p> pinMode(button2, INPUT);</p><p> pinMode(button3, INPUT);</p><p> pinMode(button4, INPUT);</p><p>}</p><p>// This part Debounces the buttons </p><p>// Button1 debounce</p><p>boolean debounce(boolean last)</p><p>{</p><p> boolean current = digitalRead(button1);</p><p> if (last != current)</p><p> {</p><p> delay(5);</p><p> current = digitalRead(button1);</p><p> }</p><p> return current;</p><p>}</p><p>// Button2 debounce</p><p>boolean debounce2(boolean last2)</p><p>{</p><p> boolean current2 = digitalRead(button2);</p><p> if (last2 != current2)</p><p> {</p><p> delay(5);</p><p> current2 = digitalRead(button2);</p><p> }</p><p> return current2;</p><p>}</p><p>// Button3 debounce</p><p>boolean debounce3(boolean last3)</p><p>{</p><p> boolean current3 = digitalRead(button3);</p><p> if (last3 != current3)</p><p> {</p><p> delay(5);</p><p> current3 = digitalRead(button3);</p><p> }</p><p> return current3;</p><p>}</p><p>// Button4 debounce</p><p>boolean debounce4(boolean last4)</p><p>{</p><p> boolean current4 = digitalRead(button4);</p><p> if (last4 != current4)</p><p> {</p><p> delay(5);</p><p> current4 = digitalRead(button4);</p><p> }</p><p> return current4;</p><p>}</p><p>void loop() {</p><p>// And here is where the magic is done</p><p> // Start buttons</p><p> //button1 --------------------------------------------------------</p><p> currentButton = debounce(lastButton);</p><p> if (lastButton == LOW &amp;&amp; currentButton == HIGH)</p><p> {</p><p> ledOn = !ledOn;</p><p> }</p><p> lastButton = currentButton;</p><p> digitalWrite(Hall, ledOn);</p><p> //button2 --------------------------------------------------------</p><p> currentButton2 = debounce2(lastButton2);</p><p> if (lastButton2 == LOW &amp;&amp; currentButton2 == HIGH)</p><p> {</p><p> ledOn2 = !ledOn2;</p><p> }</p><p> lastButton2 = currentButton2;</p><p> digitalWrite(LivingRoom, ledOn2);</p><p> //button3 --------------------------------------------------------</p><p> currentButton3 = debounce3(lastButton3);</p><p> if (lastButton3 == LOW &amp;&amp; currentButton3 == HIGH)</p><p> {</p><p> ledOn3 = !ledOn3;</p><p> }</p><p> lastButton3 = currentButton3;</p><p> digitalWrite(Balcony, ledOn3);</p><p> //button4 --------------------------------------------------------</p><p> currentButton4 = debounce4(lastButton4);</p><p> if (lastButton4 == LOW &amp;&amp; currentButton4 == HIGH)</p><p> {</p><p> ledOn4 = !ledOn4;</p><p> }</p><p> lastButton4 = currentButton4;</p><p> digitalWrite(Kitchen, ledOn4);</p><p>} </p>
<p>Instead of using a webserver you can use a socket, it is like control over serial port. But you have to write you program that run on a PC or on a smartphone or another Arduino.</p><p>There are other examples of this including reading button state or analog values.</p><p>This is an example of one of them but this uses a browser.</p><p>http://startingelectronics.com/tutorials/arduino/ethernet-shield-web-server-tutorial/SD-card-IO/</p>
<p>You not understand me. I know what kind of device. But into it need to add control of the buttons. Just imagine house in which there are no switches. Are you go to the toilet or bathroom with the tablet ???? Always walk around the room with a tablet?</p>
<p>If you mean to control Arduino without Ethernet, yes you must add buttons and maybe an LCD with a menu. But this one is not the example you need, it speak about to control relais (or others) over Ethernet.</p>
<p>It works with (quite) any browser. You only need a browser yhat has HTML5 support.</p><p>Tested with Sware Iron and Firefox on Windows7</p>
<p>I will made it!</p>
<p>Will this work on Leonardo please?</p><p>I just tried it, but no luck :(</p>
<p>I was successfully able to convert this to work with an Arduino Micro, with a mini WizNet5100 Ethernet Module. I moved the enitre Web Interface to an Raspberry Pi, and just let the Arduino run commands.</p>
<p>+1</p><p>I'm struggling with limitations of Arduino Nano (even thought of OpenWRT on TP-Link portable router but that is way out of my league). So for the moment I came with an idea of using 2 Nanos - one for webserver, other for actually doing all the work. Your instructable (or at least sketches) would be a great help! </p>
<p>Cool, how about an instuctable on how to do it?</p>
<p>I noticed that PIN 10 and 11 (TEST09 and TEST10 in the web interface) cannot be switched, I believe because are used by the Ethernet card for SPI communications.</p><p>So the code must be improved.</p>
<p>The original code run out of memory on Arduino UNO. Leaving all string in flash using F() function I successfully run Chinh Truc code on Arduino UNO.</p><p>Here it is.</p><p>//EthernetSwitching02</p><p>//http://www.instructables.com/id/Ethernet-Switching-with-Arduino/?ALLSTEPS</p><p>//Al strings are in FLASH so it fit also Arduino UNO RAM</p><p>#include &lt;Ethernet.h&gt;</p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;EEPROM.h&gt;</p><p>////////////////////////////////////////////////////////////////////////</p><p>//CONFIGURATION</p><p>////////////////////////////////////////////////////////////////////////</p><p>//IP manual settings</p><p>byte ip[] = {</p><p> 192, 168, 137, 100 }; //Manual setup only</p><p>byte gateway[] = {</p><p> 192, 168, 1, 1 }; //Manual setup only</p><p>byte subnet[] = {</p><p> 255, 255, 255, 0 }; //Manual setup only</p><p>byte mac[] = {</p><p> 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };</p><p>//Ethernet Port</p><p>EthernetServer server = EthernetServer(80); //default html port 80</p><p>//The number of outputs going to be switched.</p><p>int outputQuantity = 12; //should not exceed 10</p><p>//Invert the output of the leds</p><p>boolean outputInverted = false; //true or false</p><p>// This is done in case the relay board triggers the relay on negative, rather then on positive supply</p><p>//Html page refresh</p><p>int refreshPage = 15; //default is 10sec.</p><p>//Beware that if you make it refresh too fast, the page could become inacessable.</p><p>//Display or hide the &quot;Switch on all Pins&quot; buttons at the bottom of page</p><p>int switchOnAllPinsButton = false; //true or false</p><p>int outputAddress[16] = {</p><p> 2,3,4,5,6,7,8,9,10,11,12,13,13,13,13,13}; //Allocate 10 spaces and name the output pin address.</p><p>String buttonText[16] = {</p><p> &quot;01. TEST01&quot;,&quot;02. TEST02&quot;,&quot;03. TEST03&quot;,&quot;04. TEST04&quot;,&quot;05. TEST05&quot;,&quot;06. TEST06&quot;,&quot;07. TEST07&quot;,&quot;08. TEST08&quot;,&quot;09. TEST09&quot;,&quot;10. TEST10&quot;,&quot;11. TEST11&quot;,&quot;12. TEST12&quot;,&quot;13. TEST13&quot;,&quot;14. TEST14&quot;,&quot;15. TEST15&quot;,&quot;16. TEST16&quot;};</p><p>// Set the output to retain the last status after power recycle.</p><p>int retainOutputStatus[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};//1-retain the last status. 0-will be off after power cut.</p><p>////////////////////////////////////////////////////////////////////////</p><p>//VARIABLES DECLARATION</p><p>////////////////////////////////////////////////////////////////////////</p><p>int outp = 0;</p><p>boolean printLastCommandOnce = false;</p><p>boolean printButtonMenuOnce = false;</p><p>boolean initialPrint = true;</p><p>String allOn = &quot;&quot;;</p><p>String allOff = &quot;&quot;;</p><p>boolean reading = false;</p><p>boolean outputStatus[16]; //Create a boolean array for the maximum ammount.</p><p>String rev = &quot;V4.06b&quot;;</p><p>unsigned long timeConnectedAt;</p><p>boolean writeToEeprom = false;</p><p>/////////////////////////////////////////////////</p><p>// Temperature Related Reading</p><p>const int tempInPin = A1;</p><p>int tempInValue = 0; //temperature read</p><p>int tempScaleOutValue = 0; //temperature formatted</p><p>int tempOutValue = 0; //temperature formatted</p><p>float tempOutDeg = 0.0;</p><p>////////////////////////////////////////////////////////////////////////</p><p>//RUN ONCE</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Beginning of Program</p><p>void setup(){</p><p> Serial.begin(9600);</p><p> delay(1000);</p><p> Serial.println(F(&quot;EthernetSwitching01&quot;));</p><p> delay(1000);</p><p> Serial.println(F(&quot;initEepromValues&quot;));</p><p> initEepromValues();</p><p> delay(1000);</p><p> Serial.println(F(&quot;readEepromValues&quot;));</p><p> readEepromValues();</p><p> delay(1000);</p><p> //Set pins as Outputs</p><p> boolean currentState = false;</p><p> int var;</p><p> for (int i = 0; i &lt; outputQuantity; i++){</p><p> pinMode(outputAddress[i], OUTPUT);</p><p> var = outputAddress[i];</p><p> //Switch all outputs to either on or off on Startup</p><p> if(outputInverted == true) {</p><p> //digitalWrite(outputAddress[var], HIGH);</p><p> if(outputStatus[i] == 0){</p><p> currentState = true;</p><p> }</p><p> else{</p><p> currentState = false;</p><p> } //check outputStatus if off, switch output accordingly</p><p> digitalWrite(var, currentState);</p><p> }</p><p> else{</p><p> //digitalWrite(outputAddress[var], LOW);</p><p> if(outputStatus[i] == 0){</p><p> currentState = false;</p><p> }</p><p> else{</p><p> currentState = true;</p><p> }//check outputStatus if off, switch output accordingly</p><p> digitalWrite(var, currentState);</p><p> }</p><p> }</p><p> //Setting up the IP address. Comment out the one you dont need.</p><p> //Ethernet.begin(mac); //for DHCP address. (Address will be printed to serial.)</p><p> //Ethernet.begin(mac, ip, gateway, subnet); //for manual setup. (Address is the one configured above.)</p><p> Serial.println(F(&quot;Trying to get an IP address using DHCP&quot;));</p><p> if (Ethernet.begin(mac) == 0) {</p><p> Serial.println(F(&quot;Failed to configure Ethernet using DHCP&quot;));</p><p> // initialize the ethernet device not using DHCP:</p><p> Ethernet.begin(mac, ip, gateway, subnet);</p><p> }</p><p> server.begin();</p><p> Serial.print(F(&quot;Server started at &quot;));</p><p> Serial.println(Ethernet.localIP());</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//LOOP</p><p>////////////////////////////////////////////////////////////////////////</p><p>void loop(){</p><p> //Read Temperature Sensor</p><p> tempInValue = analogRead(tempInPin);</p><p> // Connecting a 10K3 Thermistor to the Arduino Input</p><p> // +5V �&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;[10Kohms]&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;[Thermistor]&mdash;&mdash;� 0V</p><p> // To Arduino IP �&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;|</p><p> tempScaleOutValue = map(tempInValue, 0, 1023, 1023, 0); //Arduino value and NTC of the 10K3 Thermistor</p><p> tempOutValue = map(tempScaleOutValue, 130, 870, -170, 730); //range of Arduino Value compared with Temperature</p><p> tempOutValue = tempOutValue -45; //Adjustments</p><p> tempOutDeg = tempOutValue / 10.0;</p><p> checkForClient();</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//checkForClient Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//</p><p>void checkForClient(){</p><p> EthernetClient client = server.available();</p><p> if (client) {</p><p> boolean currentLineIsBlank = true;</p><p> boolean sentHeader = false;</p><p> int temp,temp1;</p><p> while (client.connected()) {</p><p> if (client.available()) {</p><p> char c = client.read();</p><p> if(c == '*'){</p><p> printHtmlHeader(client); //call for html header and css</p><p> printLoginTitle(client);</p><p> printHtmlFooter(client);</p><p> break;</p><p> }</p><p> if(!sentHeader){</p><p> printHtmlHeader(client); //call for html header and css</p><p> printHtmlButtonTitle(client); //print the button title</p><p> sentHeader = true;</p><p> }</p><p> if(reading &amp;&amp; c == ' '){</p><p> reading = false;</p><p> }</p><p> if(c == '?') {</p><p> reading = true; //found the ?, begin reading the info</p><p> }</p><p> if(reading){</p><p> //if user input is H set output to 1</p><p> if(c == 'H') {</p><p> outp = 1;</p><p> }</p><p> if(c == 'L') {</p><p> outp = 0;</p><p> }</p><p> // Serial.println(c); //print the value of c to serial communication</p><p> //---------------------------------------------------------------------------------------------</p><p> // ? H 1 0</p><p> // ^ ^ ^ ^</p><p> // | | | |____________read 4 ( 10,11,12,13....)</p><p> // | | |______________read 3 ( 1....9)</p><p> // | |________________read 2 if user input is H set output to L</p><p> // |__________________read 1</p><p> //---------------------------------------------------------------------------------------------</p><p> if( c == '1'){</p><p> char c = client.read();</p><p> switch (c) {</p><p> case '0':</p><p> triggerPin(outputAddress[10], client, outp);</p><p> break;</p><p> case '1':</p><p> triggerPin(outputAddress[11], client, outp);</p><p> break;</p><p> case '2':</p><p> triggerPin(outputAddress[12], client, outp);</p><p> break;</p><p> case '3':</p><p> triggerPin(outputAddress[13], client, outp);</p><p> break;</p><p> case '4':</p><p> triggerPin(outputAddress[14], client, outp);</p><p> break;</p><p> case '5':</p><p> triggerPin(outputAddress[15], client, outp);</p><p> break;</p><p> default:</p><p> char c = client.read();</p><p> triggerPin(outputAddress[1], client, outp);</p><p> }</p><p> }</p><p> else {</p><p> switch (c) {</p><p> case '0':</p><p> triggerPin(outputAddress[0], client, outp);</p><p> break;</p><p> // case '1':</p><p> // triggerPin(outputAddress[1], client, outp);</p><p> // break;</p><p> case '2':</p><p> triggerPin(outputAddress[2], client, outp);</p><p> break;</p><p> case '3':</p><p> //add code here to trigger on 3</p><p> triggerPin(outputAddress[3], client, outp);</p><p> break;</p><p> case '4':</p><p> //add code here to trigger on 4</p><p> triggerPin(outputAddress[4], client, outp);</p><p> break;</p><p> case '5':</p><p> //add code here to trigger on 5</p><p> triggerPin(outputAddress[5], client, outp);</p><p> //printHtml(client);</p><p> break;</p><p> case '6':</p><p> //add code here to trigger on 6</p><p> triggerPin(outputAddress[6], client, outp);</p><p> break;</p><p> case '7':</p><p> //add code here to trigger on 7</p><p> triggerPin(outputAddress[7], client, outp);</p><p> break;</p><p> case '8':</p><p> //add code here to trigger on 8</p><p> triggerPin(outputAddress[8], client, outp);</p><p> break;</p><p> case '9':</p><p> //add code here to trigger on 9</p><p> triggerPin(outputAddress[9], client, outp);</p><p> break;</p><p> } //end of switch case</p><p> }</p><p> }//end of switch switch the relevant output</p><p> //if user input was blank</p><p> if (c == '\n' &amp;&amp; currentLineIsBlank){</p><p> printLastCommandOnce = true;</p><p> printButtonMenuOnce = true;</p><p> triggerPin(777, client, outp); //Call to read input and print menu. 777 is used not to update any outputs</p><p> break;</p><p> }</p><p> }</p><p> }</p><p> printHtmlFooter(client); //Prints the html footer</p><p> }</p><p> else{</p><p> if (millis() &gt; (timeConnectedAt + 60000)){</p><p> if (writeToEeprom == true){</p><p> writeEepromValues(); //write to EEprom the current output statuses</p><p> Serial.println(F(&quot;No Clients for more then a minute - Writing statuses to Eeprom.&quot;));</p><p> writeToEeprom = false;</p><p> }</p><p> }</p><p> }</p><p>}// END</p><p>////////////////////////////////////////////////////////////////////////</p><p>//triggerPin Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//</p><p>void triggerPin(int pin, EthernetClient client, int outp){</p><p> if (pin != 777){</p><p> // Serial.println(pin);</p><p> if(outp == 1) {</p><p> if (outputInverted ==false){</p><p> digitalWrite(pin, HIGH);</p><p> }</p><p> else{</p><p> digitalWrite(pin, LOW);</p><p> }</p><p> }</p><p> if(outp == 0){</p><p> if (outputInverted ==false){</p><p> digitalWrite(pin, LOW);</p><p> }</p><p> else{</p><p> digitalWrite(pin, HIGH);</p><p> }</p><p> }</p><p> }</p><p> //Refresh the reading of outputs</p><p> readOutputStatuses();</p><p> //Prints the buttons</p><p> if (printButtonMenuOnce == true){</p><p> printHtmlButtons(client);</p><p> printButtonMenuOnce = false;</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//printHtmlButtons Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//print the html buttons to switch on/off channels</p><p>void printHtmlButtons(EthernetClient client){</p><p> //Start to create the html table</p><p> client.println(F(&quot;&quot;));</p><p> //client.println(F(&quot;&lt;p&gt;&quot;));</p><p> client.println(F(&quot;&lt;FORM&gt;&quot;));</p><p> client.println(F(&quot;&lt;table border=\&quot;0\&quot; align=\&quot;center\&quot;&gt;&quot;));</p><p> //Printing the Temperature</p><p> client.print(F(&quot;&lt;tr&gt;\n&quot;));</p><p> client.print(F(&quot;&lt;td&gt;&lt;h4&gt;&quot;));</p><p> client.print(F(&quot;Temperature&quot;));</p><p> client.print(F(&quot;&lt;/h4&gt;&lt;/td&gt;\n&quot;));</p><p> client.print(F(&quot;&lt;td&gt;&lt;/td&gt;&quot;));</p><p> client.print(F(&quot;&lt;td&gt;&quot;));</p><p> client.print(F(&quot;&lt;h3&gt;&quot;));</p><p> client.print(tempOutDeg);</p><p> client.print(F(&quot; &deg;C&lt;/h3&gt;&lt;/td&gt;\n&quot;));</p><p> client.print(F(&quot;&lt;td&gt;&lt;/td&gt;&quot;));</p><p> client.print(F(&quot;&lt;/tr&gt;&quot;));</p><p> //Start printing button by button</p><p> for (int var = 0; var &lt; outputQuantity; var++) {</p><p> //set command for all on/off</p><p> allOn += &quot;H&quot;;</p><p> allOn += outputAddress[var];</p><p> allOff += &quot;L&quot;;</p><p> allOff += outputAddress[var];</p><p> //Print begining of row</p><p> client.print(F(&quot;&lt;tr&gt;\n&quot;));</p><p> //Prints the button Text</p><p> client.print(F(&quot;&lt;td&gt;&lt;h4&gt;&quot;));</p><p> client.print(buttonText[var]);</p><p> client.print(F(&quot;&lt;/h4&gt;&lt;/td&gt;\n&quot;));</p><p> //Prints the ON Buttons+++++++++++++++++++++++++++++++++++++++++++++++</p><p> client.print(F(&quot;&lt;td&gt;&quot;));</p><p> client.print(F(&quot;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;ON &quot;));</p><p> client.print(F(&quot;\&quot; onClick=\&quot;parent.location='/?H&quot;));</p><p> client.print(var);</p><p> client.print(F(&quot;'\&quot;&gt;&lt;/td&gt;\n&quot;));</p><p> //Prints the OFF Buttons ---------------------------------------------</p><p> client.print(F(&quot; &lt;td&gt;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;OFF&quot;));</p><p> client.print(F(&quot;\&quot; onClick=\&quot;parent.location='/?L&quot;));</p><p> client.print(var);</p><p> client.print(F(&quot;'\&quot;&gt;&lt;/td&gt;\n&quot;));</p><p> //Invert the LED display if output is inverted.</p><p> if (outputStatus[var] == true ){ //If Output is ON</p><p> if (outputInverted == false){ //and if output is not inverted</p><p> client.print(F(&quot; &lt;td&gt;&lt;div class='green-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;)); //Print html for ON LED</p><p> }</p><p> else{ //else output is inverted then</p><p> client.print(F(&quot; &lt;td&gt;&lt;div class='black-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;)); //Print html for OFF LED</p><p> }</p><p> }</p><p> else //If Output is Off</p><p> {</p><p> if (outputInverted == false){ //and if output is not inverted</p><p> client.print(F(&quot; &lt;td&gt;&lt;div class='black-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;)); //Print html for OFF LED</p><p> }</p><p> else{ //else output is inverted then</p><p> client.print(F(&quot; &lt;td&gt;&lt;div class='green-circle'&gt;&lt;div class='glare'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;\n&quot;)); //Print html for ON LED</p><p> }</p><p> }</p><p> //Print end of row</p><p> client.print(F(&quot;&lt;/tr&gt;\n&quot;));</p><p> }</p><p> //Display or hide the Print all on Pins Button</p><p> if (switchOnAllPinsButton == true ){</p><p> //Prints the ON All Pins Button</p><p> client.print(F(&quot;&lt;tr&gt;\n&lt;td&gt;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;Switch ON All Pins&quot;));</p><p> client.print(F(&quot;\&quot; onClick=\&quot;parent.location='/?&quot;));</p><p> client.print(allOn);</p><p> client.print(F(&quot;'\&quot;&gt;&lt;/td&gt;\n&quot;));</p><p> //Prints the OFF All Pins Button</p><p> client.print(F(&quot;&lt;td&gt;&lt;INPUT TYPE=\&quot;button\&quot; VALUE=\&quot;Switch OFF All Pins&quot;));</p><p> client.print(F(&quot;\&quot; onClick=\&quot;parent.location='/?&quot;));</p><p> client.print(allOff);</p><p> client.print(F(&quot;'\&quot;&gt;&lt;/td&gt;\n&lt;td&gt;&lt;/td&gt;\n&lt;td&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&quot;));</p><p> }</p><p> //Closing the table and form</p><p> client.println(F(&quot;&lt;/table&gt;&quot;));</p><p> client.println(F(&quot;&lt;/FORM&gt;&quot;));</p><p> //client.println(F(&quot;&lt;/p&gt;&quot;));</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//readOutputStatuses Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Reading the Output Statuses</p><p>void readOutputStatuses(){</p><p> for (int var = 0; var &lt; outputQuantity; var++) {</p><p> outputStatus[var] = digitalRead(outputAddress[var]);</p><p> //Serial.print(outputStatus[var]);</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//readEepromValues Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Read EEprom values and save to outputStatus</p><p>void readEepromValues(){</p><p> for (int adr = 0; adr &lt; outputQuantity; adr++) {</p><p> outputStatus[adr] = EEPROM.read(adr);</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//writeEepromValues Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Write EEprom values</p><p>void writeEepromValues(){</p><p> for (int adr = 0; adr &lt; outputQuantity; adr++) {</p><p> EEPROM.write(adr, outputStatus[adr]);</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//initEepromValues Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Initialiaze EEprom values</p><p>//if eeprom values are not the correct format ie not euqual to 0 or 1 (thus greater then 1) initialize by putting 0</p><p>void initEepromValues(){</p><p> for (int adr = 0; adr &lt; outputQuantity; adr++){</p><p> if (EEPROM.read(adr) &gt; 1){</p><p> EEPROM.write(adr, 0);</p><p> }</p><p> }</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//htmlHeader Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html header</p><p>void printHtmlHeader(EthernetClient client){</p><p> // Serial.print(F(&quot;Serving html Headers at ms -&quot;));</p><p> timeConnectedAt = millis(); //Record the time when last page was served.</p><p> // Serial.print(timeConnectedAt); // Print time for debbugging purposes</p><p> writeToEeprom = true; // page loaded so set to action the write to eeprom</p><p> // send a standard http response header</p><p> client.println(F(&quot;HTTP/1.1 200 OK&quot;));</p><p> client.println(F(&quot;Content-Type: text/html&quot;));</p><p> client.println(F(&quot;Connnection: close&quot;));</p><p> client.println();</p><p> client.println(F(&quot;&lt;!DOCTYPE HTML&gt;&quot;));</p><p> client.println(F(&quot;&lt;head&gt;&quot;));</p><p> // add page title</p><p> client.println(F(&quot;&lt;title&gt;Ethernet Switching&lt;/title&gt;&quot;));</p><p> client.println(F(&quot;&lt;meta name=\&quot;description\&quot; content=\&quot;Ethernet Switching\&quot;/&gt;&quot;));</p><p> // add a meta refresh tag, so the browser pulls again every x seconds:</p><p> client.print(F(&quot;&lt;meta http-equiv=\&quot;refresh\&quot; content=\&quot;&quot;));</p><p> client.print(refreshPage);</p><p> client.println(F(&quot;; url=/\&quot;&gt;&quot;));</p><p> // add other browser configuration</p><p> client.println(F(&quot;&lt;meta name=\&quot;apple-mobile-web-app-capable\&quot; content=\&quot;yes\&quot;&gt;&quot;));</p><p> client.println(F(&quot;&lt;meta name=\&quot;apple-mobile-web-app-status-bar-style\&quot; content=\&quot;default\&quot;&gt;&quot;));</p><p> client.println(F(&quot;&lt;meta name=\&quot;viewport\&quot; content=\&quot;width=device-width, user-scalable=no\&quot;&gt;&quot;));</p><p> //inserting the styles data, usually found in CSS files.</p><p> client.println(F(&quot;&lt;style type=\&quot;text/css\&quot;&gt;&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> //This will set how the page will look graphically</p><p> client.println(F(&quot;html { height:100%; }&quot;));</p><p> client.println(F(&quot; body {&quot;));</p><p> client.println(F(&quot; height: 100%;&quot;));</p><p> client.println(F(&quot; margin: 0;&quot;));</p><p> client.println(F(&quot; font-family: helvetica, sans-serif;&quot;));</p><p> client.println(F(&quot; -webkit-text-size-adjust: none;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;body {&quot;));</p><p> client.println(F(&quot; -webkit-background-size: 100% 21px;&quot;));</p><p> client.println(F(&quot; background-color: #c5ccd3;&quot;));</p><p> client.println(F(&quot; background-image:&quot;));</p><p> client.println(F(&quot; -webkit-gradient(linear, left top, right top,&quot;));</p><p> client.println(F(&quot; color-stop(.75, transparent),&quot;));</p><p> client.println(F(&quot; color-stop(.75, rgba(255,255,255,.1)) );&quot;));</p><p> client.println(F(&quot; -webkit-background-size: 7px;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.view {&quot;));</p><p> client.println(F(&quot; min-height: 100%;&quot;));</p><p> client.println(F(&quot; overflow: auto;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.header-wrapper {&quot;));</p><p> client.println(F(&quot; height: 44px;&quot;));</p><p> client.println(F(&quot; font-weight: bold;&quot;));</p><p> client.println(F(&quot; text-shadow: rgba(0,0,0,0.7) 0 -1px 0;&quot;));</p><p> client.println(F(&quot; border-top: solid 1px rgba(255,255,255,0.6);&quot;));</p><p> client.println(F(&quot; border-bottom: solid 1px rgba(0,0,0,0.6);&quot;));</p><p> client.println(F(&quot; color: #fff;&quot;));</p><p> client.println(F(&quot; background-color: #8195af;&quot;));</p><p> client.println(F(&quot; background-image:&quot;));</p><p> client.println(F(&quot; -webkit-gradient(linear, left top, left bottom,&quot;));</p><p> client.println(F(&quot; from(rgba(255,255,255,.4)),&quot;));</p><p> client.println(F(&quot; to(rgba(255,255,255,.05)) ),&quot;));</p><p> client.println(F(&quot; -webkit-gradient(linear, left top, left bottom,&quot;));</p><p> client.println(F(&quot; from(transparent),&quot;));</p><p> client.println(F(&quot; to(rgba(0,0,64,.1)) );&quot;));</p><p> client.println(F(&quot; background-repeat: no-repeat;&quot;));</p><p> client.println(F(&quot; background-position: top left, bottom left;&quot;));</p><p> client.println(F(&quot; -webkit-background-size: 100% 21px, 100% 22px;&quot;));</p><p> client.println(F(&quot; -webkit-box-sizing: border-box;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.header-wrapper h1 {&quot;));</p><p> client.println(F(&quot; text-align: center;&quot;));</p><p> client.println(F(&quot; font-size: 20px;&quot;));</p><p> client.println(F(&quot; line-height: 44px;&quot;));</p><p> client.println(F(&quot; margin: 0;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.group-wrapper {&quot;));</p><p> client.println(F(&quot; margin: 9px;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.group-wrapper h2 {&quot;));</p><p> client.println(F(&quot; color: #4c566c;&quot;));</p><p> client.println(F(&quot; font-size: 17px;&quot;));</p><p> client.println(F(&quot; line-height: 0.8;&quot;));</p><p> client.println(F(&quot; font-weight: bold;&quot;));</p><p> client.println(F(&quot; text-shadow: #fff 0 1px 0;&quot;));</p><p> client.println(F(&quot; margin: 20px 10px 12px;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.group-wrapper h3 {&quot;));</p><p> client.println(F(&quot; color: #4c566c;&quot;));</p><p> client.println(F(&quot; font-size: 12px;&quot;));</p><p> client.println(F(&quot; line-height: 1;&quot;));</p><p> client.println(F(&quot; font-weight: bold;&quot;));</p><p> client.println(F(&quot; text-shadow: #fff 0 1px 0;&quot;));</p><p> client.println(F(&quot; margin: 20px 10px 12px;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.group-wrapper h4 {&quot;)); //Text for description</p><p> client.println(F(&quot; color: #212121;&quot;));</p><p> client.println(F(&quot; font-size: 14px;&quot;));</p><p> client.println(F(&quot; line-height: 1;&quot;));</p><p> client.println(F(&quot; font-weight: bold;&quot;));</p><p> client.println(F(&quot; text-shadow: #aaa 1px 1px 3px;&quot;));</p><p> client.println(F(&quot; margin: 5px 5px 5px;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> client.println(F(&quot;.group-wrapper table {&quot;));</p><p> client.println(F(&quot; background-color: #fff;&quot;));</p><p> client.println(F(&quot; -webkit-border-radius: 10px;&quot;));</p><p> client.println(F(&quot; -moz-border-radius: 10px;&quot;));</p><p> client.println(F(&quot; -khtml-border-radius: 10px;&quot;));</p><p> client.println(F(&quot; border-radius: 10px;&quot;));</p><p> client.println(F(&quot; font-size: 17px;&quot;));</p><p> client.println(F(&quot; line-height: 20px;&quot;));</p><p> client.println(F(&quot; margin: 9px 0 20px;&quot;));</p><p> client.println(F(&quot; border: solid 1px #a9abae;&quot;));</p><p> client.println(F(&quot; padding: 11px 3px 12px 3px;&quot;));</p><p> client.println(F(&quot; margin-left:auto;&quot;));</p><p> client.println(F(&quot; margin-right:auto;&quot;));</p><p> client.println(F(&quot; -moz-transform :scale(1);&quot;)); //Code for Mozilla Firefox</p><p> client.println(F(&quot; -moz-transform-origin: 0 0;&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> //how the green (ON) LED will look</p><p> client.println(F(&quot;.green-circle {&quot;));</p><p> client.println(F(&quot; display: block;&quot;));</p><p> client.println(F(&quot; height: 23px;&quot;));</p><p> client.println(F(&quot; width: 23px;&quot;));</p><p> client.println(F(&quot; background-color: #0f0;&quot;));</p><p> //client.println(F(&quot; background-color: rgba(60, 132, 198, 0.8);&quot;));</p><p> client.println(F(&quot; -moz-border-radius: 11px;&quot;));</p><p> client.println(F(&quot; -webkit-border-radius: 11px;&quot;));</p><p> client.println(F(&quot; -khtml-border-radius: 11px;&quot;));</p><p> client.println(F(&quot; border-radius: 11px;&quot;));</p><p> client.println(F(&quot; margin-left: 1px;&quot;));</p><p> client.println(F(&quot; background-image: -webkit-gradient(linear, 0% 0%, 0% 90%, from(rgba(46, 184, 0, 0.8)), to(rgba(148, 255, 112, .9)));@&quot;));</p><p> client.println(F(&quot; border: 2px solid #ccc;&quot;));</p><p> client.println(F(&quot; -webkit-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px;&quot;));</p><p> client.println(F(&quot; -moz-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;));</p><p> client.println(F(&quot; box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> //how the black (off)LED will look</p><p> client.println(F(&quot;.black-circle {&quot;));</p><p> client.println(F(&quot; display: block;&quot;));</p><p> client.println(F(&quot; height: 23px;&quot;));</p><p> client.println(F(&quot; width: 23px;&quot;));</p><p> client.println(F(&quot; background-color: #040;&quot;));</p><p> client.println(F(&quot; -moz-border-radius: 11px;&quot;));</p><p> client.println(F(&quot; -webkit-border-radius: 11px;&quot;));</p><p> client.println(F(&quot; -khtml-border-radius: 11px;&quot;));</p><p> client.println(F(&quot; border-radius: 11px;&quot;));</p><p> client.println(F(&quot; margin-left: 1px;&quot;));</p><p> client.println(F(&quot; -webkit-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px;&quot;));</p><p> client.println(F(&quot; -moz-box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;));</p><p> client.println(F(&quot; box-shadow: rgba(11, 140, 27, 0.5) 0px 10px 16px; /* FF 3.5+ */&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> //this will add the glare to both of the LEDs</p><p> client.println(F(&quot; .glare {&quot;));</p><p> client.println(F(&quot; position: relative;&quot;));</p><p> client.println(F(&quot; top: 1;&quot;));</p><p> client.println(F(&quot; left: 5px;&quot;));</p><p> client.println(F(&quot; -webkit-border-radius: 10px;&quot;));</p><p> client.println(F(&quot; -moz-border-radius: 10px;&quot;));</p><p> client.println(F(&quot; -khtml-border-radius: 10px;&quot;));</p><p> client.println(F(&quot; border-radius: 10px;&quot;));</p><p> client.println(F(&quot; height: 1px;&quot;));</p><p> client.println(F(&quot; width: 13px;&quot;));</p><p> client.println(F(&quot; padding: 5px 0;&quot;));</p><p> client.println(F(&quot; background-color: rgba(200, 200, 200, 0.25);&quot;));</p><p> client.println(F(&quot; background-image: -webkit-gradient(linear, 0% 0%, 0% 95%, from(rgba(255, 255, 255, 0.7)), to(rgba(255, 255, 255, 0)));&quot;));</p><p> client.println(F(&quot; }&quot;));</p><p> client.println(F(&quot;&quot;));</p><p> //and finally this is the end of the style data and header</p><p> client.println(F(&quot;&lt;/style&gt;&quot;));</p><p> client.println(F(&quot;&lt;/head&gt;&quot;));</p><p> //now printing the page itself</p><p> client.println(F(&quot;&lt;body&gt;&quot;));</p><p> client.println(F(&quot;&lt;div class=\&quot;view\&quot;&gt;&quot;));</p><p> client.println(F(&quot; &lt;div class=\&quot;header-wrapper\&quot;&gt;&quot;));</p><p> client.println(F(&quot; &lt;h1&gt;Ethernet Switching&lt;/h1&gt;&quot;));</p><p> client.println(F(&quot; &lt;/div&gt;&quot;));</p><p> //////</p><p>} //end of htmlHeader</p><p>////////////////////////////////////////////////////////////////////////</p><p>//htmlFooter Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html footer</p><p>void printHtmlFooter(EthernetClient client){</p><p> //Set Variables Before Exiting</p><p> printLastCommandOnce = false;</p><p> printButtonMenuOnce = false;</p><p> allOn = &quot;&quot;;</p><p> allOff = &quot;&quot;;</p><p> //printing last part of the html</p><p> client.println(F(&quot;\n&lt;h3 align=\&quot;center\&quot;&gt;Arduino porting - Zoomx &lt;br&gt; 12 - February - 2015 - V5.0&quot;));</p><p> client.println(F(&quot;\n&lt;h3 align=\&quot;center\&quot;&gt;Development - Chinh Truc &lt;br&gt; 01 - August - 2014 - V5.0&quot;));</p><p> client.println(F(&quot;\n&lt;h3 align=\&quot;center\&quot;&gt;&copy; Author - Claudio Vella &lt;br&gt; Malta - October - 2012 - &quot;));</p><p> client.println(rev);</p><p> client.println(F(&quot;&lt;/h3&gt;&lt;/div&gt;\n&lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt;&quot;));</p><p> delay(1); // give the web browser time to receive the data</p><p> client.stop(); // close the connection:</p><p> Serial.println(F(&quot; - Done, Closing Connection.&quot;));</p><p> delay (2); //delay so that it will give time for client buffer to clear and does not repeat multiple pages.</p><p>} //end of htmlFooter</p><p>////////////////////////////////////////////////////////////////////////</p><p>//printHtmlButtonTitle Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html button title</p><p>void printHtmlButtonTitle(EthernetClient client){</p><p> client.println(F(&quot;&lt;div class=\&quot;group-wrapper\&quot;&gt;&quot;));</p><p> client.println(F(&quot; &lt;h2&gt;Switch Device output.&lt;/h2&gt;&quot;));</p><p> client.println();</p><p>}</p><p>////////////////////////////////////////////////////////////////////////</p><p>//printLoginTitle Function</p><p>////////////////////////////////////////////////////////////////////////</p><p>//Prints html button title</p><p>void printLoginTitle(EthernetClient client){</p><p> // client.println(F(&quot;&lt;div class=\&quot;group-wrapper\&quot;&gt;&quot;));</p><p> client.println(F(&quot; &lt;h2&gt;Please enter the user data to login.&lt;/h2&gt;&quot;));</p><p> client.println();</p><p>}</p>
<p>How to drive a relay without a smartphone? How to connect the switch room light? Add the ability to connect switches.</p>

About This Instructable

184,242 views

337 favorites

License:

More by tcvella: RegisterWrite - extending the outputs of Arduino/Microcontroller  with shift registers ATTINY85 - The smallest Arduino Ethernet Switching - with Arduino
Add instructable to: