ESP8266 and Arduino, plugged in, pinned out. ESP8266 firmware, programming in Arduino IDE Esp 01 connection

Golovna / Nalashtuvannya

For RemoteXY robots, the ESP8266 module is to blame for the mother version of the firmware with the support of AT commands no lower than v0.40. To check the version of the module, as well as change the firmware as needed, connect the module to the computer through the last port. The module can be connected via Arduino board or USB-UART adapter.

Connection via Arduino board

When the Arduino is turned on, the main ATmega chip is switched to the skid-down mode, and the USB-UART switch is actively disabled. For which the RESET contact is grounded. Contacts RX and TX are connected to the ESP8266 without a middle, and not crosswise, yakby stinks were connected to work with a controller.

Connected via USB-UART adapter

The changeover is due to the mother of the 3.3V power supply for the life of the ESP8266. It is also possible to secure the necessary strum not less than 200mA.



The CPIO0 pin indicates the operating mode of the module. If the contact is not connected, the module will work in the normal mode and will override AT commands. When the ground contact is shorted, the module is switched to the firmware update mode. Switching the module to the firmware mode will ensure that the CPIO0 contact is connected to the “ground” at the moment power is applied to the module. If you connect a contact with the module, the module will not switch to the firmware upgrade mode.

Rechecking the streaming version

For strengthening AT commands and revising the data, it is necessary to change the monitor program of the serial port. It's better to use the Arduino IDE terminal program. In the program, it is necessary to set the command management mode with the final character to shift the row and turn the carriage. The speed of the work of the module for locking is 115,200 bits / sec. For the operation of the module in the normal mode, the CPIO0 contact can be switched off.

You can check the current version of the firmware using the additional AT command: AT+GMR. Butt type of module:

AT version:0.40.0.0(Aug 8 2015 14:45:58)
SDK version:1.3.0

Build:1.3.0.2 Sep 11 2015 11:48:04
OK

Also, it is possible to recognize the flash memory of your module, so that you can update the data acquisition address when updating the firmware. This manual describes the firmware of the module with a flash memory size of 8Mbit(512KB+512KB) or 16Mbit(1024KB+1024KB) as the largest. The expansion of flash memory can be recognized by entering the AT command to drop the module: AT+RST.

Ets Jan 8 2013,rst cause:2, boot mode:(3,1)

Load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0

2nd boot version: 1.4(b1)
SPI Speed: 40MHz
SPI Mode: DIO
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

#t#n"t use rtc mem data
slprlMe
Ai-Thinker Technology Co.,Ltd.

Firmware program

To update the firmware, it is necessary to download the firmware program for the firmware itself. The ESP8266 firmware will hack Flash Download Tools v2.4 from the Espressif Systems official website. Sending to the side of the attraction on the official site:. You need to go to the "Tools" section.

Download the program from our file directory: FLASH_DOWNLOAD_TOOLS_v2.4_150924.rar

Firmware

The firmware can also be downloaded from the official website. Sending to the side of the attraction on the official site:. You need to go to the "SDKs & Demos" distribution and download the ESP8266 NONOS SDK firmware v1.3.0 or later. For the same firmware version, support for AT commands v0.40 and more has been implemented.

Send for firmware from our file folder: esp8266_nonos_sdk_v1.4.0_15_09_18_0.rar

The files must be unpacked and placed in a directory, where the path to the files is stored only in Latin characters, so without the characters of the localization of the movie.

Nalashtuvannya

We start the Flash Download Tools v2.4 firmware program (the same .exe file). It is necessary to enter the files correctly in the window, which will be taken, and the order will be finalized.


The downloaded files are located in the bin directory with the firmware. For a skin file, it is necessary to enter the correct acquisition address. Use the following table to select files and given address:

Install the following settings:

  • SPIAutoSet - inserts;
  • CrystalFreq - 26M;
  • FLASH SIZE - 8Mbit or 16Mbit optionally available for flash memory expansion;
  • COM PORT – select the port to which ESP is connected;
  • BAUDRATE-115200

To start the firmware, you need to press the "START" button.

Sequence of files for ESP8266 firmware

1. Connect the module to the computer using the connection diagram for this article.

2. Open the serial port monitor. Change the AT commands AT+RST and AT+GMR to select the current firmware version and the module memory size. This croc also allows you to check the correctness of the module connection.

3. Run the Flash Download Tools firmware program, properly install the files that will be taken, install the patch.

4. Disable the life of the ESP8266 module.

5. Connect the CPIO0 pin to ground.

6. Power up the ESP8266 module.

7. Press the START button on the firmware program

8. Dock the completion of the module firmware. After the firmware appears, write FINISH green color.

9. Check the life of the ESP8266 module. Remove the ground from the CPIO0 pin.

10. Enable module, start serial port monitor. Switch to the module and the new firmware version by typing the AT command AT+GMR.

Wi-Fi module ESP-01 is the most popular module of the ESP8266 series. The connection with a computer or a microcontroller is connected via UART for an additional set of AT commands. In addition, the module can be tweaked as an independent attachment, for which it is necessary to install your own firmware. You can program and download the firmware through the Arduino IDE version 1.6.5. To flash the module, you need a UART-USB adapter. The ESP-01 module can be wide-width for use in IoT (Internet of speech) applications.

Technical characteristicsmodule

  • WiFi 802.11b/g/n
  • WiFi modes: client, hotspot
  • External tension - 19.5 dB
  • Live voltage - 1.8 -3.6 V
  • Strum calming - 220 mA
  • GPIO ports: 4
  • Processor clock frequency - 80 MHz
  • Memory capacity for code
  • RAM - 96 KB
  • Rosemary - 13×21 mm

Connection

Let's look at the AT command mode. For this, we connect the module to the computer via a USB-UART adapter. Assignment of module options (div. figure 1):
  • VCC - +3.3
  • GND - ground
  • RX, TX - UART pins
  • CH_PD - Chip enable
  • GPIO0, GPIO2 - digital contacts
The module needs a living 3.3.

Figure 1. ESP-01 module pin assignments

Connection diagram for interfacing with the module in AT command mode (Figure 2):

Figure 2. Scheme of connecting the ESP-01 module to the computer via the port

Figure 3. Collection scheme

For strengthening AT-commands in Mac OS X, you can tweak the CoolTerm program, in the Windows operating system, the Termite program. Recognition of the COM-port security for connecting to the module is possible only experimentally, for different firmware it can be different. For my module, the speed was 9600 baud. In addition, the installation of the exchange was only possible after the reconnection was turned on until the CH_PD output was alive. After the connection is typed in the AT terminal and may be removed from the OK module input. The AT+GMR command displays the firmware version number of the module, the AT+RST command - re-mounts the module (div. small 4). The list of basic AT commands can be viewed in this document (ESP8266ATCommandsSet.pdf).

Figure 4. Sending AT commands to the module from the Termite program

If the AT command mode is not for you, the board can be adjusted using the AppStack ESP8266 Config program, you can install it using http://esp8266.ru/download/esp8266-utils/ESP8266_Config.zip. The old look of the program representations of the little one 5. Setting up the module is built with the help of a graphical interface; At the monitor, you can also send AT commands from the command line.

Figure 5. AppStack ESP8266 Config Program

Figure 6. Serial monitor in AppStack ESP8266 Config

There are two options for using this module:

  • at the link with a microcontroller (for example, Arduino), a kind of keruvatime module via UART;
  • writing a custom firmware for the ESP8266 wiki as an independent attachment.

Butt vikoristannya

Let's take a look at the connection to the ESP-01 module of the moisture and temperature sensor DHT11 and the power of data from the dark service ThingSpeak (https://thingspeak.com/). We need the following details:
  • ESP-01 module
  • breadboard board
  • humidity and temperature sensor DHT11
  • resistor 10k
  • zadnuvalni darts
  • living block 3 - 3.6V
We connect the DS18B20 sensor to the ESP-01 module. DS18B20 is a digital temperature sensor that works with a single-wire 1-Wire interface. The diagram for connecting the DS18B20 sensor to the module is shown in fig. 7.

7. Scheme of connecting the DHT11 sensor to the ESP-01 module.

Then you need to create a profile with the ThingSpeak service. The service has instructions for raising data from the service and removing data from the service.

Figure 8. Scheme at the collection.

The program is written in the Arduino IDE for ESP8266. We will chicory the ESP8266WiFi.h libraries and OneWire.h. Listing 1 sketch for the Arduino board - removing data from the temperature sensor and overpowering data from the ThingSpeak service. You need to enter your data for the WiFi access point for the ESP-01 module:

  • const char *ssid;
  • const char *password;
as well as the privateKey parameter for your program in the ThingSpeak service. Listing 1 // website // Include robot library with esp8266 # include // Include DHT library before DHT11 #include // pin connected to the DATA pin #define DHTPIN 4 // sensor DHT11 #define DHTTYPE DHT11 // instantiation of the DHT object DHT dht(DHTPIN, DHTTYPE); // ssid WiFi connections const char ssid = "********"; // Wi-Fi password of the connection merge const char password = "******"; // ThingSpeak server const char * host = "184.106.153.149"; // API KEY of your ThingSpeak program const char * privateKey = "*************** *"; // Changes to save temperature and moisture float temp; floating humidity; // change the interval of muting unsigned long millis_int1=0; void setup() ( // start the serial port Serial.begin(115200); delay(10); Serial.print("Connect to WiFi"); Serial.println(ssid); // Connect via WiFi WiFi.begin (ssid) , password), while (WiFi.status() != WL_CONNECTED) ( delay(500); ) Serial.println("WiFi connected"); check interval 10 times if(milis()-millis_int1>=10*60000) ( Serial.print("connect to ThingSpeak"); Serial.println(host); // WiFi Client WiFiClient client; if (!client.connect ) (host, 80)) ( Serial. println("connection failed"); return; ) // get temperature data temp = get_data_temperature(); humidity = get_data_humidity(); // Create a URL with a request for the server String url = "/ update?key="; url += privateKey; url += "&temp="; url += temp; url += "&humidity="; url += humidity; // Can be sent to server client.print(String(" GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "Connection: close\r\ n\r\n");delay(10); // ThingSpeak server response while(client.available())( String req = client.readStringUntil("\r"); Serial.print(req); ) ) ) Now the ThingSpeak service can display a graph showing our DHT11 temperature sensor (Malyunok 9).

Figure 9. Graph of the reading of the temperature sensor DS18B20 for the ThingSpeak service.

Food Parts FAQ

1. The module is not supportedAT commands
  • Reverse the correct connection of the module;
  • Reverse the correct connection of Rx, Tx contacts to the UART-USB adapter;
  • Change the connection to the CH_PD contact to 3.3;
  • Experimentally pick up the exchange rate on the serial port.
2. The ESP-01 module does not take temperature data from the sensorDHT11
  • Check the correct connection of the DHT11 sensor to the module.
3. Data is not transmitted to the ThingSpeak service
  • Change the connection of the module to the WiFi access point;
  • Change the connection of the WiFi access point to the Internet;
  • Reverse the correctness of the question before ThingSpeak.

At the process of developing and designing more and more folding projects, the time has come, if you need to learn how to work with such a broad type of connection like WiFi. So, as such, this type of communication can allow you to comfortably create a single line for your smart home appliances and use them, for example, from a mobile phone, a tablet or a computer, to create a smart smart home that will cost you dozens of times cheaper, lower buy ready solutions at the store. The stagnation of WiFi is obviously not limited to this and the application of this kind of communication of the flooring is rich, so that you can’t override them, and even if you squandered it on the other side, it means that you need WiFi, you need it, I got it right.

We will decide on the basis of the found and the most popular WiFi module ESP8266-01. You can buy the WiFi ESP8266-01 module on our website.

One of the main pluses of such a module is the presence of the memory of its microcontroller on the board, which allows you to work with it on your own, embedding the sketch directly into the module itself.

We won’t be able to modify the ESP8266 WiFi module really, but if you learn how to work with one, you can easily start working with others. I would like to know that a robot with WiFi can be done with unforgivable busyness, and since your luggage has few completed projects, it’s better to work on WiFi for the time being and to win over your radio communication projects, a robot with it is quite simple for a richer mind. By robots with WiFi modules, they create a number of splnnots and thematic forums, which in some cases bring more people to the surface, it’s important to sort out this type of call, and re-reading all the information, most people simply give up. It’s better for everything, and I can’t give up all the important information to contain within the framework of just one article, that one can’t be in the same sense, otherwise we’ll see the black rogue. I will try five ways of summing up the sequences of the most important moments, so that you could begin to understand the principle of working with this type of connection and then simply develop your own skills in this way directly.

І so, let's get started і for the cob of disassembly of the WiFi module ESP8266-01.

VCC- live module vіd 3V to 3.6V

GND- Earth.

RST- Visnovok Reset, which prompts for module reset.

CH_PD- "chip power-down" when power is applied, the robot of the module is activated.

TX- Data transfer (UART interface)

RX- data reception (UART interface)

GPIO0

GPIO2- port of introduction/opening of the official recognition

The GPIO0 and GPIO2 circuits are the same digital circuits, which are practical on Arduino boards for interfacing with various sensors, and stink at times of the implementation of independent robots on the internal microcontroller of the ESP8266-01 WiFi module.

For a good life of the ESP8266-01 module, switch the voltage to a stabilized voltage at 3.3V and don’t bother to take life on your Arduino board, because the module will keep the current up to 215mA and it may be bad for your board. If you take stabilized life at 3.3V, it's not a problem for you, otherwise it's too early for you to deal with this module. For example, it is necessary to use such a 3.3V and 5.0V YWRobot module for quick selection of circuits on prototyping boards, which allows you to easily take a stabilized voltage at 3.3V or 5V on the main paths of the prototyping board.

Connected Plus (+) 3.3V VCC module ESP8266-01, and minus (-) dzherela zhivlennya brought to vysnovka GND. In such a station, a red light will shine on the module, which signals us about the correct connection of life. In order for the module to be activated, it is also necessary to add a plus (+) dzherela living with vivodom CH_PD of the ESP8266-01 module and the power is immediately connected through a 10kΩ resistor. Now, if we turn on the liveliness, the modules are to blame for the burning of the red light and the blue light blinking once. If you have everything like that, it means everything is good, you have correctly received everything and your working module. In another case, turn the connection over again, or replace the module, shards of wine, better for everything, not working.

Let's go. For robots with WiFi module ESP8266, we need a USB-UART adapter. Adapters are available in different sizes, for example: FT232RL, CP2102, PL2303. And let's say you don't have such adapters, and as a USB-UART adapter, we'll use the Arduino board. I'm hacking for which Arduino NANO board, and you can hack if it's your order. Connection on any payment one to one identical. Zdіysnyuєmo zgіdno zgіdno z offensive scheme.

Let's see what we've done here. To show respect that we have shorted a jumper on the Arduino board RSTі GND. This manipulation turns on the microcontroller and allows us to use our Arduino board with a blue USB-UART adapter.

Oskіlki WiFi module ESP8266-01 lively in the vicinity of the city of life, do not forget that we are responsible for the land of all life in our projects. That's why we love the whiskers GND pay Arduino with earth (-) of our current 3.3V power supply, which is used for the power supply of the ESP8266-01 module.

Visnovok TX your Arduino board is connected to the output TX ESP8266-01 module This line will transmit data from the WiFi module to the Arduino board. Anyone familiar with the UART interface might think: "But how is it? You figured out that TX is responsible for connecting to RX. TX transmits information, and RX receives it." I You will be right. Everything is correct, connect TX to RX, and at the same time, if we work with the Arduino UART adapter, it is necessary to connect the device without a middle. Vvazhte tse blame іz rules.

Line RX your Arduino board is connected just like that directly to the line RX ESP8266-01 module This line transmits information from the Arduino board to the WiFi module board. Ale robimo tse z'ednannya through the so-called dilnik of the voltage, which consists of two resistors with nominal values ​​of 1 kOhm and 2 kOhm. We need to change the voltage on this line for the additional two resistors (voltage dilator), because the Arduino board transmits a logical signal with a voltage of 5V, and the WiFi module works with a voltage of 3.3V. For the transformation of the logical signal, we could have made a special twist of the transformation of the logical equals, which would have been much more correct, but again, it’s acceptable that you don’t have it, and we had a chance to drink more with a simple way and kill the target for additional work.

Everything necessary for the future work has been connected for the time being, but we still have 3 more visnovkas to spare ( GPIO0, GPIO2і RST) on the WiFi modules ESP8266-01. For the stable operation of the WiFi module, we need to set up the wires, which we have lost, to increase to the plus (+) module life lines through 10kΩ resistors.

Tse allow us to change the code (point) and make the work of the module stable. Better than robiti once. Otherwise, don’t be surprised that your module is constantly changing, you see, you didn’t understand the information, or you didn’t want to practice it. Vykoristovuvat podtyaguyuchi resistors on the back of the microcontroller can be, as a rule, you want stable work in your projects.

I am re-verifying the manufacturing process of the ESP8266-01 WiFi module. We turn on the liveliness and marvel, so that the red light ignites and the sprat blinks blue. Everything seems to be like this, it means miraculously we have far away. In another way, we check the correctness of the day, as well as the quality of all contacts. Maybe it’s just a banal situation, if ten times everything was wrong again and changed, that everything was connected correctly, but turning on the module, bachite, that the blue light is not adequate for itself, it’s constantly burning, it’s constantly blaming, or it’s not reacting to it. Tse mozhe statisya through the filthy contact on the same line. For example, choosing a circuit on a breadboard, it’s not easy to sit on your own place and not to make a change from resistors. Reverse the essence of the day. The module is already sensitive. Do not hate cym. This is often the reason for not stable work.

Zagalom, we finished our connections. At the same time, we need to prepare the Arduino IDE program for robots with the ESP8266-01 WiFi module. For this, we need to install in the Arduino IDE the necessary archives with libraries, applications and ESP boards, which will allow us to upload sketches directly from the microcontroller of the ESP8266-01 module, change the firmware too. As part of this article, we, more for everything, don’t need to fix it, but I’m sure that since we got it connected to the module, the order will be correct, so we can download everything necessary for work with the Arduino IDE. Everything here is, in principle, simple.

Starting the program Arduino IDE and go to the menu "File" - "Parameters"

At the top of the window, write "esp8266". As a result, we have no more firmware needed. When pressing on the firmware, a button will appear "Installed". Click on the button "Installed" And check, until everything gets up. Archive dosit great, close to 150 megabytes, and also happen to get better.

After the installation is completed. Rebooted the Arduino IDE and bachimo, as new ESP boards appeared at the "Tools" - "Pay" menu. On whom everything. We have completed the completion of the Arduino IDE. As long as we don’t need qi, we can’t do without them in a distant robot.

All of us have connected and prepared, now we can start sorting out the cherubs. In fact, at the same time, you will continue the re-verification and adjustment of the module for additional AT commands and you can’t do without it. WiFi modules are implemented in such a way that all connections with them are supported by the so-called AT commands, as they are sewn into the firmware of the module. We won't overdo all the AT commands here, do it a lot and if you want to do it all, you can easily know them on the Internet. And we will win at once the least necessary for the cob of work.

And so we connect our Arduino board via a USB cable to the computer. A zovnіshne dzherelo zhivlennya, like to live WiFi module ESP8266-01 for now, you don’t need to turn it on. We start the Arduino IDE program, select our Arduino board in the "Tools" menu, my choice is Arduino NANO, and you choose yours. So it’s not forgotten to choose the port to which our Arduino is connected. I spodіvayu all tse vy rozumієte and robiti vmієte.

Vіdkrivaєmo port monitoring "Instrumenti" - "Port Monitor". We select the port port 74880 (on such a speed, the launch of the module is expected) and it is possible to select "NL & CR" from the list

The axis is now connected to the call of life, like to live our WiFi module. If you are guilty, please enter approximately the following information in the port monitor.

Here we have some information about our WiFi module (speed, amount of memory on board, etc.). The information can be retrieved depending on the firmware version of the WiFi module. Let's not take any respect. More important. At the bottom, we typed blind symbols, which means that the speed of the port (74880 baud), we put it in, only fit for the cob capture of the module, to get this information, but the speed is not suitable for normal connection with the WiFi module.

To select the correct port security, just change the port security and send to the port (the field to the top and the edit button) symbol AT until we take it back OK. Yakshcho You will try to send symbols right at the same time AT to the port on the security code 74880, then take one or two blank symbols from the port.

Try to immediately set up the 115200 baud rate and issue the AT command. Most of the modules are flashed for the required speed.

The axis of such a picture is your fault at the port monitor. Just as everything is the same for the minds of the unreasonable typing of characters, reduce the speed and repeat the correction AT command, until you turn around OK. If you tried all the firmware and did not get the correct firmware, then you did not have mercy on the firmware module with non-standard firmware. Then it is not enough to reflash the module with a normal firmware, but the topic is also a stat.

I'm sure that everything is good and you got the correct swedishness. To the speech, yakshcho vim, the vimknuti I turn on the WiFi module, the same yak PIDIBILELED RIGHTSHENT, then the deputy of the same self, Yaki core on the slotkoye 74880 BOD, sink, skew, vypaki. ready" ". But we have the ability to look at the primary information in a normal way on the correct firmware, for which it is necessary to programmatically reconfigure the module for the help of the AT command AT+RST.

To find out about the firmware version of your ESP8266-01 WiFi module, you need to enter the command in the monitor port AT+GMR and at the same time you take approximately the following information:

WiFi module ESP8266-01 can work both in AP mode and in client mode. In order to allow the module to process the alarm in all modes, send the command to the monitor port AT+CWMODE=3 i have to take your guilt OK.

Team AT+CWLAP allow you to look through all WiFi access points, how to check your module at the moment. My module, for example, currently has less than three WiFi access points in its coverage area. Vidpovіd may be about the following:

For example, we know the password to the third access point, so that we can connect to it and the command AT+CWJAP="myname","password", in my opinion, the team looks AT+CWJAP="dsl_unlim_512_home","11111111", on which we will succeed in proving:

The command parameters are written to the flash memory of the ESP8266-01 WiFi module, and if I want to disable the module, I will re-enable, and automatically connect to the desired access point. Don’t let the team marvel at the team, otherwise take it away from the team ERROR. It is necessary to pay attention to those who in the remaining versions of the firmware recommend to win the command AT+CWJAP_CUR, then the command is visible AT+CWJAP_CUR="myname", "password". As we raptomy forgot, to which access point our module is connected, it is necessary to send a command AT+CWJAP? or AT+CWJAP_CUR? And we take away the access point, before connecting the WiFi module at the moment.

With connections and cob lashings WiFi module ESP8266-01 we got divorced. The module is working and ready for the implementation of your further projects. Explore all possible applications with this module within the framework of one article, it is simply impossible and we will deal with it in the upcoming articles. And for those who are not more familiar with programming, but if you want to start working on your projects for help with WiFi, I recommend getting to know the RemoteXY WiFi project designer. This site will help you without much difficulty in creating a control interface for your mobile phone or tablet and for the help of your add-on, until you connect the WiFi module.

After the appearance of payments based on the Wifi chip ESP8266, they became popular folk. The greatness of the opportunity and the minimum price, which did not exceed $ 5 at the start of sales and distribution, made their right. There were organized meetings around the chip, in which people share information and create software security.

What is the reason for such popularity, krim low price?

On the right, pay on the ESP8266 is not just a module for communicating via WiFi. The chip is essentially a microcontroller with its own SPI, UART interfaces, as well as GPIO ports, which means that the module can be built autonomously without Arduino and other boards with microcontrollers.

Information

Our Chinese comrades are already building about twelve different boards based on the ESP8266: with connected external antenna, with ceramic antenna, with PCB antenna, without antenna. Also, on different modules, a different number of GPIOs has been shown. More details can be read on the Russian website.

With this look, I will win one of the highest boards ESP-01. Also, for a full-scale robot with a chip, a converter will be needed USB/UART, I recommend, looking around at mysku.

Connection

Pinning the ESP-01 rose, presented on a small scale:

If you don’t have to put in two GPIOs in your projects, but you don’t have to deal with “brutal hacks”, then I recommend that you immediately buy new boards, for example ESP-07 or ESP-12. Just ask for help, so that you can pay for independent breeding and sale for this special mini-set.

Photos of these boards


ESP-01 hacked by Dave Allan, like a stock. Additionally, you will accept 4 GPIOs: GPIO14, GPIO12, GPIO13 and GPIO15

Connection scheme:
- ESP-01 VCC to USB/UART VCC (+3.3V);
- ESP-01 GND to USB/UART GND;
- ESP-01 URXD to USB/UART TXD;
- ESP-01 UTXD to USB/UART RXD;
- ESP-01 CH_PD to USB/UART VCC (+3.3V);
- ESP-01 GPIO0 to USB / UART GND - only one hour of firmware!

Firmware

For ESP8266, using SDK and original firmware from Espressif Systems, but if it doesn’t depend on its own “capacity”, then non-original firmware, such as NodeMCU, Frankenstein and others, is issued.

In this review, there is no original NodeMCU firmware. You can look at the list of commands that apply.

Update the original "factory" firmware on NodeMCU:
- Zavantazhuemo utility for flashing -;
- zavantazhuemo firmware -;
- Connect via ESP-01 to USB/UART according to the diagram shown above. Don't forget to connect GPIO0 to GND. Plug USB/UART into the computer's USB port;
- Run XTCOM_UTIL.exe, go to Tools -> Config Device, select the COM port to which board is connected, set port 57600, select Open, then Connect, the program is to say "Connect with target OK!" Go to the API TEST menu, select (4) Flash Image Download, select the path to the file "nodemcu_512k_latest.bin", fill in the address 0x00000, typify DownLoad. Due to the rozpochatisya zavantazhennya firmware, after completion, you will see an update;
- Including live pay, see GPIO0 in the air dart, vmikaєmo live. Launch the Putty terminal, CoolTerm or in. (UVAGA! We change the port speed to 9600), we check the readiness to pay by the team
>print(node.chipid())
10013490

First script

If you will have problems working with scripts, it is recommended that you supply 3.3V power not from USB/UART, but from a decent dzherel. The voltage can be the same 3.3V, for example, through the stabilized life module on AMS1117 3.3V 800ma.

For writing that scripting in the ESP8266, it will be small and handy IDE - :

Our first script, vimikatime and turn on the light with a periodicity of 2 seconds:
- Turn on life, up to GPIO2 turn on resistor and light diode. Including living;
- Run ESPlorer, select the required COM and port 9600 security, press Open;
- Insert the code and press Save To ESP;

Pin = 4 --GPIO2 gpio.mode(pin, gpio.OUTPUT) for i=1, 10, 1 do gpio.write(pin, gpio.LOW) tmr.delay(2000000) gpio.write(pin, gpio.HIGH ) tmr.delay(2000000) end
- DoFile is pressed to restart.

Connect DHT11 sensor

In order to demonstrate, a more advanced robot with NodeMCU firmware is connected to the ESP-01 DHT11 sensor:
- DHT11 VCC to USB/UART VCC
- DHT11 GND to USB/UART GND
- DHT11 Out to USB/UART GPIO2

Pigs Fly code from the ESP8266.com forum

Works for DHT11 on ESP-07 (version w/16pins) and ESP-01 --Only 20141219 firmware tested. --Data stream acquisition timing is critical. There's --barely enough speed to work with to make this happen. --Pre-allocate vars used in loop. = 4; gpio.mode(pin, gpio.OUTPUT) tmr.delay(20000) gpio.write gpio.mode(pin, gpio.INPUT) --bus will always let up eventually, don't bother with timeout while (gpio_read(pin) ==0) do end c=0 while (gpio_read(pin)= =1 and c<100) do c=c+1 end --bus will always let up eventually, don"t bother with timeout while (gpio_read(pin)==0) do end c=0 while (gpio_read(pin)==1 and c<100) do c=c+1 end --acquisition loop for j = 1, 40, 1 do while (gpio_read(pin)==1 and bitlength<10) do bitlength=bitlength+1 end bitStream[j]=bitlength bitlength=0 --bus will always let up eventually, don"t bother with timeout while (gpio_read(pin)==0) do end end --DHT data acquired, process. Humidity = 0 HumidityDec=0 Temperature = 0 TemperatureDec=0 Checksum = 0 ChecksumTest=0 for i = 1, 8, 1 do if (bitStream >2) then Humidity = Humidity+2^(8-i) end end for i = 1, 8, 1 do if (bitStream > 2) then HumidityDec = HumidityDec+2^(8-i) end end for i = 1, 8, 1 do if (bitStream > 2) then Temperature = Temperature+2^(8-i) end end for i = 1, 8, 1 do if (bitStream > 2) then TemperatureDec = TemperatureDec+2^(8-i ) end end for i = 1, 8, 1 do if (bitStream > 2) then Checksum = Checksum+2^(8-i) end end ChecksumTest=(Humidity+HumidityDec+Temperature+TemperatureDec) % 0xFF print ("Temperature: "..Temperature..""..TemperatureDec) print ("Humidity: "..Humidity.."."..HumidityDec) print ("ChecksumReceived: "..Checksum) print ("ChecksumTest: "..ChecksumTest )


I'll ask again for the accuracy of the video, knowing it on the phone.

HTTP server

An example of a connection to a Wifi access point and a connection to a request via HTTP.

wifi.setmode(wifi.STATION) wifi.sta.config("SSID","password") print(wifi.sta.getip()) srv:listen(80,function(conn) conn:on("receive", function(conn,payload) print(payload) conn:send("

hello user.

") end) end)

Epilog

Chip ESP8266 ce insanely breaking through, we are ahead of the spіvvіdnoshnі tsіna / akіst. Zvichayno varto guess about the known problems in the original and non-original firmware, but the work is being done and I'm sure that in the future similar chips will be put into the leather kettle. Plan to buy +158 Add in the frame A look worthy +103 +196

How to turn on the ESP-01 module for controlling the light source via the Internet, a module that allows you to turn on any electrical device.

At this level of ESP8266, we have the ESP-01 module for controlling the light through the Internet. The ESP8266 is a cheap yet efficient platform for communicating over the Internet.

Vіn is so simple with the Arduino. Having passed this lesson, you will take away the basic knowledge of managing an electrical appliance via the Internet from anywhere in the world!

Here we have a USB-to-TTL converter for programming the ESP8266 ESP-01. We will win for the development of a web server for remote lighting with light.

How does it work

The ESP8266 can be controlled from a local Wi-Fi network or the Internet (after port forwarding). The ESP-01 module has GPIO contacts, so it can be programmed to enable or disable the LED or relay via the Internet. The module can be programmed with the help of the Arduino USB-to-TTL converter via serial pins (RX, TX).

Connected to ESP8266

We can use USB-to-TTL converter or Arduino to program ESP8266. Axis three ways you can follow to get the code in the ESP8266 - choose the one that suits you best. Go back to the diagrams for the skin option and set the mood in the upper order.

1. USB-to-TTL converter with DTR connector

If you use a USB-to-TTL converter with a DTR drive, you'll be able to capture it smoothly. Be a caress, please be on the lookout, that the serial monitor is not practical for this.

USB TTL → ESP8266 ESP-01
GND → GND
TX→RX
RX → TX
RTS → RST
DTR→GPIO0

2. USB to TTL converter without DTR output

If you want to connect a USB-TTL converter without a DTR input, we can change the transmission manually. For whom we win, there are two buttons - div. coming diagram:

USB TTL → ESP8266 ESP-01
GND → GND
TX→RX
RX → TX
Reset Button → RST
Flash Button → GPIO0

Under the hour of the advance code, press the "Request" button (Flash). Keep the button pressed when you press the "Reset" button once. You can now enable the Flash button. The ESP8266 is now in a mode where you can start sketching.

3. Arduino Uno Whisk for capturing code in ESP8266

You can tweet to run the ESP8266 ESP-01 code. When you enter the code, follow the same procedure as for the other item - press the "Entry" button if you press the button once, and then release the Flash button.

ARDUINO → ESP8266 ESP-01
GND → GND
TX → TX
RX→RX
Reset button → RST
Button Flash → GPIO0

Entry code ESP8266

Vykoristovyte be-yakie z suggest more ways and vіdkryte , then choose the ESP8266 board from the menu:

Tools → Board → Generic ESP8266 Module
(Tools → Board → ESP8266 Module)

Note. You didn’t install or set up the ESP8266 board for Arduino, so you’ve worked out the details of your helper. Then you can go further.

Now copy and paste the Arduino IDE code below and click the Get button. Change the SSID to the Wi-Fi hotspot and change the password to your Wi-Fi password and compile.

#include const char * ssid = "YOUR_SSID"; // type your ssid const char * password = "YOUR_PASSWORD"; // GPIO2 of ESP8266 WiFiServer server(80);//Service Port void setup() ( Serial.begin(115200); delay(10); pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); // Connect to WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED ) ( delay(500); Serial.print("."); ) Serial.println(""); Serial.println("WiFi connected"); // Start the server server.begin(); Serial.println( "Server started"); // Print IP address Serial.print("Use this URL to connect: "); .println("/"); ) void loop() ( // Check if a client has connected WiFiClient client = server.available(); if (!client) ( return; ) // Wait until the client sends some data Serial .println("new client"); while(!client.available())( delay(1); ) // Read the first line of the request String request = client. readStringUntil("\r"); Serial. println (request); client. flush(); // Ma tch the request int value = LOW; if (request. indexOf( "/LED=ON") != -1) ( digitalWrite(ledPin, HIGH); value = HIGH; ) if (request.indexOf("/LED=OFF") != -1)( digitalWrite(ledPin, LOW);value = LOW; ) //Set ledPin according to the request //digitalWrite(ledPin, value); // Return the response client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(""); // do not forget this one client.println("");client.println(" "); client.print("Led pin is now: "); if(value == HIGH) ( client.print("On"); ) else ( client.print("Off"); ) client.println( "

"); client.println("Click here turn the LED on pin 2 ON
"); client.println("Click here turn the LED to pin 2 OFF
");client.println(""); delay(1); Serial.println("Client disconnected"); Serial.println(""); )

Open last monitor and open the URL shown on the last monitor through a web browser. Connect GPIO 2 to ESP8266 until the light diode is removed. Now you can use the light of day far away via the Internet!

See all the darts, as they were needed for capturing the code. The LM1117 module is designed to provide regulated 3.3 V output.

Connecting ESP8266 to the Internet

Currently, the ESP8266 module is only available through a local Wi-Fi network. To connect with the Internet, it is necessary to forward the ports to the router.

To find out the IP address of your system, or for the help of the ifconfig command on your terminal, or go to the whatsmyip.org side. Copy your IP address. Now open the router settings and go to "Forwarding". Enter data for "Service port" and "IP address". Service port - the port number of the Arduino code (service port: 80):

WiFiServer server(80);//ServicePort

The IP addresses of the one you indicated earlier. Leave other parameters for locking. Now go to your browser and enter the address: xxx.xxx.xx.xx: 80

© 2022 androidas.ru - All about Android