### this sample would make your ESP32 interact with any other platform using JSON exchange format
## Part 1 : main features
1. support multiple tcp client connections, user could define connections by MAX_LIENT_NUMBER
2. support TCP stream group packet, user could define it by TCP_STREAM_HEAD_CHECK
3. support JSON parsing sample and respond to client samplle
4. independent task to manager connections and data processing
## Part 2 : main workflow
1. ESP32 would play the role of TCP Server
2. TCP Client[we choose ubuntu platform] would connect and send JSON formatted data to ESP32
3. ESP32 would parse JSON data and respond to TCP Client
## Part 3 : how to make it run
Step 1: config ESP32
- config WiFi SSID and WiFi Password
- config default serial port
- config baud rate[optional]
Step 2: build sample and run TCP Server
```
$ make flash monitor
```
Step 3: compile the TCP Client
```
$gcc client.c
```
Step 4: send JSON data by TCP Client
```
./a.out "192.168.111.108" "{\"sample_para\":{\"value\":\"1\"}}"
```
**notes that IP address is the same with ESP32 got, we could see it when tcp server started**
## Part 4 : Notes about the sample
1. you should run hello-world example OK before you start this sample
2. there care about 4 Bytes JSON-length information in front of TCP data stream
3. respond to TCP Client not using JSON formatted data based on simplify TCP Client parse process consideration
没有合适的资源?快使用搜索试试~ 我知道了~
esp32 tcp 服务端和客户端程序
共25个文件
md:15个
h:2个
makefile:2个
1星 需积分: 33 62 下载量 101 浏览量
2019-02-01
20:40:53
上传
评论
收藏 16KB RAR 举报
温馨提示
来源github的esp32 tcp 客户端和服务端程序,支持阻塞和非阻塞
资源推荐
资源详情
资源评论
收起资源包目录
ESP32.rar (25个子文件)
ESP32
NonBlocking
TCPServer
TLS-TCP
README.md 0B
README.md 0B
SimpleTCP
README.md 0B
README.md 0B
TCPClient
TLS-TCP
README.md 0B
README.md 0B
SimpleTCP
README.md 0B
Blocking
TCPServer
TLS-TCP
README.md 0B
README.md 173B
SimpleTCP
main
tcp_server.c 22KB
component.mk 145B
tcp_server.h 2KB
Kconfig.projbuild 340B
Makefile 182B
README.md 1KB
README.md 192B
TCPClient
TLS-TCP
README.md 0B
README.md 0B
SimpleTCP
main
component.mk 145B
tcp_client.h 2KB
tcp_client.c 8KB
Kconfig.projbuild 340B
Makefile 182B
README.md 0B
README.md 412B
共 25 条
- 1
资源评论
- weixin_430724792022-06-25空的,别下
- sunyuems2023-03-01P人的,无用的东西
柒月是你的謊言
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功