📜 ⬆️ ⬇️

ESP8266: A Revolution in the Internet of Things



In the not so distant times, device support for a Wi-Fi connection 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. Costing very appreciable money.

But life goes on. Technology is developing rapidly. The term “Internet of Things” is increasingly heard. Many chip manufacturers, large and small, have finally become topical to solve the eternal problem of integrating Wi-Fi into small and inexpensive devices. To be able to connect them directly to the infrastructure that is already available in almost every home. To eat off 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 chip ESP8266 Chinese company Espressif. UART-WIFI modules based on this chip have already flooded the whole of China and they cost only $ 4.5 (with free international shipping).



UART-WIFI bridge on ESP8266


The module can already be purchased on Taobao, AliExpress and in many other places. There is little available documentation, but the AT work guide can be freely downloaded not even in Chinese anymore. Online begin to appear examples of working with the module for Arduino:



#include <SoftwareSerial.h> #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, the typical strapping of the chip consists of only seven elements. The module board is almost empty, the components - a tiny amount. All this will naturally affect the cost of end devices towards cheaper.

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



Here is a module based on the Marvell chipset, "


What is the revolution?


With the advent of such low-cost solutions, even home developers of various arduino solutions of “smart houses” have the opportunity to connect their devices to a Wi-Fi network, which is not yet available. ESP8266 is already called the “killer of NRF24LE1” on the Internet. At even lower cost, modules based on the ESP8266 offer much more options. Now in devices on the Arduino 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, light control devices, water and any other "things" that surround every person in their daily lives.

Source: https://habr.com/ru/post/235881/


All Articles