{"id":12260,"date":"2015-09-19T12:08:49","date_gmt":"2015-09-19T12:08:49","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=12260"},"modified":"2019-04-02T10:23:34","modified_gmt":"2019-04-02T10:23:34","slug":"esp8266-remote-controlled-sockets","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp8266-remote-controlled-sockets\/","title":{"rendered":"ESP8266 Remote Controlled Sockets"},"content":{"rendered":"<p>In this project your&#8217;re going to build a web server with an ESP8266 that can control remotely any sockets (safely).<!--more--><\/p>\n<p><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-12261\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/thumbnail-remote-controlled-sockets-700.jpg?resize=700%2C392&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"392\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/thumbnail-remote-controlled-sockets-700.jpg?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/thumbnail-remote-controlled-sockets-700.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p><strong>Before continue reading this project, please complete\u00a0the following tutorials:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-esp8266-wifi-transceiver-review\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to get started with the ESP8266<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/how-to-install-esp8266-board-arduino-ide\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Install the ESP8266 Board in Arduino IDE<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/rf-433mhz-transmitter-receiver-module-with-arduino\/\" target=\"_blank\" rel=\"noopener noreferrer\">Complete Guide for RF 433MHz Transmitter\/Receiver Module With Arduino<\/a><\/li>\n<\/ul>\n<p>If you like the ESP and you want to do more projects\u00a0you can read my eBook <a href=\"https:\/\/randomnerdtutorials.com\/home-automation-using-esp8266\/\" target=\"_blank\" rel=\"noopener noreferrer\">Home Automation using ESP8266 here<\/a>.<\/p>\n<p><strong>Let\u2019s get started!<\/strong><\/p>\n<h2>First, watch the step-by-step video tutorial below<\/h2>\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/SYcWr6U7azI?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<h2>Parts List<\/h2>\n<p>Here&#8217;s the hardware that you need to complete\u00a0this project:<\/p>\n<ul>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/esp-01-wi-fi-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">1x\u00a0ESP8266<\/a> &#8211; read <a href=\"https:\/\/makeradvisor.com\/best-esp8266-wi-fi-development-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">Best ESP8266 Wi-Fi Development Boards<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/ftdi-programmer-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">1x\u00a0FTDI programmer<\/a><\/li>\n<li>1x <a href=\"https:\/\/makeradvisor.com\/tools\/compatible-arduino-uno-r3-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">Arduino UNO<\/a>\u00a0\u2013 read\u00a0<a href=\"https:\/\/makeradvisor.com\/best-arduino-starter-kits\/\" target=\"_blank\" rel=\"noopener noreferrer\">Best Arduino Starter Kits<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/433mhz-receiver-transmitter-module\/\" target=\"_blank\" rel=\"noopener noreferrer\">1x 433MHz Receiver\/Transmitter module<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/rf-remote-controlled-sockets-433mhz\/\" target=\"_blank\" rel=\"noopener noreferrer\">Remote and sockets that work\u00a0at 433MHz<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noopener noreferrer\">Jumper wires<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/makeradvisor.com\/tools\/esp-01-wi-fi-board\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter wp-image-4815\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?resize=224%2C224&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"224\" height=\"224\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/01\/ESP01v0.jpg?resize=300%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 224px) 100vw, 224px\" \/><\/a><\/p>\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n<h2>Remote Controlled Sockets (433MHz)<\/h2>\n<p>You can buy remote controlled sockets in any store or your can buy them on <a href=\"http:\/\/ebay.to\/1KkYpvp\" target=\"_blank\" rel=\"noopener noreferrer\">eBay<\/a>. Keep in mind that they need to communicate via RF at 433MHz. Here&#8217;s my setup:<\/p>\n<ul>\n<li>Remote control &#8211; channel I<\/li>\n<li>Socket 1 &#8211; channel I and mode 1<\/li>\n<li>Socket 2\u00a0&#8211; channel I and mode\u00a03<\/li>\n<\/ul>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter size-full wp-image-12270\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/remote-controlled.png?resize=600%2C338&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"remote controlled\" width=\"600\" height=\"338\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/remote-controlled.png?w=600&amp;quality=100&amp;strip=all&amp;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/remote-controlled.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>RC Switch Library Download<\/h3>\n<p>Here\u2019s the Arduino library\u00a0you need for this project:<\/p>\n<ol>\n<li>Download the <strong><a href=\"https:\/\/github.com\/sui77\/rc-switch\" target=\"_blank\" rel=\"noopener noreferrer\">RC Switch\u00a0library<\/a><\/strong><\/li>\n<li>Unzip the RC Switch library<\/li>\n<li>Remove the &#8220;-&#8221; from the folder name, otherwise your Arduino IDE won&#8217;t recognize your library<\/li>\n<li>Install the RC Switch library in your Arduino IDE<\/li>\n<li>Restart your Arduino IDE<\/li>\n<\/ol>\n<p>The RC Switch library is great and it works with almost all remote controlled sockets in the market.<\/p>\n<h2>Receiver Circuit<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/433mhz-receiver-circuit-esp8266-Copy.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12262\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/433mhz-receiver-circuit-esp8266-Copy.jpg?resize=717%2C415&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"433mhz receiver circuit esp8266 - Copy\" width=\"717\" height=\"415\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/433mhz-receiver-circuit-esp8266-Copy.jpg?w=1323&amp;quality=100&amp;strip=all&amp;ssl=1 1323w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/433mhz-receiver-circuit-esp8266-Copy.jpg?resize=300%2C173&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/433mhz-receiver-circuit-esp8266-Copy.jpg?resize=1024%2C592&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 717px) 100vw, 717px\" \/><\/a><\/p>\n<p>Follow the circuit above for your receiver. Then upload the code below or you can go to File &gt; Examples &gt; RC Switch &gt; ReceiveDemo_Advanced.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at http:\/\/randomnerdtutorials.com  \n*********\/\n\n#include &lt;RCSwitch.h&gt;\n\nRCSwitch mySwitch = RCSwitch();\n\nvoid setup() {\n  Serial.begin(9600);\n  mySwitch.enableReceive(0);  \/\/ Receiver on inerrupt 0 =&gt; that is pin #2\n}\n\nvoid loop() {\n  if (mySwitch.available()) {\n    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());\n    mySwitch.resetAvailable();\n  }\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ReceiveDemo_Advanced.ino\" target=\"_blank\">View raw code<\/a><\/p>\n<h2>Save the TriState Values<\/h2>\n<p>Open your Arduino serial monitor at a baud rate of 9600 and start pressing the buttons of your remote. Save the TriState values (highlighted in red) of each key in a notepad. <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/tristatevalues.png?resize=650%2C268&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"tristatevalues\" width=\"650\" height=\"268\" \/><\/p>\n<h2>Schematics (3.3V FTDI\u00a0Programmer)<\/h2>\n<p>The schematics to upload code to your ESP8266 are very straight forward. You only need to establish a serial communication between your FTDI programmer and your ESP8266 to upload some code. <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5480\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/05\/Flashing-Firmware-FTDI-Programmer.png?resize=700%2C189&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Flashing Firmware - FTDI Programmer\" width=\"700\" height=\"189\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/05\/Flashing-Firmware-FTDI-Programmer.png?w=756&amp;quality=100&amp;strip=all&amp;ssl=1 756w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/05\/Flashing-Firmware-FTDI-Programmer.png?resize=300%2C81&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2>Uploading your ESP8266 code<\/h2>\n<p>Having the ESP8266 add-on for the Arduino IDE installed (<a href=\"https:\/\/randomnerdtutorials.com\/how-to-install-esp8266-board-arduino-ide\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Install the ESP8266 Board in Arduino IDE<\/a>). Go to Tools and select &#8220;Generic ESP8266 Module&#8221;. <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12152\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Arduino-IDE-select-esp8266.png?resize=367%2C432&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Arduino IDE select esp8266\" width=\"367\" height=\"432\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Arduino-IDE-select-esp8266.png?w=600&amp;quality=100&amp;strip=all&amp;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Arduino-IDE-select-esp8266.png?resize=255%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 255w\" sizes=\"(max-width: 367px) 100vw, 367px\" \/> Copy the sketch below to your Arduino IDE. Replace the SSID and password with your own credentials. You also need to change the TriState values. After modifying my sketch upload it to your ESP8266.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at http:\/\/randomnerdtutorials.com  \n*********\/\n\n#include &lt;ESP8266WiFi.h&gt;\n#include &lt;WiFiClient.h&gt;\n#include &lt;ESP8266WebServer.h&gt;\n#include &lt;ESP8266mDNS.h&gt;\n#include &lt;RCSwitch.h&gt;\n\nRCSwitch mySwitch = RCSwitch();\nMDNSResponder mdns;\n\n\/\/ Replace with your network credentials\nconst char* ssid = &quot;YOUR_SSID&quot;;\nconst char* password = &quot;YOUR_PASSWORD&quot;;\n\nESP8266WebServer server(80);\n\n\/\/ Replace with your remote TriState values\nchar* socket1TriStateOn = &quot;0FFF0FFFFFFF&quot;;\nchar* socket1TriStateOff = &quot;0FFF0FFFFFF0&quot;;\nchar* socket2TriStateOn = &quot;0FFFFF0FFFFF&quot;;\nchar* socket2TriStateOff = &quot;0FFFFF0FFFF0&quot;;\n\nString webPage = &quot;&quot;;\n \nvoid setup(void){\n  webPage += &quot;&lt;h1&gt;ESP8266 Web Server&lt;\/h1&gt;&lt;p&gt;Socket #1 &lt;a href=\\&quot;socket1On\\&quot;&gt;&lt;button&gt;ON&lt;\/button&gt;&lt;\/a&gt;&amp;nbsp;&lt;a href=\\&quot;socket1Off\\&quot;&gt;&lt;button&gt;OFF&lt;\/button&gt;&lt;\/a&gt;&lt;\/p&gt;&quot;;\n  webPage += &quot;&lt;p&gt;Socket #2 &lt;a href=\\&quot;socket2On\\&quot;&gt;&lt;button&gt;ON&lt;\/button&gt;&lt;\/a&gt;&amp;nbsp;&lt;a href=\\&quot;socket2Off\\&quot;&gt;&lt;button&gt;OFF&lt;\/button&gt;&lt;\/a&gt;&lt;\/p&gt;&quot;;\n  mySwitch.enableTransmit(2);\n  delay(1000);\n  Serial.begin(115200);\n  WiFi.begin(ssid, password);\n  Serial.println(&quot;&quot;);\n\n  \/\/ Wait for connection\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(500);\n    Serial.print(&quot;.&quot;);\n  }\n  Serial.println(&quot;&quot;);\n  Serial.print(&quot;Connected to &quot;);\n  Serial.println(ssid);\n  Serial.print(&quot;IP address: &quot;);\n  Serial.println(WiFi.localIP());\n  \n  if (mdns.begin(&quot;esp8266&quot;, WiFi.localIP())) {\n    Serial.println(&quot;MDNS responder started&quot;);\n  }\n  \n  server.on(&quot;\/&quot;, [](){\n    server.send(200, &quot;text\/html&quot;, webPage);\n  });\n  server.on(&quot;\/socket1On&quot;, [](){\n    server.send(200, &quot;text\/html&quot;, webPage);\n    mySwitch.sendTriState(socket1TriStateOn);\n    delay(1000);\n  });\n  server.on(&quot;\/socket1Off&quot;, [](){\n    server.send(200, &quot;text\/html&quot;, webPage);\n    mySwitch.sendTriState(socket1TriStateOff);\n    delay(1000); \n  });\n  server.on(&quot;\/socket2On&quot;, [](){\n    server.send(200, &quot;text\/html&quot;, webPage);\n    mySwitch.sendTriState(socket2TriStateOn);\n    delay(1000);\n  });\n  server.on(&quot;\/socket2Off&quot;, [](){\n    server.send(200, &quot;text\/html&quot;, webPage);\n    mySwitch.sendTriState(socket2TriStateOff);\n    delay(1000); \n  });\n  server.begin();\n  Serial.println(&quot;HTTP server started&quot;);\n}\n \nvoid loop(void){\n  server.handleClient();\n} \n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP8266_Remote_Controlled_Outlet.ino\" target=\"_blank\">View raw code<\/a><\/p>\n<h2>ESP8266 IP Address<\/h2>\n<p>Open the Arduino serial monitor at a baud rate of 115200. Connect GPIO 0 of your ESP8266 to VCC and reset your board.<\/p>\n<p>After a few seconds your IP address should appear. In my case it&#8217;s <strong>192.168.1.70<\/strong>.<\/p>\n<h2><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12273\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-ip-address.png?resize=565%2C318&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp ip address\" width=\"565\" height=\"318\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-ip-address.png?w=928&amp;quality=100&amp;strip=all&amp;ssl=1 928w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-ip-address.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/h2>\n<h2>Final Circuit<\/h2>\n<p>This is the final circuit for your ESP8266\u00a0that hosts a web server and transmits RF signals to control your sockets.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-with-433Mhz-Copy.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12263\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-with-433Mhz-Copy.jpg?resize=704%2C320&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"esp with 433Mhz - Copy\" width=\"704\" height=\"320\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-with-433Mhz-Copy.jpg?w=1545&amp;quality=100&amp;strip=all&amp;ssl=1 1545w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-with-433Mhz-Copy.jpg?resize=300%2C136&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/esp-with-433Mhz-Copy.jpg?resize=1024%2C465&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 704px) 100vw, 704px\" \/><\/a><\/p>\n<h2>Demonstration<\/h2>\n<p>For the final demonstration open any browser from a device that is connected to the same router that your ESP is. Then type\u00a0the IP address and click Enter!<\/p>\n<h2><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12275\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Screenshot_2015-09-15-18-31-331.png?resize=480%2C345&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Screenshot_2015-09-15-18-31-33\" width=\"480\" height=\"345\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Screenshot_2015-09-15-18-31-331.png?w=480&amp;quality=100&amp;strip=all&amp;ssl=1 480w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Screenshot_2015-09-15-18-31-331.png?resize=300%2C216&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/h2>\n<p>Now when you press the buttons in your web server you can control both sockets (<strong>watch the video<\/strong> at the beginning of this project\u00a0for a live demo).<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12280\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/on-and-off-sockets1.png?resize=600%2C388&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"on and off sockets\" width=\"600\" height=\"388\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/on-and-off-sockets1.png?w=600&amp;quality=100&amp;strip=all&amp;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/on-and-off-sockets1.png?resize=300%2C194&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Do you have any questions?\u00a0Leave a comment down below!<\/p>\n<p>Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my <a href=\"https:\/\/randomnerdtutorials.com\/download\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a> and my\u00a0Facebook Page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this project your&#8217;re going to build a web server with an ESP8266 that can control remotely any sockets (safely).<\/p>\n","protected":false},"author":1,"featured_media":12261,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,245,214,265,246,300,240,264,218],"tags":[],"class_list":["post-12260","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-arduino-ide","category-esp8266","category-esp8266-project","category-esp8266-arduino-ide","category-0-esp8266","category-esp8266-projects","category-project","category-web-server"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/thumbnail-remote-controlled-sockets-700.jpg?fit=700%2C392&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/12260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=12260"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/12260\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/12261"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=12260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=12260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=12260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}