普誠創智(成都)科技有限公司-论坛

标题: PT32之WIFI应用——ESP8266模块 V1.0基本操作:建立server [打印本页]

作者: VIC_YU    时间: 2017-9-14 15:29
标题: PT32之WIFI应用——ESP8266模块 V1.0基本操作:建立server
ESP8266模块 V1.0基本操作:建立server

波特率设置
AT+CIOBAUD=9600
{0x41,0x54,0x2B,0x43,0x49,0x4F,0x42,0x41,0x55,0x44,0x3D,0x39,0x36,0x30,0x30,0x0D,0x0A}

网络模式
AT+CWMODE=3
{0x41,0x54,0x2B,0x43,0x57,0x4D,0x4F,0x44,0x45,0x3D,0x33,0x0D,0x0A}

网络ID 、密码
AT+CWSAP="LED","1234567890",11,3
{0x41,0x54,0x2B,0x43,0x57,0x53,0x41,0x50,0x3D,0x22,0x4C,0x45,0x44,0x22,0x2C,0x22,0x31,0x32,0x33,
0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x22,0x2C,0x31,0x31,0x2C,0x33,0x0D,0x0A}

工作模式
AT+CIPMUX=1
{0x41,0x54,0x2B,0x43,0x49,0x50,0x4D,0x55,0x58,0x3D,0x31,0x0D,0x0A}

服务端口
AT+CIPSERVER=1,2001
{0x41,0x54,0x2B,0x43,0x49,0x50,0x53,0x45,0x52,0x56,0x45,0x52,0x3D,0x31,0x2C,0x32,0x30,0x30,0x31,0x0D,0x0A}

链接超时设置 1-999s 0为时间无限
AT+CIPSTO=0
{0x41,0x54,0x2B,0x43,0x49,0x50,0x53,0x54,0x4F,0x3D,0x30,0x0D,0x0A}


MCU数据上传方法:
先写此命令:AT+CIPSEND=0,4   ,0代表发送给第一个链接的设备,4代表数据长度
再写入:要发送数据

手机往下发送数据通过ESP8266内部转换后输出数据格式
如手机端发送"W"  ->    0D 0A 2B 49 50 44 2C 31 2C 33 3A 57  总共12byte
如手机端发送"D"   ->    0D 0A 2B 49 50 44 2C 31 2C 33 3A 44  总共12byte



作者: Youke_Yang    时间: 2017-9-19 09:54
赞!
作者: James_Jiang    时间: 2017-9-19 17:28
VERY GOOD




欢迎光临 普誠創智(成都)科技有限公司-论坛 (https://princeton.com.cn/) Powered by Discuz! X3.2