# esp32-c3 wifi tcp server
**Repository Path**: dark-snow/esp32-c3-wifi-tcp-server
## Basic Information
- **Project Name**: esp32-c3 wifi tcp server
- **Description**: wifi的tcp服务器代码
- **Primary Language**: Unknown
- **License**: MulanPSL-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-07-04
- **Last Updated**: 2023-07-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: esp32-c3, WiFi
## README
| Supported Targets | ESP32-C3 |
| ----------------- | -------- |
## main function :
## wifi AP mode & socket tcp server
wifi 为 ap 模式。其中 wifi 的 ssid 和 password 通过更改 MY_WIFI_SSID、MY_WIFI_PASS
wifi 需要更改 ip 时,通过 user_wifi_ap_stop、wifi_init_softap 完成 wifi 的重启已此更改 ip,该过程会踢出目前全部客户端,需要进行重新连接
wifi 开启,随后自动开启 socket server 模式监听客户端的连入信息。
## File structure
```
├──components
│ └── user_component user peripheral drivers
│ ├── include
│ │ ├── user_socket.h
│ │ ├── user_uart.h
│ │ └── user_wifi.h
│ ├── user_socket.c
│ ├── user_uart.c
│ ├── user_wifi.c
│ └── CMakeLists.txt
├── main
│ ├── CMakeLists.txt
│ └── main.c main file -project
├── CMakeLists.txt
└── README.md This is the file you are currently reading
```
## Current known defect
1. 当tcp_slowtmr:no active pcbs在sock关闭期间未能被正确关闭时,会导致下一次进行sock bind操作时无法正确绑定
2. socket 下连接的客户端(client)目前通过数组(client_list)完成存储,并未使用字典完成
## update log
| 版本号 | 功能 | 日期 |
| :----: | :----------------------------------------------------: | :------: |
| v0.1 | 完成了代码的迁移,使用 gitee 进行文件内容的保存 | 23-07-04 |
| v0.2 | 完成了 wifi 的关闭与重启,并在这个过程中进行 ip 的更改 | 23-07-05 |
| v0.3 | 1. 完成了更好的wifi重启,解决了在wifi重启之后,station wifi无法正确获得ip地址的问题
2. 同时解决了wifi在重启之后无法正确调用bind的问题 | 23-07-05 |
| v0.4 | 1. 修正了sock bind操作时无法正确绑定的问题
2. 重写了重启wifi的逻辑,使用信号量完成重启功能 | 23-07-06 |