ESP8266-01 WiFi模块用户手册V1.0.doc
- 格式:pdf
- 大小:1.01 MB
- 文档页数:31
ESP8266 WiFi模块用户手册_ 术语和缩写 (4)k 产品简介 (5)二 捱遊 (5)产品特性 (5)模块封装....模块基本参数 硬件介绍 功耗二射频指标 ............................................................................................................................................................................................. 12 二A± ...................................................................................................................................................................................................... 13 二WiFi 天线 ................................................................................................................................................................................................... 14 二 推荐炉温曲线 .. (14)乙 功能描述 (15)二主要功能 ..................................................................................................................................................................................................... 15 二工作模式 ..................................................................................................................................................................................................... 15 ・ 应用领域 ..................................................................................................................................................................................................... 15 二AiCloud .................................................................................................................................................................................................... 15 L全功能测试版介绍 .............................................................................................................................................................................................. 16 二测试步骤 ..................................................................................................................................................................................................... 17 二 基砂AT 指令 (20)测试AT (20)二 WiFi 功能AT 指令 (20)选择WiFi 应用模式:AT+CWM0DE (20)列出当前可用接入点:AT+CWLAP (21)加入接入点:AT+CWJAP (21)退出接入点:AT+CWQAP (22)设置AP 模式下的参数:AT+CWSAP (22)TCPIP AT 指令 (23)建立 TCP/UDP 连接:AT+CIPSTART (23)获得 TCP/UDP 连接状态:AT+CIPSTATUS (23)启动多连接:AT+CIPMUX (24)发送数据:AT+CIPSEND (25)关闭 TCP/UDP 连接:AT+CIPCL0SE (25)6 7 8 11获取本地IP地址:AT+CIFSR (26)配置为服务器: (27)选择 TCPIP 应用模式:AT+CIPMODE (30)设置服务器主动断开的超时时间:AT+CIPST0 (30)设置波特率:AT+CI0BAUD (30)4. 产品试用 (31)表格目录表格1 术语和缩写4表格2 模块技术规格7表格3 Pin脚定义10表格4 功耗数据11表格5 射频指标12 &图目录图2 模块管脚排列图 (8)图3 天线图 (13)图4 V/iFi射频参考电路图 (14)图5 推荐回流曲线图 (14)图6 全功能测试板板正面视图 (16)术语和缩写表格1 术语和缩写1.产品简介1.1.(1.2.概述ESP8266是一款超低功耗的UART-WiFi透传模块,拥有业内极富竞争力的封装尺寸和超低能耗技术,专为移动设备和物联网应用设计.可将用户的物理设备连接到Wi-Fi无线网络上,进行互联网或局域网通信,实现联网功能。
ESP8266新手入门调试教程指导含目录目录:1.介绍2.准备工作3.环境配置4.连接硬件5.安装驱动程序6.编写代码7.编译和烧录8.调试与测试1.介绍:2.准备工作:在开始调试之前,你需要准备以下工具和材料:- ESP8266模块 (如NodeMCU)-一台计算机-USB数据线-杜邦线-LED灯3.环境配置:4.连接硬件:将ESP8266模块通过USB数据线连接到计算机的USB接口上。
确保连接稳定,没有松动或接触不良的问题。
5.安装驱动程序:大多数操作系统都会自动检测并安装ESP8266模块的驱动程序。
如果你的操作系统无法自动识别设备,请在官方网站上找到合适的驱动程序进行安装。
6.编写代码:打开Arduino IDE,在"文件"菜单中选择"新建",并将以下代码粘贴到新建的文件中:```c++#define LED_PIN 2 // 设置LED灯的引脚void setupinMode(LED_PIN, OUTPUT); // 将LED引脚设置为输出void loodigitalWrite(LED_PIN, HIGH); // 将LED引脚输出设为高电平,点亮LED灯delay(1000); // 延时1秒digitalWrite(LED_PIN, LOW); // 将LED引脚输出设为低电平,熄灭LED灯delay(1000); // 延时1秒```这段代码的作用是让ESP8266控制一个连接到引脚2的LED灯,每隔1秒钟进行一次闪烁。
7.编译和烧录:在Arduino IDE中,选择适合你的ESP8266板型和串口,点击"工具"菜单中的"板型"和"串口"进行设置。
然后点击工具栏上的"上传"按钮,将代码编译并烧录到ESP8266模块中。
8.调试与测试:完成烧录后,你应该可以看到LED灯开始闪烁。
OCROBOT SEED(WIFI模块)AT指令参考手册
通用指令部分
AT+Reset
版本号
AP操作指令部分
AT+MODE
AT+ExtAP
退出网络
AT+SAP
配置模块为可登陆的wifi热点(仅在AP与Station+AP模式下有效)
TCP/IP指令部分
AT+MUX
配置单链接模式或者多链接模式(一般使用推荐配置成单链接模式,使用简单)
建立TCP或者UDP链接
单链接模式下
多链接模式
获取链接状态
AT+UpDate 发送数据
多链接模式
关闭链接
单链接模式
建立服务器,接受数据(请注意:一定要开启多链接模式才能启用)
其他显示指令
+IPD指令
这个指令为系统收到数据的自动返回指令格式如下+IPD,<数据长度>,<数据> +IPD,<链接ID>,<数据长度>,<数据>。
ESP8266 ESP-01调试全过程–使用指导测试&编写&汇总by fairyhui 一接线注意:本系统是3.3V ! 请勿接5V !新版(全IO口引出版):此版本若想从FLASH启动进入AT系统,只需CH-PD引脚接VCC或接上拉(不接上拉的情况下,串口可能无数据),其余三个引脚可选择悬空或接VCC(但群里(@云海之梦)反映接VCC后导致无法正常启动)(GPIO0为高电平代表从FLASH启动,GPIO0为低电平代表进入系统升级状态,此时可以经过串口升级内部固件RST(GPIO16)可做外部硬件复位使用)测试系统不同,接线方法也选择多多,请各位根据自己的情况进行选择,推荐接法:在CH-PD和VCC之间焊接电阻后,将UTXD,GND,VCC,URXD连上USB-TTL(两者的TXD和RXD交叉接)即可进行测试旧版(AT指令版):该版本中间四根线悬空即可。
群里(@ZR(小R))反应:接线正确的情况下,连上USB转TTL,红灯蓝灯闪烁一下以后全灭,此现象为模块电流过大,超过了USB转TLL模块的承受范围。
解决办法:1. CH-PD换一个阻值更大的上拉电阻;2.换个承受电流大一点USB转TLL模块(群众们也可以自己改造) (@ZR(小R))反应:在供电不足的情况下,收到的响应为乱码。
请各位检查下供电电压是否足够。
二上电:正常工作验证本模块可以工作在三种模式:1. STA 2 .AP 3 .AP+STA,出厂设置为第三种上电后,蓝色灯微弱闪烁后熄灭,红灯长亮1. 搜索无线网络,可见ESP_XXXXXX已经处于列表中(后面的数字是MAC地址后几位)连接该网络以后,查看连接状态:手机搜索该网络,也可连接上:2.使用USR-TCP232-Test.exe进行测试:软件配置如下图:注意:(1)波特率一般在出厂情况下默认的是115200。
如果在115200情况下收到的是乱码可以试试其他波特率(旧版本的默认波特率可能是其他数值)。
esp8266 教程ESP8266教程:连接WiFi网络步骤一:准备工作1.1 确保你已经具备以下物品:- ESP8266模块- 电脑- USB转串口模块- 杜邦线1.2 安装USB驱动程序在使用ESP8266之前,我们需要先安装USB转串口模块所需的驱动程序。
根据你所使用的转接模块型号,下载并安装相应的驱动程序。
步骤二:连接硬件2.1 将ESP8266与USB转串口模块连接起来。
使用杜邦线将ESP8266的VCC引脚连接到USB转串口模块的VCC引脚,将GND引脚连接到GND引脚,将TX引脚连接到RX引脚,将RX引脚连接到TX引脚。
2.2 将USB转串口模块连接到电脑的USB接口上。
步骤三:编写代码3.1 打开Arduino IDE,新建一个代码文件。
3.2 导入ESP8266库在Arduino IDE中,点击"工具"->"管理库",搜索并安装ESP8266库。
3.3 编写代码接下来,我们开始编写代码。
以下是一个简单的示例,用于连接WiFi网络。
```cpp#include <ESP8266WiFi.h>const char* ssid = "YourWiFiNetworkName";const char* password = "YourWiFiNetworkPassword";void setup() {Serial.begin(115200);WiFi.begin(ssid, password);while (WiFi.status() != WL_CONNECTED) {delay(1000);Serial.println("Connecting to WiFi...");}Serial.println("Connected to WiFi!");}void loop() {// 这里可以添加你的代码逻辑}```备注:将"YourWiFiNetworkName"替换成你的WiFi网络名称,将"YourWiFiNetworkPassword"替换成你的WiFi网络密码。
E S P8266-08-W iF i模块用户手册V1.0ESP8266 WiFi模块用户手册V1.0目录术语和缩写 (4)1.产品简介 (5)1.1.概述 (5)1.1.1产品特性 (5)1.1.2模块封装 (6)1.1.3模块基本参数 (6)1.2.硬件介绍 (7)1.3.功耗 (10)1.4.射频指标 (11)1.5.尺寸 (13)1.6.WiFi 天线 (14)1.7.推荐炉温曲线 (14)2.功能描述 (15)2.1.主要功能 (15)2.2.工作模式 (15)2.3.应用领域 (16)2.4.AiCloud (16)3.全功能测试版介绍 (17)3.1.测试步骤 (18)3.2.基础AT指令 (22)3.2.1 测试AT (22)3.3.WiFi功能AT指令 (22)3.3.1 选择WiFi应用模式:AT+CWMODE (22)3.3.2列出当前可用接入点:AT+CWLAP (23)3.3.3 加入接入点:AT+CWJAP (23)3.3.4 退出接入点:AT+CWQAP (23)3.3.5设置AP模式下的参数:AT+CWSAP (24)3.4.TCPIP AT指令 (25)3.4.1建立TCP/UDP连接:AT+CIPSTART (25)3.4.2获得TCP/UDP连接状态:AT+CIPSTATUS (25)3.4.3启动多连接:AT+CIPMUX (26)3.4.4发送数据:AT+CIPSEND (27)3.4.5关闭TCP/UDP连接:AT+CIPCLOSE (27)3.4.6获取本地IP地址:AT+CIFSR (28)3.4.7配置为服务器: (29)3.4.8选择TCPIP应用模式:AT+CIPMODE (32)3.4.9设置服务器主动断开的超时时间:AT+CIPSTO (32)3.4.10设置波特率:AT+CIOBAUD (32)4.产品试用 (33)表格目录表格 1 术语和缩写4表格 2 模块技术规格7表格 3 Pin脚定义10表格 4 功耗数据11表格 5 射频指标12图目录图 2 模块管脚排列图 (8)图 3 尺寸图 (13)图 4 WiFi射频参考电路图 (14)图 5 推荐回流曲线图 (15)图 6 全功能测试板板正面视图 (17)术语和缩写表格 1 术语和缩写1.产品简介1.1.概述ESP8266是一款超低功耗的UART-WiFi 透传模块,拥有业内极富竞争力的封装尺寸和超低能耗技术,专为移动设备和物联网应用设计,可将用户的物理设备连接到Wi-Fi 无线网络上,进行互联网或局域网通信,实现联网功能。
用的这款各引脚功能:来至厂家提供的资料GPIO0 默认是工作模式(不接线)。
如果接了低电平就是下载模式(给模块刷固件!!),所以可以不接线,当然也可以接高电平。
反正一开始连接的时候CH_PD 必须为高电平。
其余的可以不接。
如果电脑的wifi 上显示了你的wifi 信号说明模块已经工作。
注意默认的波特率是115200!!!!!!设置好串口调试助手的波特率,再贴张图片吧防止亲们忘。
PIN FunctionDescription 1 URXD 1)UART_RXD ,接收;2)General Purpose Input/Output :GPIO3;2UTXD 1)UART_TXD ,发送;2)General Purpose Input/Output :GPIO1;3)开机时禁止下拉; 5RESET (GPIO 16) 外部Reset 信号,低电平复位,高电平工作(默认高); 6GND GND 8VCC 3.3V ,模块供电; 9 ANT WiFi Antenna11 GPIO0 1)默认WiFi Status :WiFi 工作状态指示灯控制信号;2)工作模式选择:上拉:Flash Boot ,工作模式;下拉:UART Download ,下载模式;12 ADC ADC ,输入范围:0V-1V ;13 GPIO15 下拉:工作模式;14 CH_PD 1)高电平工作;2)低电平模块供电关掉;15GPIO21)开机上电时必须为高电平,禁止硬件下拉;2)内部默认已拉高记得输入各种AT指令,勾选上“发送新行”些内部信息)然后输出READY!代表系统正系统启动后,系统会输出一堆乱码(其实不是乱码,系统启动后输出一常对于后面的操作--先提个醒,如果连接wifi出现连接不上的问题,可以发送AT+RESTORE 恢复出厂设置或刷固件先看秦时明月;;;;;;终于做好了,android客服端软件,(记得加权限,网络,和wifi。
E103-W01-IPX使用手册V1.01.模块介绍 (2)1.1.特点简介 (2)1.2.基本用法 (3)1.3.电气参数 (3)1.4.电气特性 (3)2.功能简述 (4)2.1.引脚定义 (4)2.2.模块功耗 (5)2.3.应用原理图 (5)3.快速入门 (6)3.1.模块作为Client与TCP服务器连接 (6)3.2.模块作为AP建立TCP SERVER与PC无线连接 (15)3.3.Smart Config使用 (17)3.4.PWM的使用 (18)3.5.GPIO的使用 (19)3.6.ADC的使用 (20)3.7.修改串口波特率 (20)4.组网说明 (21)4.1.组网角色 (21)4.2.组网模型 (21)5.AT指令 (23)6.定制合作 (24)7.关于我们 (25)1.模块介绍1.1.特点简介E103-W01是一款超高性价比的100mW(20dBm)串口转Wi-Fi模块,贴片小体积封装,陶瓷天线与IPX并存,工作在2.4~2.4835GHz频段。
模块可使用串口进行数据收发,降低了无线应用的门槛。
E103-W01模块是基于Espressif公司的ESP8266EX芯片研发。
模块集成了透传功能,即拿即用,支持串口AT指令集,服务器AT指令集,用户通过串口即可使用网络访问的功能,广泛应用于穿戴设备、家庭自动化、家庭安防、个人保健、智能家电、配饰与遥控器、汽车、照明、工业互联网等领域。
E103-W01模块支持标准的IEEE802.11b/g/n协议和完整的TCP/IP协议栈,支持STA/AP/STA+AP工作模式、支持SmartConfig、串口透传、IO口控制、开机透传、PWM输出、AD检测等功能,简单配置后便可以非常便利的实现网络访问功能,最大限度减少开发者的工作和项目开发时间。
典型应用:模块特点:√无线抄表√210ms开机透传,掉线自动连接√无线传感√多种波特率√智能家居√支持SmartConfig配置功能√工业遥控及遥测√支持TCPServer、TCPClient、UDP√智能楼宇及智能建筑√三种工作模式STATION、AP、STATION&AP√高压线监测√支持14mA低功耗数据接收√环境工程√支持串口透明传输√高速公路√支持多种加密方式√小型气象站√支持模块串口AT指令配置√自动化数据采集√支持可配置4路PWM输出√消费电子√内置看门狗,永不死机√智能机器人√参数记忆,掉电保存√路灯控制√1路10位精度ADC1.2.基本用法1.3.电气参数1.4.电气特性2.功能简述2.1.引脚定义2.2.模块功耗参数最小值典型值最大值单位Tx802.11b,CCK11Mbps,POUT=+17dBm165170180mA Tx802.11g,OFDM54Mbps,POUT=+15dBm135140150mA Tx802.11n,MCS7,POUT=+13dBm115120130mA Rx802.11b,1024bytes包长,-80dBm182023mA Rx802.11g,1024bytes包长,-70dBm535665mA Rx802.11n,1024bytes包长,-65dBm535665mA 部分睡眠131518mA睡眠0.80.9 1.1mA深度睡眠91011uA关机0.40.50.6uA 2.3.应用原理图注意:供电电源必须保证在3.0V~3.6V,为保证模块能稳定工作,建议外部选择电流大于300mA的LDO。
ESP8266串口wifi模块使用手册
一、模块引脚介绍
正常使用只需要VCC,GND,URXD,UTXD,CH_PD这5个io就可以,其中CH_PD正常使用时接高电平。
其他接口一般用于模块烧写固体是用到。
模块出厂已经烧有固体,波特率为115200。
二、模块与407开发板(高配版)V3.1连接
由于wifi模块接口与网络芯片DP83838公用IO口,所以在使用wifi模块时,需要把P5,上图红色圈出来的短路帽全部拆掉,不要接。
三、实验操作与现象
1、P5短路帽全部拆掉
2、板子上电,下载配套的例程程序
3、板子断电,插上wifi模块
4、板子上电后,代码运行配置wifi模块工作在服务器
5、此时手机wifi搜索,可搜索到名为“qiming_wifi”的热点,连接此热点,密码为:0123456789
6、打开“启明WIFI”app,输入IP: 192.168.4.1 端口号5000
7、点击“连接”,连接成功后手机APP就可以控制开发板了第5、6步可以在程序中设置用户自己所需参数。
ESP8266 Phy Init Bin Parameter Configuration GuideVersion 1.0Espressif SystemsCopyright © 2018About This Guide This guide provides the parameter configuration for ESP8266 phy init bin.Release NotesDate Version Release notes2018.12V1.0Initial releaseDocumentation Change NotificationEspressif provides email notifications to keep customers updated on changes totechnical documentation. Please subscribe at https:///en/subscribe.CertificationDownload certificates for Espressif products from https:///en/certificates.Table of Contents....................................................................................... 1.Structure of ESP8266 Phy Init Bin 1.................................................................................... 2.Check Bits for ESP8266 Phy Init Bin 2.......................................................................................... 3.Version of ESP8266 Phy Init Bin 3............................................................................................... 4.Selection of Crystal Oscillator 4.......................................................................................................... 5.Six Levels of TX Power 5.......................................................................................... 6.TX Power for Various Data Rates 6.................................................................................................................... 7.TX Power Limits 7..........................................................................................7.1.Value Range of the TX Power Limits 77.2.Parameters for the TX Power Limits 7................................................................................................................................................................................................................. 8.RF Calibration 91. Structure of ESP8266 Phy Init Bin 1.Structure of ESP8266 Phy InitBin ESP8266 phy init bin is comprised of a 128-byte phy init data as shown in Table 1-1:Table 1-1. Structure of ESP8266 Phy Init BinName Sizephy init data128 bytes2. Check Bits for ESP8266 Phy Init Bin 2.Check Bits for ESP8266 PhyInit Bin The check bits for ESP8266 phy init bin are stored in byte zero of phy init data, and therelevant parameter is Init_bin_magic with default value of 0x5. The check bits are used forverifying the data location in ESP8266 phy init bin. If the parameter value is the same asthe default value when reading data, it is assumed that data are stored correctly inESP8266 phy init bin.Table 2-1. Check Bits for ESP8266 Phy Init BinLocation in phy init data Parameter Name Default Value Description0Init_bin_magic5For check3. Version of ESP8266 Phy Init Bin3.Version of ESP8266 Phy InitBinThe version information of ESP8266 phy init bin is stored in byte 1 of phy init data.For example, ESP8266_esp_data_bin_v08.bin represents Version 08, which is stored inbyte 1 as 0x8.Table 3-1. Version of ESP8266 Phy Init BinLocation in phy init data Parameter Name Default Value Description1Init_bin_version8phy init bin version4. Selection of Crystal Oscillator 4.Selection of Crystal OscillatorThe parameter crystal_sel allows you to select a crystal oscillator. The available options aregiven in Table 4-1. Currently, ESP8266 mainly supports 26 MHz and 40 MHz crystaloscillators.Table 4-1. Selection of Crystal OscillatorLocation in phy init data Parameter Name Default Value Description48crystal_sel10: 40 MHz crystal oscillator 1: 26 MHz crystal oscillator 2: 24 MHz crystal oscillator5. Six Levels of TX Power 5.Six Levels of TX PowerTX power can be switched between six levels. The indexes for the six levels are thenumbers from 0 to 5 at the end of the parameter names. For example, the index fortxpwr_qdb_0 is 0, representing the maximum TX power. From txpwr_qdb_0 totxpwr_qdb_5, the TX power decreases progressively.Default TX power settings can be found in Table 5-1.Table 5-1. Six Levels of TX PowerLocation in phy init data Parameter Name Default Value Unit Actual TX Power34txpwr_qdb_0780.25 dB19.5 dBm35txpwr_qdb_1740.25 dB18.5 dBm36txpwr_qdb_2700.25 dB17.5 dBm37txpwr_qdb_3640.25 dB16 dBm38txpwr_qdb_4600.25 dB15 dBm39txpwr_qdb_5560.25 dB14 dBm6. TX Power for Various Data Rates 6.TX Power for Various DataRates You can choose from any of the six TX power levels for different data rates. The columnDefault value in Table 6-1 contains the TX power index.Table 6-1. TX Power for Various Date RatesLocation in phy init data Parameter Name Data rate/mode DefaultValueDescription40txpwr_index_0MCS0, 1 Mbit/s, 2 Mbit/s, 5.5 Mbit/s, 11 Mbit/s,6 Mbit/s, 9 Mbit/s0Select txpwr_qdb_041txpwr_index_1MCS1, 12 Mbit/s0Select txpwr_qdb_0 42txpwr_index_2MCS2, 18 Mbit/s1Select txpwr_qdb_1 43txpwr_index_3MCS3, 24 Mbit/s1Select txpwr_qdb_1 44txpwr_index_4MCS4, 36 Mbit/s2Select txpwr_qdb_2 45txpwr_index_5MCS5, 48 Mbit/s3Select txpwr_qdb_3 46txpwr_index_6MCS6, 54 Mbit/s4Select txpwr_qdb_4 47txpwr_index_7MCS75Select txpwr_qdb_596txpwr_index_11b_en802.11b00: use txpwr_index_0 toset TX Power for 802.11b1: use bytes 97 and 98 toset TX Power for 802.11b97txpwr_index_11b_01 Mbit/s,2 Mbit/s0Select txpwr_qdb_098txpwr_index_11b_15.5 Mbit/s, 11 Mbit/s0Select txpwr_qdb_07. TX Power Limits7.TX Power LimitsThe TX power limits have been set mainly to limit the maximum powers for channels 1, 11,13 and 14 in order to conform to the certification test results.7.1.Value Range of the TX Power LimitsThe TX power limits are set against the six levels. The value range of the limits is [0:5],which includes the values presented in Table 7-1.7.2.Parameters for the TX Power LimitsThe parameters for the TX power limits are specified in Table 7-2. For example, if the valueof byte 78 is set to 2, the bytes 30-33 are enabled to configure the maximum TX powers for channels 1, 11, 13 and 14.Table 7-1. Values of the TX Power Limits ValueTX Power Limit (Unit: 0.25 dB)0txpwr_qdb_01txpwr_qdb_12txpwr_qdb_23txpwr_qdb_34txpwr_qdb_45txpwr_qdb_5Table 7-2. Parameters for the TX Power Limits Location inphy init data Parameter name Default value Description78fcc_enable 00: disable bytes 30-331: reserved2: enable bytes 30-33 to set maximum TXpower30mpwr_chan10Set the maximum TX power for 802.11 b/g/n mode at channel 1, range [0:5]. 0xf8 isan invalid parameter.31mpwr_chan110Set the maximum TX power for 802.11 b/g/n mode at channel 11, range [0:5]. 0xf8is an invalid parameter.7. TX Power Limits32mpwr_chan130Set the maximum TX power for 802.11 b/ g/n mode at channel 13, range [0:5]. 0xf8 is an invalid parameter.33mpwr_chan140Set the maximum TX power for 802.11 b/ g/n mode at channel 14, range [0:5]. 0xf8 is an invalid parameter.8. RF Calibration 8.RF CalibrationThe values of the parameter RF_calibration are shown in Table 8-1. To ensure better RFperformance, it is recommend to set RF_calibration to 3, otherwise the RF performancemay become poor.Table 8-1. Parameter of RF CalibrationLocation inphy init dataParameter name Default value Description114RF_calibration30 & 1: only used for setting TX power 2: No RF calibration3: Conduct all RF calibrationDisclaimer and Copyright NoticeInformation in this document, including URL references, is subject to change without notice.THIS DOCUMENT IS PROVIDED AS IS WITH NO WARRANTIES WHATSOEVER,INCLUDING ANY WARRANTY OF MERCHANTABILITY , NON-INFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE.All liability, including liability for infringement of any proprietary rights, relating to use of information in this document is disclaimed. No licenses express or implied, by estoppel or otherwise, to any intellectual property rights are granted herein.The Wi-Fi Alliance Member logo is a trademark of the Wi-Fi Alliance. The Bluetooth logo is a registered trademark of Bluetooth SIG.All trade names, trademarks and registered trademarks mentioned in this document are property of their respective owners, and are hereby acknowledged. Copyright © 2018 Espressif Inc. All rights reserved.Espressif IoT Team。
ESP8266-wifi模块使用方法
说明:学习esp8266wifi模块与电脑接收与发送数据。
一、原料
硬件:①esp8266-wifi模块
②usb转ttl
③5v转3.3v模块(esp8266仅支持3.3v电压,使用5v模块有几率会被烧坏)
④杜邦线
软件:串口工具sscom32
二、连线
1、wifi模块有8个引脚,要使用它,我们只需要用到5个引脚即可(红框)。
本来不准备画出连线图的,考虑到效率问题,在下面附上(应该多看看esp8266的学习文档,尝试自己连,然后再参考下面的)
2、插电源,插电脑
3、电脑上打开串口工具
插上电后,串口工具显示一堆乱码和一串英文。
这时候我们尝试输入AT并点击发送。
然而此时esp8266模块的默认波特率是115200,所以,不会返回任何数据给串口工具,所以我们需要将模块波特率改为9600才能用。
输入AT+UART=9600,8,1,0,0并点击发送。
然后重启模块。
重启之后,再次发送AT,这时候串口工具会返回OK。
这样就说明模块可以使用了。
模块配置是需要AT指令来执行的,不懂AT指令的话,自行百度哦。
我这里截一下常用的指令,不给你们写注释了(有些我也有点遗忘了,万一写错会误导你们),要学会多百度,不懂再问。
Your ESP8266 is an impressive, low cost WiFi module suitable for adding WiFi functionality to an existing microcontroller project via a UART serial connection. The module can even be reprogrammed to act as a standalone WiFi connected device–just add power!The feature list is impressive and includes:802.11 b/g/n protocol Wi-Fi Direct (P2P), soft-APIntegrated TCP/IP protocol stackThis guide is designed to help you get started with your new WiFi module so let’s start!The hardware connections required to connect to the ESP8266 module are fairly straight-forward but there are a couple of important items to note related to power:The ESP8266 requires 3.3V power–do not power it with 5 volts!The ESP8266 needs to communicate via serial at 3.3V and does not have 5V tolerant inputs,so you need level conversion to communicate with a 5V microcontroller like most Arduinos use.However , if you’re adventurous and have no fear you can possibly get away with ignoring the second requirement. But nobody takes any responsibility for what happens if you do. :)Here are the connections available on the ESP8266 WiFi module:ESP8266 WiFi Module Quick Start GuideIntroductionHardware ConnectionsNOTE:Links and Code (Software) Supplied or Referenced in this Document is supplied as a service to our customers and accuracy is not guaranteed nor is it an Endorsement of any particular part, supplier or manufacturer. Use of information and suitability for any application is at users own discretion and user assumes all risk.All rights are retained by the AuthorWhen power is applied to the module you should see the red power light turn on and the blue serial indicator light flicker briefly.If you have a 3.3V FTDI Serial to USB board you can get started without fear of destroying your new ESP8266 WiFi module. Do note that many FTDI boards have a solder jumper to convert from 3.3V to 5V operation so ensure it is set to enable 3.3V operation.Here are the connections required to enable communication with the module over serial:With FTDI 3.3V Board (Legit)DO NOT DO THIS! You may break your Arduino or your ESP8266 WiFi module.This method is a bad idea for a number of reasons:The ESP8266 does not have 5V tolerant inputs–you could destroy your WiFi module.The ESP8266 may draw more current than the 3.3V regulator on your Arduino can supply–you could damage your Arduino.The operation of the ESP8266 outside of stated limits may be unstable and unreliable–you could damage your sanity.This method does have one redeeming feature:If you already have an Arduino Uno R3 it’s really easy to get started and (mostly) worked for me. :)We’re essentially going to use your Arduino as a power supply and USB to serial converter so you need to ensure there is no sketch that interferes with the serial connection. There are a couple of ways to achieve this:Upload an “empty” sketch that doesn’t use the serial connection, e.g. BareMinimum from theWith Arduino Uno R3 (Quick but not very legit)examples menu; or,Remove the microcontroller from the Arduino board (if it is a DIP form factor–don’t undersolder an SMD one).Here are the connections required to enable communication with the module over serial in this configuration:Serial ControlWith the hardware connections in place you can communicate with the WiFi module through a serial terminal.Using Arduino IDE Serial MonitorIf you already have the Arduino IDE installed the easiest way to get started is to use the built-in Serial Monitor:1. Plug in the WiFi module.2. Choose the correct serial port from the Tools > Serial Port menu.3. Open the Serial Monitor via the Tools menu or “magnifying glass” icon on the editor window.4. For the default firmware version (00160901), ensure Carriage return is selected in the lineending pop-up menu at the bottom of the serial monitor. (For later versions it must be set toBoth NL & CR.)5. For the default firmware version, ensure the communication speed is set to 115200 baud. (Forlater versions or if it has been modified it will need to be 9600 baud or similar.)You’re now ready to send your first commands!Using GNU ScreenIt’s possible to use GNU Screen out of the box with the default version of the firmware (00160901) which expects Carriage-Return-only line endings, e.g. (on OS X):screen /dev/bserial-AB12345 115200Unfortunately the updated firmware versions require Carriage-Return-and-New-Line line endings and there appears to be no way to configure screen to send both with one key press. Instead, you need to press <enter> or Ctrl-M then follow that with Ctrl-J.You might have more success with something like minicom or picocom with later firmware versions.Now you’re ready to send your first commands!First Commands1. Ensure AT commands are received correctly (the AT seems not to be case sensitive but therest of any command is case sensitive):ATResponse:OKIf you don’t get this response check:Hardware connections (the blue LED on the board should flash). Try swapping RX & TX.Correct baudrate–should be 115200 on the default firmware version (00160901).Correct line endings–should be Carriage Return only for default firmware version (00160901).If it still doesn’t work, give up, you’ve probably got better things to do with your life…2. Ensure the module is in a known state by issuing a reset command:AT+RSTResponse:ets Jan 8 2013,rst cause:4, boot mode:(3,6)wdt resetload 0x40100000, len 24444, room 16tail 12chksum 0xe0ho 0 tail 12 room 4load 0x3ffe8000, len 3168, room 12tail 4chksum 0x93load 0x3ffe8c60, len 4956, room 4tail 8chksum 0xbdcsum 0xbdreadyOr similar. The important part is the ready on the last line.3. Check the firmware version:AT+GMRThe stock firmware produces this output:001609014. Enable the module to act as both a “Station” and an “Access Point”:AT+CWMODE=3Response:OK(You may need to perform another reset after changing this setting.)5. List surrounding WiFi networks.First, if you’re on (at least) the 00160901 firmware you need to work around an apparent firmware bug that hangs on listing WiFi networks if the last joined network is no longer available.The following command ensures no network details are stored for connection (you should get an OK) response:AT+CWJAP="",""(You can check to see what the currently stored network details are with:AT+CWJAP?which should generate the following output if no network details are stored:+CWJAP:""With a later firmware or if the last joined network is still in the vicinity you shouldn’t need to do this pre-step.)Now you send the actual command to list networks in the vicinity:AT+CWLAPYou should get a response like:+CWLAP:(0,"",0)+CWLAP:(3,"WiFiArtThouRomeo",-80)+CWLAP:(3,"Free Public WiFi",-51)+CWLAP:(3,"Guest",-91)OKSometimes you might get ERROR or no response–in which case you’ll have to try doing the USB plug/unplug cycle and try again. (Or the same with the ground jumper.)6. Join a suitable WiFi access point:AT+CWJAP="<access_point_name>","<password>"You should get an OK response.For example, with the above list of access points you might use:AT+CWJAP="Guest","MyVoiceIsMyPasswordSoWhyDoINeedThis?"You can check if the module has been allocated a IP address with:AT+CIFSRYou should get your current IP address in response, e.g:192.168.1.2Acting as a TCP ClientYou can connect to an internet server (e.g. a web server) with the following method:1. Enable multiple connections (you need an OK response):AT+CIPMUX=12. Specify which connection channel you wish to connect on (0-4), the protocol type (TCP/UDP),the IP address (or domain if you have DNS access) and the port number using the CIPSTART command:AT+CIPSTART=4,"TCP","",80You should receive the response OK followed by Linked when the connection is open:OKLinked3. Next you need to specify how much data you wish to send (after specifying which channel). In thisexample we’re going to send “GET / HTTP/1.0\r\n\r\n” which is 18 bytes:AT+CIPSEND=4,18This time, instead of an “OK” response your will get a > prompt:>This indicates the module is waiting for you to send the 18 bytes of data.Here it gets a bit messy if you’re using the Arduino serial monitor as you have to swap between the line ending the module requires (“Carriage return” only) and what the HTTP server is expecting (“Both NL & CR”). Change the setting to Both NL & CR and send the following (you will need to press Send a second time to send the empty line the HTTP server expects):GET / HTTP/1.0The module should respond with:SEND OKNow you should change the line ending setting to Carriage return only so you can send additional commands.The module should provide a second response once the web server responds:+IPD,4,530:The 4 indicates it’s data from connection channel 4 and the 530 indicates there’s 530 bytes of data. You should now see the data:HTTP/1.0 302 FoundCache-Control: privateContent-Type: ...Woo! You just put a thing on the internet…time to go find a VC!You’ll likely get an OK response or two and then eventually an indication that the server has closed the connection:UnlinkActing as a TCP ServerYou can enable the module to accept TCP connections (i.e. act as a server) in the following manner:1. Connect to a WiFi access point.2. Enable multiple connections.AT+CIPMUX=13. Find out the IP address of the module:AT+CIFSRNote the response, e.g.:192.168.1.24. Set the module to listen (first parameter, mode is set to 1) for a connection on a specific port(in this case port 1336):AT+CIPSERVER=1,13365. From another device on the same network connect to the listening port, e.g. with telnet:telnet 192.168.1.2 1336The module should display:LinkType some text into the telnet session, e.g.:KiwiconAte!The module should display the following (0 being the connection channel, 13 being the length of the data received:+IPD,0,13:KiwiconAte!OKYou can send data in response with the CIPSEND command as used previously, e.g. (0 is the channel, 8 is the length of the data):AT+CIPSEND=0,8The module will display the prompt:>Then you can send the data, e.g.:WhatEvsAnd then the module will respond with:SEND OKThe telnet session should now display:WhatEvsYou can then end the telnet session with by pressing Ctrl-] and q<enter>, the module will display:UnlinkActing as a WiFi Access PointIn addition to connecting to WiFi Access Points the module can also act as an Access Point–this means you can connect devices to the module without any other network infrastructure in place. Ideal for a local private shared “drop box” perhaps…1. The module comes with an access point pre-defined (SSID of “ESP_…”) but you can define yourown with:AT+CWSAP="NoWorriESSID","password",3,0The first parameter is the SSID name; the second parameter is the password; the third the WiFichannel–pick one not used in your area; and, the final parameter is the encryption standard to use.An encryption value of 0 turns encryption off which means the password is ignored–but it still can’t be an empty value. I couldn’t get any encryption to work though (it would always create an unencrypted network) you might have more luck–possibly with a more recent firmware…2. To actually enable the network to be created you need to set the “WiFi mode” of the module to “AP”(2) or “Both” (3):AT+CWMODE=3Now you will be able to connect to your module as an access point from another device (e.g. a laptop or a phone).3. You can list the IP address etc of any device connected to the network with:AT+CWLIFWhich generates the response:192.168.4.100, [...]4. Now you can run the server example from above and connect–note that the module always has theIP 192.168.4.1 when acting as an AP.Updating the firmwareYou’ll be pleased to know you’re not stuck with the ample list of features that ship with your module, no, because you can update the firmware of your module! Yes, that means you can get new features & new bugs too…Finding New Official FirmwareIt’s not particularly easy to find new official firmware versions–the links are spread over forums, wikis and Google Drive accounts which don’t look particularly legit.It seems like the best source of details is the “Updates” section of the “Firmware” section on this page: /w/Wi07c#FirmwareThis ridiculous URL (from the link entitled “Find most upated firmware on this google link” on the above ElectroDragon page) seems to list all the official firmware updates: https:///folderview? id=0B3dUKfqzZnlwR2pVWjg3NXRVdW8&usp=drive_web&tid=0B3dUKfqzZnlwRjFaNTUzZFptbzg#listConsider uploading one of the following versions:ESP8266_flasher_V00170901_00_Cloud Update Ready.zipESP8266_AT_V00180902_02_baudrate watchdog added.zip(A note on version numbers: the version number 00160901 is made up of two parts: 0016 is theSDK version and 0901 is the AT command set version.)Once you’ve updated the firmware you also have the option of “Cloud Updates” but I’ve not managed to get any cloud update to work yet: /cloud-updating-your-wi07c-esp8266-now/Firmware Update ToolsWhile there are other tools for updating the firmware, for this example we’ll use esptoolhttps:///themadinventor/esptool/ which is cross platform and GPL licensed.Download the script file fromhttps:///themadinventor/esptool/master/esptool.py.Hardware Connections and Performing the UpdateIn order to update the firmware you need to configure the hardware to enter firmware update mode:1. Disconnect the module from your computer.2. Connect GPIO0 to ground (0 Volts) (“pulled low”) to enable firmware update mode.3. Reconnect the module to your computer.The module should now be in firmware update mode.(Note that the esptool docs say to ensure “GPIO2 is pulled high” but this doesn’t appear to be necessary.)Execute this command to perform the firmware update (the .bin file is from theESP8266_AT_V00180902_02_baudrate watchdog added.zip archive):python esptool.py --port /dev/bserial-ABC12345 write_flash 0x000000 " v0.9.2.2 AT Firmware.bin"You should receive progress updates during the upload process:Connecting...Erasing flash...Writing at 0x0007ec00... (100 %)Leaving...If you have problems connecting and have been using the Arduino IDE Serial Monitor ensure it isn’t open when trying to perform the upgrade. (Ask me how I know…)Once the update has completed:1. Disconnect the module from your computer.2. Remove the connection from GPIO0 to ground.3. Reconnect the module to your computer.You should now have a new firmware version installed and functioning.Note:The startup behaviour of the module is now different–it displays different output.The module now defaults to communicating at 9600 baud.The module now expects both carriage return and new line characters at the end of every line.New AT commands will be available and some bugs may have been fixed!Arduino and ESP8266Up until now you’ve been manually controlling the WiFI module via the serial console. It’s obviously possible to control the module programmatically via an Arduino sketch. At present there doesn’t seem like a “preferred” choice for an Arduino library to abstract the functionality but a few searches will find you Arduino examples to start with and presumably over time the Arduino community will settle on a preferred library.ESP8266 SDK and Custom FirmwareAn official Software Development Kit (SDK) has been released for the System-on-Chip (SoC) controller which powers the ESP8266 WiFi module. Using the SDK it’s possible to add extra features to the AT command firmware or even create a standalone firmware.Here’s a couple of custom firmwares to check out…NodeMcuLua based firmware for WiFi-SoC ESP8266: https:///nodemcu/nodemcu-firmwareVery cool and easy to get started with.Download the firmware:wget https:///nodemcu/nodemcu-firmware/raw/master/0.9.2/512k-flas h/nodemcu_512k.binFlash the firmware to the module:python esptool.py --port /dev/bserial-ABC123456 write_flash 0x000000 nodemcu_512k.binConnect to the module:screen /dev/bserial-ABC123456 9600Do the obvious…print("hello")For more details look at:https:///nodemcu/nodemcu-firmware#readmehttps:///nodemcu/nodemcu-firmware/wiki/nodemcu_api_enAT Command GPIO controlThere is a custom firmware with AT commands added to read and write the General PurposeInput/Output (GPIO) pins available–this enables you to control LEDs and read buttons with AT commands.For more details see: /esp8266-gpio-test-edited-firmware/More resourcesEspressif Systems (Designer): https:///en/products/esp8266/Espressif Systems Github: https:///espressifESP8266 Community Forum: /NURDspace on ESP8266: https://nurdspace.nl/ESP8266First setup of ESP8266 SDK: https://nurdspace.nl/ESP8266/First_setupElectroDragon on ESP8266: /w/Wi07cFinally…Have fun!Find updates to this guide and more information at /i/follower/p/notes-esp8266. This getting started guide is brought to you by Kiwicon 8 and !。
ESP8266TCP/UDP通信配置手册LZM写2018年3月28日一、材料准备实验所需材料如表1所示。
表1材料准备名称图片ESP8266USB转TTL模块ESP8266配置软件网络调试助手串口调试助手二、设备连接将ESP8266WIFI模块与串口调试助手连接起来,如图1所示。
图1ESP826模块与USB转TTL模块连接在将练接好的TTL插到电脑USB插位置上,需要注意的是Esp8266的Tx接USB转TTL模块的Rx,Esp8266的Rx接USB转TTL模块的Tx,否则配置不了Esp8266模块。
三、ESP8266基本配置1.连接电脑打开ESP8266配置软件,做如图中标记设置,如图2所示。
图2打开ESP8266配置软件将TTL模块与电脑连接好,在本配置软件选择串口号、波特率,选择完成点击打开串口按钮,软件连接完成后,点击串口测试按钮如图3所示。
图3Esp8266连接到配置软件点击版本信息按钮,在接收区有如下数据说明与电脑通信没有问题,如图4所示。
图4确认通信是否成功如果接收去没有类似上述信息返回,原因分析如下:①串口是否选择正确,请查看电脑管理(G)查看连接端口。
②波特率是否选择正确,请查看购买Esp8266模块手册,查看模块默认波特率,一般默认为9600或者115200。
③Esp8266模块与USB转TTL模块线序没有连接正确。
④USB转TTL模块是否损坏或者,或者未安装USB转TTL模块的驱动。
⑤Esp8266模块是否损坏。
⑥Esp8266模块是否已经进入透传模式,如是请退出。
四、Esp8266透传模式下的TCP通信透传模式:透传就是指你不需要关心wifi协议是如何实现的,你所需要做的就是A通过串口发数据B通过串口收数据。
整个过程中A串口和B串口就像是用导线直接连接起来了一样。
A发什么数据B 就接收什么数据。
1.点击开机透传按钮后,点击“进入STA模式”按钮,然后在输入Esp8266待接入路由器(热点)的WIFI名称以及WIFI密码,输入完成后点击“开机WIFI”按钮,查看接收区是否返回“ok”,如返回配置成功,配置如图5、图6所示。
User Manual V1.2The ESP8266 is the name of a micro controller designed by Espressif Systems. The ESP8266 itself is a self-contained WiFi networking solution offering as a bridge from existing micro controller to WiFi and is also capable of running self-contained applications. This module comes with a built in USB connector and a rich assortment of pin-outs. With a micro USB cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble, just like Arduino. It is also immediately breadboard friendly.Table of Contents1. Specification: (3)2. Pin Definition: (3)3. Using Arduino IDE (3)3.1 Install the Arduino IDE 1.6.4 or greater (4)3.2 Install the ESP8266 Board Package (4)3.3 Setup ESP8266 Support (5)3.4 Blink Test (7)3.5 Connecting via WiFi (9)4. Flashing NodeMCU Firmware on the ESP8266 using Windows (12)4.1 Parts Required: (12)4.2 Pin Assignment: (12)4.3 Wiring: (13)4.4 Downloading NodeMCU Flasher for Windows (13)4.5 Flashing your ESP8266 using Windows (13)5. Getting Started with the ESPlorer IDE (15)5.1 Installing ESPlorer (15)5.2 Schematics (18)5.3 Writing Your Lua Script (18)6. NodeMCU GPIO for Lua (22)7. Web Resources: (22)ing Arduino IDEClick ‘File’ -> ‘Preferences’ to access this panel. Next, use the Board manager to install the ESP8266 package.Click ‘Tools’ -> ‘Board:’ -> ‘Board Manager…’ to access this panel.Scroll down to ‘ esp8266 by ESP8266 Community ’ and click “Install” button to install the ESP8266 library package. Once installation completed, close and re-open Arduino IDE for ESP8266 library to take effect.Setup ESP8266 SupportWhen you've restarted Arduino IDE, select ‘Generic ESP8266 Module’ from the ‘Tools’ -> ‘Board:’ dropdown menu. Select 80 MHz as the CPU frequency (you can try 160 MHz overclock later)Find out which Com Port is assign for CH340 Select the correct Com Port as indicated on ‘Device Manager” Note: if this is your first time using CH340 “ USB-to-Serial ” interface, please install the driver first before proceed the above Com Port setting. The CH340 driver can be download from the below site:Once the ESP board is in bootload mode, upload the sketch via the IDE, Figure 3-2.Figure3-1: Connection diagram for the blinking testFigure 3.2: Uploading the sketch to ESP8266 NodeMCU module.The sketch will start immediately - you'll see the LED blinking. Hooray!Connecting via WiFiOK once you've got the LED blinking, let’s go straight to the fun part, connecting to a webserver. Create a new sketchconst char* host ="";void setup(){Serial.begin(115200);delay(100);// We start by connecting to a WiFi networkSerial.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");Serial.println("IP address: ");Serial.println(WiFi.localIP());}int value =0;void loop(){delay(5000);++value;Serial.print("connecting to ");Serial.println(host);// Use WiFiClient class to create TCP connectionsWiFiClient client;const int httpPort =80;if(!client.connect(host, httpPort)){Serial.println("connection failed");return;}// We now create a URI for the requestString url ="/projects/index.html";Serial.print("Requesting URL: ");Serial.println(url);// This will send the request to the serverclient.print(String("GET ")+ url +" HTTP/1.1\r\n"+"Host: "+ host +"\r\n"+"Connection: close\r\n\r\n");delay(500);// Read all the lines of the reply from server and print them to Serial while(client.available()){String line = client.readStringUntil('\r');Serial.print(line);}Serial.println();Serial.println("closing connection");}That's it, pretty easy right ! This section is just to get you started and test out your module.ESP8266 Module Breadboard Friendly with Header ConnectorESP8266 Module Breadboard FriendlyPL2303HX USB-UART Converter CableSome Male-to-Female Jumper WiresESP8266 Pin DescriptionCH_PD Pull high, connect to Vcc +3.3VVcc Power Supply +3.3VTXD Connect to RXD (white) of PL2303HX USB-Serial converter cable RXD Connect to TXD (Green) of PL2303HX USB-Serial converter cable GPIO0 Pull low, connect to GND pinGND Power Supply groundPress the button “Flash” and it should start the flashing process immediately, showing the Module MAC address if After finishing this flashing process, it should appear a green circle with a check icon at lower left corner.Your ESP8266 module is now loaded with NodeMCU firmware.Here’s a rundown of the features the ESPlorer IDE includes:Syntax highlighting LUA and Python code.Code editor color themes: default, dark, Eclipse, IDEA, Visual Studio.Undo/Redo editors features.Code Autocomplete (Ctrl+Space).Below the Code Window, you have 12 buttons that offer you all the functions you could possible need to interact with your ESP8266. Here’s the ones you’ll use most: “Save to ESP” and “Send to ESP”.5.3 Writing Your Lua ScriptBelow is your script to blink an LED.lighton=0pin=4gpio.mode(pin,gpio.OUTPUT)Right now you don’t need to worry how this code works, but how you can upload it to your ESP8266.Look at the top right corner of your ESPlorer IDE and follow these instructions: Press the Refresh button.Select the COM port for your FTDI programmer.Select your baudrate.Click Open.Copy your Lua script to the code window (as you can see in the Figure below):Congratulations, you’ve made it! The blue LED at the upper right corner should be blinking every 2 seconds!6. NodeMCU GPIO for LuaThe GPIO(General Purpose Input/Output) allows us to access to pins of ESP8266 , all the pins of ESP8266 accessed using the command GPIO, all the access is based on the I/O index number on the NoddMCU dev kits, not the internal GPIO pin, for example, the pin ‘D7’ on the NodeMCU dev kit is mapped to the internal GPIO pin 13, if you want to turn ‘High’ or ‘Low’ that particular pin you need to called the pin number ‘7’, not the internal GPIO of the pin. When you are programming with generic ESP8266 this confusion will arise which pin needs to be called during programming, if you are using NodeMCU devkit, it has come prepared for working with Lua interpreter which can easily program by looking the pin names associated on the Lua board. If you are using generic ESP8266 device or any other vendor boards please refer to the table below to know which IO index is associated to the internal GPIO of ESP8266.Nodemcu dev kit ESP8266 Pin Nodemcu devkitESP8266 PinD0 GPIO16 D7 GPIO13D1 GPIO5 D8 GPIO15D2 GPIO4 D9 GPIO3D3 GPIO0 D10 GPIO1D4 GPIO2 D11 GPIO9D5 GPIO14 D12 GPIO10D6 GPIO12D0 or GPIO16 can be used only as a read and write pin, no other options like PWM/I2C are supported by this pin.In our example in chapter 5 on blinking the blue LED, the blue LED in connected to GPIO2, it is defined as Pin4 (D4) in Lua script.7. Web Resources:•ESP8266 Lua Nodemcu WIFI Module•ESP8266 Breadboard Friendly Module•ESP8266 Remote Serial WIFI Module•PL2303HX USB-UART Converter Cable。
安信可科技ESP8266系列测试板说明文档V 0.1本测试板支持本厂所有ESP_8266 系列模块整套带测试板建议零售价:50元设计目的:给所有客户提供一个标准全功能而又经济适用的体验平台!客户拿到手直接测试,而没有任何争议的环节。
本测试板能完成什么:拥有本测试板,你可以无需任何其他开发工具,对ESP8266模块进行AT类应用与SDK 类应用开发,可以直接烧写板子MCU。
也可以烧写ESP8266内置SOC从而应用SDK,一个简单的演示功能:用安卓手机做的一个控制界面,用手机WIFI和板载WIFI进行数据交互,让手机控制板载WIFI输出数据,板载CPU收到数据后控制板载三色灯,和继电器以及蜂鸣器的动作!当然你还可以进过串口调试工具,直接对板载WIFI模块进行手动测试!测试板上的标准配置1板载高速稳定的USB转TTL 芯片CH340,实测在升级本模块程序时候可到576000KBPS 2板载STC的STC15W408AS 单时钟周期,高速51单片机。
直接用本板烧写程序3本开发板出厂时默认带一块ESP系列WIFI模块,客户可选择适合自己的。
4若客户选外置天线版本,附送3DB高增益天线一个,50欧姆射频线一条5本测试板支持本厂所有类型WIFI模块,核心WIFI板子,经过转接板转成统一接口标准。
6板载高压继电器,可以控制外部220V 5A 的负载开关7板载3.3V 1A稳压芯片,客户不会因为电源的问题造成不启动,或工作不良。
8三个MCU 独享按键,可做输入测试9三个MCU独享LED灯,可走做输出测试106个WIFI模块独享按键,直接接ESP8266 有用IO116个WIFI模块独享受LED,接ESP8266 IO口12所有ESP8266 可用IO资源用2.54间距排针引出13附送迷你USB数据线,和1A 开关电源。
14留有普通2.4G模块接口,已经挂在单片机IO口上,可将WIFI转成普通2.4G,降低成本。
ESP8266使⽤⼊门教程芯⽚介绍:8266⽚上集成wifi+MCU,使⽤的是⼀个M0的内核,⽽且成本很低,因为⽚上有wifi和MCU,所以作为⽹络终端⾮常的⽅便,当然,因为是wifi,所以低功耗⽅⾯就别想了,低功耗+联⽹,NB-IOT更加合适。
固件:下⾯先介绍⼀下芯⽚固件的概念,说⽩了,esp8266也是⼀个单⽚机,上电还是得从0地址开始跑,平时我们使⽤单⽚机,⼀般都是使⽤keil等软件编程,然后下载,软件很多事情已经帮我们做好了,我们的重⼼放在main函数之后就⾏了。
所谓的固件,我们可以把它看做⼀个很⼤的程序,只不过⼈家帮我们写好了,上电就开始运⾏,然后⼀直等待我们给单⽚机发送指令,我们发送指令后就执⾏相应的操作。
esp8266的固件有两种AT固件,芯⽚出⼚的时候⾥边刷的就是AT固件,AT固件,⽤户主要通过串⼝使⽤AT指令跟8266交互,要控制8266。
所以使⽤这种固件的时候还需要⼀个主机通过串⼝跟8266连接,这种使⽤⽅法,就单纯将8266当做⼀个⽹络传输芯⽚,串⼝转wifi,本⽂不讨论AT固件。
Node-mcu固件,重点来了,因为这个固件才能完全发挥8266的魅⼒,先说⼀下这个固件的魅⼒,官⽅介绍是,这套固件,可以让8266像Arduino⼀样操作硬件IO,⽽且让你能完全使⽤API接⼝进⾏开发,更要命的是,固件⾥边可操作的模块还很多,像gpio操作、json处理、file⽂件创建管理、⽹络连接等等。
举个例⼦说明⼀个这个固件:这个固件就像是安卓⼿机的刷机包,刷机之后我们就可以通过图形界⾯进⾏各种操作,在安卓⼿机上运⾏各种应⽤程序,esp8266刷⼊nodemcu固件之后,也能在上边运⾏我们编写的应⽤程序。
下⾯放⼏段操作8266的代码1 --操作GPIO2 pin = 13 gpio.mode(pin,gpio.OUTPUT)4 gpio.write(pin,gpio.HIGH)5 gpio.mode(pin,gpio.INPUT)6 print(gpio.read(pin))78 --连接wifi9 wifi.setmode(wifi.STATION)10 wifi.sta.config("SSID","password")11 print(wifi.sta.getip())代码基本上不⽤注释,⼀看名称知道是做啥的下⾯开始讲如何搭建开发环境就像上⽂说的,芯⽚出⼚的时候是AT固件,要刷如nodemcu固件才能使⽤这种开发⽅式,说以先要刷固件,当初我开始看的时候,⽹上⼀⼤堆各种各样的各种版本的固件,不是说只有两种固件吗?现在先不⽤管这个,按照步骤来,后边慢慢说。