本产品是一款具有 WiFi 功能的树莓派 Pico 扩展板,通用串口 AT 指令控制,支持 TCP/UDP 协议通信,可轻松通过 WiFi 实现联网。搭配树莓派 Pico 使用,可实现物联网通信应用。
通讯接口 | UART |
串口波特率 | 115200 bps |
通信接口 | UART |
WiFi标准 | IEEE 802.11b/g/n |
频率范围 | 2400 ~ 2483.5 MHz |
WiFi 工作模式 | WiFi STA,WiFi AP,WiFi STA+AP |
天线 | 板载 PCB 天线 |
工作电压 | 3.3 V |
工作温度 | -40℃ ~ 85℃ |
产品尺寸 | 58 × 25 mm |
- AT
- 响应:
- AT
- OK
- AT+RST
- 响应:
- AT+RST
- OK
- AT+GMR
- 响应:
- AT+GMR
- AT version:1.2.0.0(Jul 1 2016 20:04:45)
- SDK version:1.5.4.1(39cb9a32)
- Ai-Thinker Technology Co. Ltd.
- v1.5.4.1-a Nov 30 2017 15:54:29
- OK
- AT+CWMODE=3 //softAP+station mode
- 响应 :
- OK
- AT+CWJAP="SSID","password" //SSID and password of router
- 响应 :
- AT+CWJAP="SSID","password"
- OK
- WIFI CONNECTED
- WIFI GOT IP
- AT+CIFSR
- 响应 :
- +CIFSR:APIP,"192.168.4.1"
- +CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
- +CIFSR:STAIP,"192.168.3.133"
- +CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
- OK
- AT+CIPSTART="TCP","192.168.3.116",8080 //protocol, server IP and port
- 响应 :
- CONNECT
- OK
- AT+CIPSEND=4 //set date length which will be sent, such as 4 bytes
- >test //enter the data, no CR
- 响应 :
- Recv 4 bytes
- SEND OK
- +IPD,n:xxxxxxxxxx //received n bytes, data=xxxxxxxxxxx
- AT+CIPMODE=1
- 响应 :
- OK
- AT+CIPSEND
- > //From now on, data received from UART will be transmitted to server automatically.
在透传发送数据过程中,若识别到单独的⼀包数据 “+++”,则退出透传发送。
- AT+CIPMODE=0
- 响应 :
- OK
- AT+CIPCLOSE
- 响应 :
- CLOSED
- OK
- AT+CWMODE=3 //softAP+station mode
- 响应 :
- OK
- AT+CWJAP="SSID","password" //SSID and password of router
- 响应 :
- OK
- AT+CIFSR
- 响应 :
- +CIFSR:APIP,"192.168.4.1"
- +CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
- +CIFSR:STAIP,"192.168.3.133"
- +CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
- OK
- AT+CIPMUX=1
- 响应 :
- OK
注意:如果出现“IPMODE must be 0”则需要断开ESP8266连接,然后再输入指令即可,若不行则通过按键或者断电重启模块再重新操作。
- AT+CIPSERVER=1 // default port = 333
- 响应 :
- OK
- //ID number of connection is defaulted to be 0.
- AT+CIPSEND=0,4 //send 4 bytes to connection NO.0
- >test //enter the data, no CR
- 响应 :
- Recv 4 bytes
- SEND OK
- +IPD,0,n:xxxxxxxxxx //received n bytes, data=xxxxxxxxxxx
- AT+CIPCLOSE
- 响应 :
- CLOSED
- OK
UDP 传输不区分 server 或者 client ,由指令 AT+CIPSTART 建⽴传输。
- AT+CWMODE=3 //softAP+station mode
- 响应 :
- OK
- AT+CWJAP="SSID","password" //SSID and password of router
- 响应 :
- AT+CWJAP="SSID","password"
- OK
- WIFI CONNECTED
- WIFI GOT IP
- AT+CIFSR
- 响应 :
- +CIFSR:APIP,"192.168.4.1"
- +CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
- +CIFSR:STAIP,"192.168.3.133"
- +CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
- OK
- AT+CIPMUX=1
- 响应 :
- OK
注意:如果出现“IPMODE must be 0”则需要断开ESP8266连接,然后再输入指令即可,若不行则通过按键或者断电重启模块再重新操作。
- AT+CIPSTART=4,"UDP","192.168.101.110",8080,1112,0
- 响应 :
- 4,CONNNECT
- OK
说明:
示例指令中的参数说明如下:
- AT+CIPSEND=4,7 //Send 7 bytes to transmission NO.4
- >UDPtest // enter the data, no CR
- 响应 :
- Recv 7 bytes
- SEND OK
注意:
- +IPD,4,n:xxxxxxxxxx //received n bytes, data=xxxxxxxxxxx
- AT+CIPMODE=1
- 响应 :
- OK
- AT+CIPSEND
- > //From now on, data received from UART will be transmitted to server automatically.
在透传发送数据过程中,若识别到单独的⼀包数据 “+++”,则退出透传发送。
- AT+CIPMODE=0
- 响应 :
- OK
- AT+CIPCLOSE=4
- 响应 :
- 4,CLOSED
- OK
运行MicroPython程序前Pico需要先下载MicroPython固件,并安装Thonny IDE,配置主板环境选择Rasberry Pi选项。