Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:espressif_at [2023/10/10 10:27] ktokarzen:iot-open:espressif_at [2024/05/27 10:33] (current) – [ESP AT Networking] pczekalski
Line 1: Line 1:
-===  ===  +====== ESP AT Networking ====== 
-<box #5374d5></box> +{{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\ 
-<box #5374d5></box> +ESP8266 SoC can work as the WiFi communication module for other microcontrollers. To use the ESP8266 chip as a modem (figure {{ref>esp_at}})the module must be flashed with the appropriate AT-command firmware. Espressif and other developers prepared the ready-to-use firmware with the AT-command interpreter. This firmware can be downloaded from the web and flashed into ESP8266 memory with a flash tool.
-=== ESP AT Networking === +
-<box #5374d5></box> +
-<box #5374d5></box> +
- +
-ESP8266 SoC can work as the WiFi communication module for other microcontrollers. To use the ESP8266 chip as a modem (Figure {{ref>esp_at}}) the module must be flashed with the appropriate AT-command firmware. Espressif and other developers prepared the ready-to-use firmware with the AT-command interpreter. This firmware can be downloaded from the web and flashed into ESP8266 memory with a flash tool.+
  
 <figure esp_at> <figure esp_at>
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:esp_at.png?nolink&200 | }} +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:esp_at.png?250 ESP8266 as a modem}} 
-<caption>ESP8266 as a modem.</caption>+<caption>ESP8266 as a modem</caption>
 </figure> </figure>
  
 <note> <note>
-AT commands were developed to control telephony modems. Contemporary they are often used to control modules connected via serial port. This includes GPS receivers, GSM/LTE modems, network modules and others.+AT commands were developed to control telephony modems. They are often used to control modules connected via serial port, including GPS receivers, GSM/LTE modems, network modulesand others.
 </note> </note>
  
-== Download Software==+====Preparing an ESP8266 chip with AT commands firmware==== 
 + 
 +== Downloading Software==
  
   * Download the latest ESP Flash Download Tool (v3.9.5 at the time of writing) from ((https://www.espressif.com/en/support/download/other-tools)).    * Download the latest ESP Flash Download Tool (v3.9.5 at the time of writing) from ((https://www.espressif.com/en/support/download/other-tools)). 
  
-There are also other flashing tools like NodeMcu Flasher ((https://github.com/nodemcu/nodemcu-flasher)). While using a single binary file other flashing tools can be used like esp8266 flasher ((https://github.com/binaryupdates/esp01-firmware)), Tasmotizer ((https://github.com/tasmota/tasmotizer)) or others. +Other flashing tools like NodeMcu Flasher ((https://github.com/nodemcu/nodemcu-flasher)) exist. While using a single binary fileother flashing tools can be used like esp8266 flasher ((https://github.com/binaryupdates/esp01-firmware)), Tasmotizer ((https://github.com/tasmota/tasmotizer)) or others. 
  
   * Download the latest AT release from ((https://bbs.espressif.com/viewforum.php?f=46))   * Download the latest AT release from ((https://bbs.espressif.com/viewforum.php?f=46))
 The newest version of Espressif firmware is not compatible with ESP8266 SoCs. In the case of using ESP8266-based boards, download older AiThinker firmware available on GitHub ((http://www.electrodragon.com/w/ESP8266_AT-Command_firmware)). The newest version of Espressif firmware is not compatible with ESP8266 SoCs. In the case of using ESP8266-based boards, download older AiThinker firmware available on GitHub ((http://www.electrodragon.com/w/ESP8266_AT-Command_firmware)).
-The firmware can come in different versions. It can be a set of binary files which must be uploaded at specific memory addresses or as a combined single binary file. Notethat a single file is prepared for a specific flash memory size.+The firmware can come in different versions. It can be a set of binary files that must be uploaded to specific memory addresses or as a combined single binary file. Note that a single file is prepared for a particular flash memory size.
  
 ==Flashing Procedure with single binary file== ==Flashing Procedure with single binary file==
-  * Detect ESP8266 module parameters. Start the ESP Flash Download Tool ("ESPFlashDownloadTool_v3.9.5"), set the COM port corresponding to your programmer, and then click the START button to detect the specs of the board. After detection, you should see something like this (Figure {{ref>AT_flash}}):+  * Detect ESP8266 module parameters. Start the ESP Flash Download Tool ("ESPFlashDownloadTool_v3.9.5"), set the COM port corresponding to your programmer, and then click the START button to detect the board's specs. After detection, one should see something like this (figure {{ref>AT_flash}}):
  
 <figure AT_flash> <figure AT_flash>
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:readd1.jpg?nolink&400 | }} +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:readd1.jpg?400 | Programming ESP8266 - detected parameters}} 
-<caption>Programming ESP8266 -- detected parameters.</caption>+<caption>Programming ESP8266 - detected parameters</caption>
 </figure> </figure>
  
   * Gather information. Make a note of the flash memory size. In this example, we have a 32 Mbit flash.    * Gather information. Make a note of the flash memory size. In this example, we have a 32 Mbit flash. 
-  * Load the correct size of the combined AT binary firmware file (".bin") and set the offset as 0×0, you should see something like this (Figure {{ref>AT_load}}):+  * Load the correct size of the combined AT binary firmware file (".bin") and set the offset as 0×0; one should see something like the view present in figure {{ref>AT_load}}.
  
 <figure AT_load> <figure AT_load>
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:flashd1.jpg?nolink&400 | }} +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:flashd1.jpg?400 | Programming ESP8266 - setting proper image file}} 
-<caption>Programming ESP8266 -- setting proper image file.</caption>+<caption>Programming ESP8266 - setting proper image file</caption>
 </figure> </figure>
-  * Then, click the START button and wait until the flashing process is over.+  * Click the START button and wait until the flashing process ends.
  
 ==Flashing Procedure with a set of separate files== ==Flashing Procedure with a set of separate files==
-To flash the firmware from a set of filesor to restore the original firmware: +To flash the firmware from a set of files or to restore the original firmware: 
-  * Detect ESP8266 module parameters. Start the ESP Flash Download Tool ("ESPFlashDownloadTool_v3.9.5"), set the COM port corresponding to your programmer, and then click the START button to detect the specs of the board. After detection, you should see something like this (Figure {{ref>AT_flash1}}):+  * Detect ESP8266 module parameters. Start the ESP Flash Download Tool ("ESPFlashDownloadTool_v3.9.5"), set the COM port corresponding to your programmer, and then click the START button to detect the board'specs. After detection, you should see something like the view present in figure {{ref>AT_flash1}}.
  
 <figure AT_flash1> <figure AT_flash1>
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:readd1.jpg?nolink&400 | }} +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:readd1.jpg?400 | Programming ESP8266 - detected parameters}} 
-<caption>Programming ESP8266 -- detected parameters.</caption>+<caption>Programming ESP8266 - detected parameters</caption>
 </figure> </figure>
-  * From the downloaded AT firmware folder, open the "readme.txt" file containing the information for flashing the firmware. Inside the file, there should be a "BOOT MODE" sectionas follows:+ 
 +  * From the downloaded AT firmware folder, open the "readme.txt" file containing the information for flashing the firmware. Inside the file, there should be a "BOOT MODE" section as follows:
 <code> <code>
 # BOOT MODE # BOOT MODE
Line 86: Line 84:
     blank.bin                   0xfe000 & 0x3fe000     blank.bin                   0xfe000 & 0x3fe000
 </code> </code>
-  * Indicate -- correct for your ESP8266 flash size -- firmware files & addresses. The firmware is broken down into several files. They need to be provided to the ESP Flash Download Tool, together with the corresponding addresses found in the readme.txt file above. For our ESP8266 example it should look like this (Figure {{ref>AT_reflash}})+  * Indicate -- correct for your ESP8266 flash size -- firmware files & addresses. The firmware is broken down into several files. They must be provided to the ESP Flash Download Tool and the corresponding addresses in the readme.txt file above. For our ESP8266 exampleit should look like in figure {{ref>AT_reflash}}.
 <figure AT_reflash> <figure AT_reflash>
-{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:reflashd2.jpg?nolink&600 |}} +{{ :en:iot-open:getting_familiar_with_your_hardware_rtu_itmo_sut:esp:reflashd2.jpg?600 | Programming ESP8266 - reflashing settings}} 
-<caption>Programming ESP8266 -- reflashing settings.</caption>+<caption>Programming ESP8266 - reflashing settings</caption>
 </figure> </figure>
-  *  Then, click the START button and wait until the flashing process is over.+  *  Click the START button and wait until the flashing process ends.
  
-=== Basic ESP8266 Networking ===+==== Basic ESP8266 Networking ====
 After uploading AT firmware and connecting the module to the PC, an ESP8266 can be used as a modem with simple AT commands. After uploading AT firmware and connecting the module to the PC, an ESP8266 can be used as a modem with simple AT commands.
  
-It is possible to connect ESP8266 to a PC with a TTL-Serial-to-USB adapter. Connection to any microcontroller with a serial interface does not need an adapter. The default baud rate settings are 115200,N,8,1. To check if the module works properly simple "AT" command can be used:+It is possible to connect ESP8266 to a PC with a TTL-Serial-to-USB adapter. Connection to any microcontroller with a serial interface does not need an adapter. The default baud rate settings are 115200,N,8,1. To check if the module works properly, a simple "AT" command can be used:
 <code>AT</code> <code>AT</code>
-If the response is "OK", the ESP8266 module is ready to use and ready to accept other commands. For example, to figure out exactly what firmware version is installed the following command can be used:+If the response is "OK", the ESP8266 module is ready to use and accept other commands. For example, to figure out exactly what firmware version is installedthe following command can be used:
 <code>AT+GMR</code> <code>AT+GMR</code>
  
-<note>Note that AT command interpreter requires full "Enter" code. Both "CR" and "LF" characters must be sent. Some popular terminal programs like Putty do not send both characters. Be sure that the serial terminal software sends "CRLF" at the end of the line. </note> +<note> The AT command interpreter requires full "Enter" code. Both "CR" and "LF" characters must be sent. Some popular terminal programs like Putty do not send both characters. Be sure that the serial terminal software sends "CRLF" at the end of the line. </note> 
-As a Wifi device ESP8266 can connect to the network in such modes: + 
-  * mode 1 -- client mode -- the ESP8266 connecting to an existing wireless network, +As a WiFi deviceESP8266 can connect to the network in such modes: 
-  * mode 2 -- access point mode (AP) -- other wireless network devices can be connected to the ESP8266, +  * mode 1 - client mode - the ESP8266 connecting to an existing wireless network, 
-  * mode 3 -- dual mode (router) -- the ESP8266 acts as an access point and connects at the same time to an existing wireless network. +  * mode 2 - access point mode (AP) - other wireless network devices can be connected to the ESP8266, 
-By default, the ESP8266s stock firmware is set to AP mode. To confirm that, send the following command:+  * mode 3 - dual mode (router) - the ESP8266 is an access point and connects simultaneously to an existing wireless network. 
 +  *  
 +By default, the ESP8266's stock firmware is set to AP mode. To confirm that, send the following command:
 <code>AT+CWMODE?</code> <code>AT+CWMODE?</code>
-The response should look like +CWMODE:2, where 2 corresponds to AP mode. To switch ESP8266 to client device mode, the following command can be used:+The response should look like ''+CWMODE:2'', where 2 corresponds to AP mode. To switch ESP8266 to client device mode, the following command can be used:
 <code>AT+CWMODE=1</code> <code>AT+CWMODE=1</code>
-To scan the airwaves for all WiFi access points in range the following command can be used:+ 
 +To scan the airwaves for all WiFi access points in rangethe following command can be used:
 <code>AT+CWLAP</code> <code>AT+CWLAP</code>
-Then the ESP8266 will return a list of all the access points in range. In each line will be an item consisting of the security level of the access point, the network name, the signal strength, the MAC address, and the wireless channel used. Possible security levels of the access point <0--4> mean: + 
-  * 0 -- open, +Thenthe ESP8266 will return a list of all the access points in range. In each line will be an item consisting of the security level of the access point, the network name, the signal strength, the MAC address, and the wireless channel used. Possible security levels of the access point <0-4> mean: 
-  * 1 -- WEP, +  * 0 - open, 
-  * 2 -- WPA_PSK, +  * 1 - WEP, 
-  * 3 -- WPA2_PSK, +  * 2 - WPA_PSK, 
-  * 4 -- WPA_WPA2_PSK. +  * 3 - WPA2_PSK, 
-The following command establishes the connection to the available access point with proper "ssid_nameand "password"+  * 4 - WPA_WPA2_PSK. 
-<code>AT+CWJAP="ssid_name","password"</code>+ 
 +The following command establishes the connection to the available access point with proper ''ssid_name'' and ''password''
 +<code>AT+CWJAP=<ssid_name>,<password></code> 
 If everything is OK, the ESP8266 will answer: If everything is OK, the ESP8266 will answer:
 <code> <code>
Line 126: Line 130:
 OK OK
 </code> </code>
-It means that ESP8266 is connected to the chosen AP and obtained a proper IP address. The following command checks what is the assigned IP address:+ 
 +ESP8266 is connected to the chosen AP and obtained a proper IP address. The following command checks what is the assigned IP address:
 <code>AT+CIFSR</code> <code>AT+CIFSR</code>
  
-To set up ESP8266 to behave both as a WiFi client as well as a WiFi Access point the mode should be set to 3.+To set up ESP8266 to behave both as a WiFi client and a WiFi Access pointthe mode should be set to 3:
 <code>AT+CWMODE=3</code>  <code>AT+CWMODE=3</code> 
  
en/iot-open/espressif_at.1696933627.txt.gz · Last modified: 2023/10/10 10:27 by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0