ESP8266: A Revolution in the World of the Internet of Things



    In not so distant times, support for a Wi-Fi connection by a device was expensive, cumbersome, and not energy efficient. Developers were forced to use radio interfaces based on various competing solutions. Invented their "bikes" at the protocol level. And they got into the coveted Wi-Fi only with the use of additional devices that implement the functionality of the bridge. Worth very noticeable money.

    But life goes on. Technology is developing rapidly. The term “Internet of things” is increasingly heard. Many chip manufacturers, large and not very, have finally become urgent to solve the eternal problem of integrating Wi-Fi into small and inexpensive devices. To be able to connect them directly to the infrastructure already available in almost every home. To eat as much as possible a piece of the upcoming new market of simple devices connected to the network.

    In 2014, several manufacturers announced the release of the corresponding chipsets. Today we will talk about the ESP8266 chip of the Chinese company Espressif. UART-WIFI modules based on this chip have already flooded all of China and they cost only $ 4.5 (with free international shipping).



    UART-WIFI bridge on ESP8266


    The module can already be bought on Taobao, AliExpress and in many other places. There is not much available documentation, but the manual on working through AT commands can be freely downloaded, even not only in Chinese. Examples of working with the module for Arduino begin to appear on the network :



     #include 
       #define SSID "xxxxxxxx"
       #define PASS "xxxxxxxx"
       #define DST_IP "220.181.111.85" //baidu.com
       SoftwareSerial dbgSerial(10, 11); // RX, TX
       void setup()
       {
         // Open serial communications and wait for port to open:
         Serial.begin(57600);
         Serial.setTimeout(5000);
         dbgSerial.begin(9600); //can't be faster than 19200 for softserial
         dbgSerial.println("ESP8266 Demo");
         //test if the module is ready
         Serial.println("AT+RST");
         delay(1000);
         if(Serial.find("ready"))
         {
           dbgSerial.println("Module is ready");
         }
         else
         {
           dbgSerial.println("Module have no response.");
           while(1);
         }
         delay(1000);
         //connect to the wifi
         boolean connected=false;
         for(int i=0;i<5;i++)
         {
           if(connectWiFi())
           {
             connected = true;
             break;
           }
         }
         if (!connected){while(1);}
         delay(5000);
         //print the ip addr
         /*Serial.println("AT+CIFSR");
         dbgSerial.println("ip address:");
         while (Serial.available())
         dbgSerial.write(Serial.read());*/
         //set the single connection mode
         Serial.println("AT+CIPMUX=0");
       }
       void loop()
       {
         String cmd = "AT+CIPSTART=\"TCP\",\"";
         cmd += DST_IP;
         cmd += "\",80";
         Serial.println(cmd);
         dbgSerial.println(cmd);
         if(Serial.find("Error")) return;
         cmd = "GET / HTTP/1.0\r\n\r\n";
         Serial.print("AT+CIPSEND=");
         Serial.println(cmd.length());
         if(Serial.find(">"))
         {
           dbgSerial.print(">");
           }else
           {
             Serial.println("AT+CIPCLOSE");
             dbgSerial.println("connect timeout");
             delay(1000);
             return;
           }
           Serial.print(cmd);
           delay(2000);
           //Serial.find("+IPD");
           while (Serial.available())
           {
             char c = Serial.read();
             dbgSerial.write(c);
             if(c=='\r') dbgSerial.print('\n');
           }
           dbgSerial.println("====");
           delay(1000);
         }
         boolean connectWiFi()
         {
           Serial.println("AT+CWMODE=1");
           String cmd="AT+CWJAP=\"";
           cmd+=SSID;
           cmd+="\",\"";
           cmd+=PASS;
           cmd+="\"";
           dbgSerial.println(cmd);
           Serial.println(cmd);
           delay(2000);
           if(Serial.find("OK"))
           {
             dbgSerial.println("OK, Connected to WiFi.");
             return true;
             }else
             {
               dbgSerial.println("Can not connect to the WiFi.");
               return false;
             }
           }
    




    Interesting circuitry, comparison with competitors


    From the Espressif press releases, it is noticeable that the manufacturer is proud of the degree of integration of its chip components. Indeed, a typical strapping of a microcircuit consists of only seven elements. The module board is almost empty, the components are scanty. All this will naturally affect the cost of end devices in the direction of cheaper prices.

    If you look at the products of competitors, the gain in minimizing staffing becomes even more obvious. This is a typical module based on MT7681, a competing solution from Mediatek:



    Here is a module based on the chipset from Marvell, “a highly cost-effective, flexible and easy-to-use hardware / software platform to build a new generation of connected device”:


    What is the revolution?


    With the advent of such low-cost solutions, even home developers of various arduino-solutions of “smart homes” have the opportunity to connect their devices to a Wi-Fi network, which is still inaccessible. ESP8266 is already called on the Internet "the killer NRF24LE1." At even lower cost, modules based on the ESP8266 promise much more features. Now, on Arduino devices, it will be possible to simply and inexpensively implement both a full-fledged web interface and a convenient JSON API.

    Advanced developers will be able to use the chip as the main processor in their solutions with wireless sensors, control devices for light, water and any other “things” that surround each person in his daily life.

    Also popular now: