当前位置:网站首页>ESP32 hosted
ESP32 hosted
2022-07-05 22:10:00 【wwwlyj123321】
One 、 Drive migration
Two 、 Application testing
1、 modify test_config.h Configuration parameters in .
The main parameters to be modified are as follows

2、 And then in c_support Run... In folder make command To compile the .
3、 Enter the relevant test command
sudo ./test.out [scan] [sta_connect] [sta_disconnect] [ap_start] [ap_vendor_ie] [sta_list] [ap_stop] [wifi_tx_power] [ota <Esp_binary_path>]
note:
1、 The commands in brackets are optional , You can only enter one or more combinations . See the source code for specific implementation
2、sta_connect after , User needs to run DHCP The client is from the outside AP obtain IP Address .
sudo dhclient ethsta0 -r
sudo dhclient ethsta0 -v| Command line argument | Operation |
|---|---|
| sta_connect | take ESP32 The station is connected to the outside AP, take ESP32 Of MAC The address is assigned to ethsta0 |
| sta_disconnect | To break off ESP32 With the outside AP And down ethsta0 Interface |
| ap_start | start-up ESP32 softAP, take ESP32 softAP Of MAC The address is assigned to ethap0 |
| ap_stop | stop it ESP32 softAP and down ethap0 Interface |
| scan | Scan external access points |
| sta_list | List connections to softAP External sites |
| ap_vendor_ie | Set vendor information element for ESP32 softAP by ESP32 softAP Set supplier information elements |
| wifi_tx_power | Set up WiFi Maximum transmit power and obtain WiFi Current transmit power |
| ota </path/to/ota_image.bin> | Use local OTA Binary execution OTA operation |
3、 ... and 、 Test code sorting
1、 Test the organizational structure of the code :
CC = gcc
CROSS_COMPILE :=
CFLAGS = -C -Wall
DIR_HOST_COMMON = $(PWD)/../../../host_common
DIR_COMMON = $(PWD)/../../../../common/
INCLUDE += -I$(DIR_HOST_COMMON)/include/
INCLUDE += -I$(DIR_COMMON)/protobuf-c/
INCLUDE += -I$(DIR_COMMON)/include/
SRC += $(DIR_COMMON)/protobuf-c/protobuf-c/protobuf-c.c
SRC += $(PWD)/platform_wrapper.c
SRC += $(DIR_COMMON)/esp_hosted_config.pb-c.c
SRC += $(DIR_HOST_COMMON)/transport_pserial.c
SRC += $(DIR_HOST_COMMON)/commands.c test_api.c
PWD := $(shell pwd)
all: test
test:
$(CROSS_COMPILE)$(CC) $(CFLAGS) $(INCLUDE) $(SRC) $(@).c -o $(@).out
stress:
$(CROSS_COMPILE)$(CC) $(CFLAGS) $(INCLUDE) $(SRC) $(@).c -o $(@).out
clean:
rm -f *.out *.o
2、 Call framework
test.c ----> test_api.c -----> command.c
explain :
1、test.c It is mainly based on the commands entered by the user , Call different test logic , Such as int test_station_mode_connect(), The test logic is implemented in test_api.c To realize
2、test_api.c Will call command.c And ESP32 Interact .command.c See the following website for the function description of :
esp-hosted/c_api.md at master · espressif/esp-hosted · GitHub
3、 Code flow
1、 Test whether the data path is normal
const char* transport = "/dev/esps0";
esp_hosted_driver_handle.file_desc = open(transport,O_NONBLOCK|O_RDWR);// Turn on the device
buf = (uint8_t *)esp_hosted_calloc(1, DUMMY_READ_BUF_LEN);
count = read(esp_hosted_driver_handle.file_desc,(buf), (DUMMY_READ_BUF_LEN));// Reading data
.......
esp_hosted_free(buf);// Release buffer
ret = close(esp_hosted_driver_handle.file_desc);// Turn off the device ref:
ESP-Hosted Introduction & Use guide _Marchtwentytwo The blog of -CSDN Blog _esp32 hosted
esp-hosted/c_demo.md at master · espressif/esp-hosted · GitHub
边栏推荐
- 笔记本电脑蓝牙怎么用来连接耳机
- PyGame practical project: write Snake games with 300 lines of code
- Stored procedures and stored functions
- Image editor for their AutoLayout environment
- Performance monitoring of database tuning solutions
- 如何开发引入小程序插件
- MySQL服务莫名宕机的解决方案
- 如何组织一场实战攻防演练
- What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method
- Pl/sql basic syntax
猜你喜欢
![[Yugong series] go teaching course 003-ide installation and basic use in July 2022](/img/9d/7d01bc1daa61f6545f619b6746f8bb.png)
[Yugong series] go teaching course 003-ide installation and basic use in July 2022

Getting started with microservices (resttemplate, Eureka, Nacos, feign, gateway)

Summary of concurrency control

The difference between MVVM and MVC

How can Bluetooth in notebook computer be used to connect headphones

Drawing HSV color wheel with MATLAB

【愚公系列】2022年7月 Go教学课程 003-IDE的安装和基本使用

Serializability of concurrent scheduling

Index optimization of performance tuning methodology

Talking about MySQL index
随机推荐
Official clarification statement of Jihu company
Common interview questions of redis factory
Serializability of concurrent scheduling
U盘的文件无法删除文件怎么办?Win11无法删除U盘文件解决教程
Code bug correction, char is converted to int high-order symbol extension, resulting in changes in positivity and negativity and values. Int num = (int) (unsigned int) a, which will occur in older com
HDU 4391 paint the wall segment tree (water
1.3 years of work experience, double non naked resignation agency face-to-face experience [already employed]
【愚公系列】2022年7月 Go教学课程 004-Go代码注释
从零开始实现lmax-Disruptor队列(四)多线程生产者MultiProducerSequencer原理解析
POJ 3237 tree (tree chain splitting)
When the industrial Internet era is truly mature, we will look at the emergence of a series of new industrial giants
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
Learning of mall permission module
poj 3237 Tree(树链拆分)
Decorator learning 01
Evolution of large website architecture and knowledge system
DataGrid directly edits and saves "design defects"
Poj3414 extensive search
Shell script, awk condition judgment and logic comparison &||
Business learning of mall order module