当前位置:网站首页>Light up through TCP
Light up through TCP
2022-07-21 01:22:00 【parasoft】
Simply record your study notes , Use hardware STM32F103_MINI Development board + Adapter plate +esp8266, Applet Baiwen embedded Internet applet (TCP).
Development board use esp8266 In the same LAN as the mobile applet , Development board use esp8266 Set to TCP The server , Mobile applet as TCP client , So as to realize the two-way communication of data .
The first half is to set the development board to TCP The serial port of the server prints information .
The middle part is the development of mobile phone applet connection TCP After the server (192.168.1.6:9999), Data sent to mobile server .
The second half is the data sent by the development board to the mobile applet .
The most important part here is the upper part , Set the development board to TCP The server . The following steps are required :
(1) Reset esp8266
ESP8266_SendCommand("AT+RST", "OK", 500);
HAL_Delay(1000);
(2) Set up esp8266 Pattern (1:Station Pattern )
ESP8266_SendCommand("AT+CWMODE=1", "OK", 500);
(3) Development board connection wifi.
ESP8266_SendCommand("AT+CWJAP=\"wifi_name\",\"wifi_password\"", "OK", 5000);
(4) Set up multiple connections
ESP8266_SendCommand("AT+CIPMUX=1", "OK", 500);
(5) there 1 establish tcp The server ,999 Represents a port
ESP8266_SendCommand("AT+CIPSERVER=1,9999", "OK", 500);
(6) View the current ip
ESP8266_SendCommand("AT+CIFSR", "OK", 500);
(7) send data , First mover length required , And then there's the data , such as :
AT+CIPSEND=0,9
{1234567}
(8) receive data
IPD,0,9{1234567}
In addition to using wechat applet to communicate with the development board , We can also use TCP The client communicates with it , The effect is the same .
边栏推荐
猜你喜欢
EASYCODE plug-in use
Qt:Could not find qmake spec ‘default’. Error while parsing file xxx. pro. Giving up
Solution to remote access failure of docker installation MySQL in virtual machine
模糊照片秒变高清大图,飞桨PPDE带你复现图像恢复模型CMFNet
jmeter 连接ORACLE数据库
Which domestic API tool is better? It turned out to be it
【731. 我的日程安排表 II】
TestNG自动化测试框架详解
DNS域名解析
[leetcode] 12. Arbre binaire équilibré · Arbre binaire équilibré
随机推荐
ISecOps智能安全运营技术体系框架
Vivo official website app full model UI adaptation scheme
redisconnectionfactory could not autowired
EASYCODE plug-in use
哈希表(HashTable)
AVL tree
Comparison of creation speed of Tkinter various control Libraries
3 种缓存更新策略是怎样的?
mim命令
【Pygame小游戏】魂斗罗经典BOSS都回来了 准备好再次击败他们了吗?(附源码)
冒泡排序和快速排序
[leetcode] 12. Arbre binaire équilibré · Arbre binaire équilibré
【LeetCode】12. Balanced binary tree
进程间的通信方式
[model evaluation]
Frontier and application of data security technology from the perspective of compliance
acwing 871. 约数之和
丢失了数据库密码,如何恢复?
详解Redis的RDB和AOF
QT web development - Notes - 2