Browse over 10,000 Electronics Projects

The ESP WiFi Shield: the best value for money and low energy consumption

The ESP WiFi Shield: the best value for money and low energy consumption

Please open Arduino Serial Monitor and set the communication to 9,600 bps, and activate both the end of the line and the return (both NL and CR), therefore please send the AT string and wait for an answer, if everything is fine the module will reply with “OK”. This first transmission does absolutely nothing, but allows to understand if the module is active and operating; at the start the module sends the “ready…” string anyway. The sending of the AT+RST string enables the execution of a device software reset, it will answer with the “OK” string, followed by the manufacturer’s name and by some pieces of the chip’s internal data. The AT+GMR string allows to know the firmware’s version installed. With this configuration the ESP8266 module will be able to communicate with whatever PC application such as Processing, or with any serial monitor.



We may become even more familiar with the module, by trying to connect to the home WiFi; the AT+CWMODE=1 command allows to set the access to a router while the AT+CWJAP=”nomerete”,”password” allows to access it. In order to know if the connection came to a successful ending, it is possible to ask the module about the connection’s status, by means of the AT+CWJAP? command, while in order to know the IP address assigned by the router, the command is the following one: AT+CIFSR.

As soon as we are connected to the network, we may test some of the module’s functions; as an example, by making it operate as a server towards the PC; in order to do so it is needed to start a very simple client on the PC, for example by using a portable software named SocketTest, a sort of serial monitor for Ethernet networks. We will send the following commands, in sequence:




please send a 4 characters string – for example, “ciao” – and disable the sending of the end of the line and the end of the line and the return.

The reception of a string from the server will be signalled by the “+IPD” string, followed by the number of characters received and then by the text received.

We tried different configurations, by using the module both as a client and as a server and also with a UDP communication started, in any case it has always been simple and quick to set the module with a few AT commands.


In the various available listings, you will always find a first part that is related to the communication mode with the ESP module and to the debug mode, in fact in these first examples it is always very handy to consider a mode for the purpose of viewing the data transiting from the module. By connecting the ESPTX jumper to the D8 line and the ESPRX jumper to the D9 line, it will be possible to manage the module by using a software serial, and by leaving ATME328’s UART module free to communicate with the PC via the debug and programming functions. This mode works only with the ESP modules communicating at 9,600 bps, a mode that anyway shows its limits in the case of management of important data flows, containing more than a hundred characters: that is the case – for example – of the webpages’ management.

We will remember that all the examples we proposed must be customized, by typing the name of your WiFi network and the password, respectively in the SSID and PASS fields.

In addition to the classic application as a webserver, we have designed an application like a web client, so to show the ease with which it is possible to request information from Internet websites. The only data to be supplied regards the server’s address and the name of the page to be accessed; in the listing you will find (as comments) different examples of settings we personally verified, among which there is the interrogation to Google’s server or the reading of meteo data from the openweathermap’s server. This last example is particularly interesting for the possibility to know the weather conditions by querying the closest weather station, without the need to use any sensor; there is also the possibility to request the weather forecast for the next days; the only data to be inserted is the code for the city you are requesting the data, and it may be acquired at this address: Similarly it is possible to query Yahoo’s server in order to know the date and the current time.

In these last examples we have used the classic html syntax that is composed of three sections: request (request row), body (message body) and header (additional information). The request section, in turn, is composed of three fields. The first field is the access method and it may be of the GET (information recovery), POST (information sending), HEADER (like GET, but it only receives the page’s header) type. After the method, the URI (Uniform Resource Identifier) must be specified, that is to say the address of the page we want to access, and lastly, we need to specify the protocol’s version, in our case,.mpi : a method, an URI (the address of the page we are requesting) and the “HTTP/1.1” protocol version.



Pages: 1 2 3 4 5 6 7 8