ESP8266 FAQ Summary - Reprinted from official website

ESP8266 FAQ

This page collection esp8266 FAQ

This document describes some common problems developers in ESP8266 development. These issues include the following categories:

  • Basic concepts
  • ESP8266 related
  • AiCloud related
  • Firmware compilation Commissioning
  • Related Documentation

The following are the specific questions and answers for each classification.

  • What ESP8266 that?

  ESP8266 the SOC is high performance wireless, integrated in a small size package industry-leading Tensilica L106 ultra-low power 32-bit microcomputer MCU, with 16-bit compact mode, support frequency 80  MHz  and 160 MHz, the RTOS support, integrated Wi -Fi MAC / BB / RF / PA / LNA, an antenna board. It supports standard IEEE802.11 b / g / n protocol, a complete TCP / IP protocol stack.

  • ESP01, ESP02 what is?

  ESP01 ~ ESP14 by the Shenzhen Shun R & D can be produced ESP8266 series modules, chip on the basis of ESP8266, improve and optimize the layout of peripheral devices antenna.

  • What AiCloud that?

  AiCloud Shun is available to our customers free of servers, data naked, UDP transmission, simple and stable, and contains many routines and PC end PC debugging tool.

  • Lexin relationship with EMC can be the

  Lexin is the chip manufacturers ESP8266, ESP8266 Shun but according to module production, and provide manufacturers a range of development programs.

  • ESP8266 must be using a server in order to develop it?

  The determined according to your needs, if you only need a local area network to meet the demand, you do not need a server, you can use the same ESP8266 development.

  • How to buy ESP8266 module and test board?

  An official letter may Taobao shop: http://shop.ai-thinker.com/

  • I choose which type ESP8266 module?

  The main difference between the hardware modules are packaged differences, as well as the size of the flash distinction, you can view ESP8266 selection list , if in doubt, contact our sales staff.

  • I choose AT development or SDK development?

    SDK method:
    advantages: the system costs the least and smallest 
    disadvantage: newbie need a week to two weeks time to become familiar with reading the code

    AT Method:
    Advantages: only need to know a few AT commands can be realized network communication with the external microcontroller! Development speed. 
    Cons: Additional external CPU cost

  So you can assess their own programs which suit their own

  • I choose FreeRTOS or NONOS?

  Because FreeRTOS is only open to the back, so commonly used is NONOS
  if you were using ESP32 series have developed over after FreeRTOS, you can directly use SDK FreeRTOS program, and the method in your favor

  • Development, have problems to go for help?

  If you are a corporate user, we will appoint a special docking an engineer in charge of your company;
  if you are an individual user, you can post in the forums, or send an email to [email protected] , we will have to deal with specialized engineers .

* Why would pass through packet loss?

As no hardware flow control. If you want to avoid packet loss, set hardware flow control. Transparent transmission using the TCP protocol, each data packet 1460 (depending on the protocol stack), as long as a good network, buffer space is not consumed, data can be continuously transmitted. For pass-through. Receiving serial data interval exceeds 20ms, that will accept the end of the data transfer has been accepted to the network. If the network is not good, it may lose some data, therefore, in order to avoid this, you can set the serial port flow control mode.

* ESP8266 can be used simultaneously AP + STA it?

ESP8266 can be used simultaneously AP + STA mode (WiFi amplifier but can not do).

* ESP8266 can be low-power it?

ESP8266 can be low power consumption. AT command low-power description:

Set sleep mode, sleep only apply to the single STA mode, the default work in modem-sleep mode. 
 AT + SLEEP = 0 0 to disable the sleep mode 
              1 is a light-sleep mode power consumption 0.9mA 
              2 is a modem-sleep mode power consumption 15mA

* The establishment of TCP Server connections saved to flash by AT commands?

* How to make quick connect ESP8266 AP after power?

Peripherals

* SDIO support SD card?

  ESP8266 is SDIO Slave, does not support the SD card.

* ESP8266 There are several UART?

  ESP8266 two UART, which UARTO there are TX, RX, do data transmission; UART1 RX because the feet are occupied by SPI-Flash, can only use TX, serial debugging information can be printed.

* GPIO can directly connect 5V it?

  Not. GPIO can only withstand 3.6V. We need to step-down circuit, otherwise it will cause damage to the GPIO.

hardware

* ESP8266 voltage and current requirements?

  ESP8266 voltage range of the digital portion is 1.8V ~ 3.3V, the analog part of the operating voltage is 3.0V ~ 3.6V, the minimum 2.7V.

模拟电源峰值 350 mA,数字电源峰值 200 mA。

注意:选择的 SPI Flash 工作电压也需要与 GPIO 的电压匹配。CHIP_EN 还是工作在 3.0 - 3.6V,使用1.8V GPIO 控制时需要注意电平转换。

*设计 ESP8266 的供电时,需要注意哪些问题?

  请注意如下几点:1.如果是使用 LDO 变压,请确保输入电压和输出电压要足够大。2.电源轨去耦电容器必须接近 ESP8266 摆放,等效电阻要足够低。3.ESP8266 不能直连 5V 电压。4.如果是通过 DC-DC 给 ESP8266 供电,必要时要加上 LC 滤波电路。

*ESP8266 上电时电流很大,是什么原因?

  ESP8266 的 RF 和数字电路具有极高的集成度。上电后,RF 自校准会需要大电流。模拟部分电路最大的极限电路可能达到 500 mA;数字电路部分最大电流 达到 200 mA。一般的操作,平均电流在 100 mA 左右。因此,ESP8266 需要供电能达到 500 mA,能够保证不会有瞬间压降。

*可以使用锂电池或者 2 节 AA 纽扣电池直接给 ESP8266 供电吗?

  2 节 AA 纽扣电池可以给 ESP8266 供电。锂电池放电时压降比较大,不适合直接给 ESP8266 供电。ESP8266 的 RF 电路会受温度及电压浮动影响。不推荐不加任何校准的电源直接给 ESP8266 供电。推荐使用 DC-DC 或者 LDO 给 ESP8266 供电。

*ESP8266 的 RAM 的使用结构是怎么的?

ESP8266 的 RAM 总共 160 KB。

IRAM 空间为 64 KB: 前 32 KB 用作 IRAM,用来存放没有加 ICACHE_FLASH_ATTR 的代码,即 .text 段,会通过 ROM code 或二级 boot 从 SPI Flash 中的 BIN 中加载到 IRAM。 后 32 KB 被映射作为 iCache,放在 SPI Flash 中的,加了 ICACHE_FLASH_ATTR 的代码会被从 SPI Flash 自动动态加载到 iCache。

DRAM 空间为 96 KB: 对于 Non-OS_SDK,前 80 KB 用来存放 .data/.bss/.rodata/heap,heap 区的大小取决于 .data/.bss/.rodata 的大小;还有 16 KB 给 ROM code 使用。 对于 RTOS_SDK,96 KB 用来存放 .data/.bss/.rodata/heap,heap 区的大小取决于 .data/.bss/.rodata 的大小。

WiFi相关

*路由配置是正确的,但是发生找不到路由,连接失败,为什么?

如果 SSID 和密码配置是正确的,可能的原因有 2 个。

1.推荐使用英文字符,不要使用中文。

2.需要注意 bssid_set 的设置,如果不需要指定路由的 MAC 地址,那么需配置 stationConf.bssid_set = 0。

* ESP8266 SoftAP + Station 模式下网络断开或丢包的情况?

虽然 ESP8266 支持 SoftAP + Station 共存模式,但是 ESP8266 实际只有一个硬件信道。因此在 SoftAP + Station 模式时,ESP8266 SoftAP 会动态调整信道值与 ESP8266 Station 一致。这个限制会导致 ESP8266 SoftAP + Station 模式时一些行为上的不便,用户请注意。例如:

情况一 如果 ESP8266 Station 连接到一个路由 (假设路由信道号为 6); 通过接口 wifi_softap_set_config 设置 ESP8266 SoftAP; 若设置值合法有效,该 API 将返回 true ,但信道号仍然会自动调节成与 ESP8266 Station 接口一致,在这个例子里也就是信道号为 6。

情况二 调用接口 wifi_softap_set_config 设置 ESP8266 SoftAP (例如信道号为 5); 其他 Station 连接到 ESP8266 SoftAP; 将 ESP8266 Station 连接到路由( 假设路由信道号为 6) ; ESP8266 SoftAP 将自动调整信道号与 ESP8266 Station 一致(信道 6); 由于信道改变,之前连接到 ESP8266 SoftAP 的 Station 的 Wi-Fi 连接断开。

情况三 其他 Station 与 ESP8266 SoftAP 建立连接; 如果 ESP8266 Station 一直尝试扫描或连接某路由,可能导致 ESP8266 SoftAP 端的连接断开,或者 UDP 丢包,ping 丢包等情况。因为 ESP8266 Station 会遍历各个信道查找目标路由,意味着 ESP8266 其实在不停切换信道,ESP8266 SoftAP 的信道也因此在不停更改。这可能导致 ESP8266 SoftAP 端的原有连接断开,或者 UDP 丢包,ping 丢包等情况。

这种情况,用户可以通过设置定时器,超时后调用 wifi_station_disconnect 停止 ESP8266 Station 不断连接路由的尝试;或者在初始配置时,调用 wifi_station_set_reconnect_policy 和 wifi_station_set_auto_connect 禁止 ESP8266 Station 尝试重连路由。

*Wi-Fi 信道是什么?可以自行选择信道吗?

信道指的是 Wi-Fi 使用的指定频段中特定频率的波段。不同国家地区使用的信道数目是不同的。您可以参考ESP8266 Wi-Fi 信道选择指南

应用

*为什么云端升级需要2个 “bin” 文件?“user1.bin” 和 “user2.bin” 有什么区别?

  user1.bin 和 user2.bin 是 2 个不同的 BIN 文件。生成 user1.bin 和 user2.bin 时,必须使用相同的 Flash 和 boot 设置,以保证 OTA 升级成功。2个 BIN 文件是互补的,运行 user1.bin 的时候,升级是下载 user2.bin;运行 user2.bin 的时候,升级是下载 user1.bin。这样可以保证升级过程中,如果有掉线的情况发生,设备还是可以正常运行。

* 导入工程注意事项

  工程文件的导入的注意不要有空格和中文字符,例如:C:\Users\Administrator\Desktop\sdk\esp_iot_sdk_v1.3.0

* esp8266模组LED灯为什么上电闪一下就灭了?

  a,因为esp8266模组的LED接在GPIO2,而此IO与UART1_TX共用,此时模组上电会输出一下打印信息,所以LED会闪直到打印信息输出完毕,LED就灭了。

  b,若想查看启动信息的内容,请选择串口调试助手74880的波特率,硬件上把rst拉低再拉高,可以查看启动信息。

  c,若想通过串口调试助手发送AT指令,请切换波特率到115200,即可。

* ESP8266启动信息说明?

* 模组发送AT指令无响应?

a,请选择74880的波特率,看下启动日志,把RST复位引脚拉低再拉高,可使用安信可串口调试助手进行查看,aithinker_serial_tool_v1.2.3.7z

b,是否进入flash启动模式,GPIO15下拉,GPIO0,GPIO2上拉?

c,是否烧录了固件?烧录配置flash size大小是否跟WiFi模组的flash一致?

* 如何屏蔽上电打印?

U0TXD默认上电有系统打印,对此敏感应用可通过UART的内部引脚交换功能,在初始化的时候,调用system_uart_swap函数。将 U0TXD、U0RXD 分别于U0RTS(MTDO/GPIO15)、U0CTS (MTCK/GPIO13)交换来屏蔽该上电的系统打印。 交换后,硬件上的下载管脚还是使用U0TXD + U0RXD,通信时需要将MTDO对应接到MCU的RXD,MTCK对应加到MCU的TXD。

* 使用UART1打印日志,如何配置?

UART1只有TX功能,可以在UART0用于通讯时做打印log用。 参考代码如下:

           void ICACHE_FLASH_ATTR uart_init_new(void)
           {
          // Wait for FIFOs to be emptied
            UART_WaitTxFifoEmpty(UART0);
            UART_WaitTxFifoEmpty(UART1);
            // Configure UART settings
            UART_ConfigTypeDef uart_config;
            uart_config.baud_rate  = BIT_RATE_74880;
            uart_config.data_bits   = UART_WordLength_8b;
            uart_config.parity     = USART_Parity_None;
            uart_config.stop_bits   = USART_StopBits_1
            uart_config.flow_ctrl   = USART_HardwareFlowControl_None;
            uart_config.UART_RxFlowThresh = 120;
            uart_config.UART_InverseMask = UART_None_Inverse;
            UART_ParamConfig(UART0, &uart_config);
            UART_IntrConfTypeDef uart_intr;
            uart_intr.UART_IntrEnMask = UART_RXFIFO_TOUT_INT_ENA | UART_FRM_ERR_INT_ENA | UART_RXFIFO_FULL_INT_ENA;
            uart_intr.UART_RX_FifoFullIntrThresh = 100;
            uart_intr.UART_RX_TimeOutIntrThresh = 2;
            uart_intr.UART_TX_FifoEmptyIntrThresh = 20;
            UART_IntrConfig(UART0, &uart_intr);
            // Set UART1 for printing
            UART_SetPrintPort(UART1);
            // Register interrupt handler
            UART_intr_handler_register(uart0_rx_intr_handler);
            ETS_UART_INTR_ENABLE();
           }

* 上电为什么输出乱码?

Power-garbled output is normal, because the external crystal option is 26M, please select the baud rate of 74880, 按下复位键或把RST引脚拉低再拉高you can see the startup information. Can be used 安信可串口调试助手to view, aithinker_serial_tool_v1.2.3.7z

* Why does the compiler will happen when sdk irom0_0_segerror?

Guess you like

Origin www.cnblogs.com/CodeWorkerLiMing/p/11256388.html