mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-18 01:35:23 +02:00
Merge branch 'master' into feature/esp32s2beta_update
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
set(COMPONENT_SRCS "main.c"
|
||||
"tests.c")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ". include")
|
||||
|
||||
register_component()
|
||||
idf_component_register(SRCS "main.c"
|
||||
"tests.c"
|
||||
INCLUDE_DIRS "." "include")
|
@@ -21,13 +21,13 @@ File server implementation can be found under `main/file_server.c` which uses SP
|
||||
|
||||
## Usage
|
||||
|
||||
* Configure the project using `make menuconfig` and goto `Example Configuration` ->
|
||||
* Open the project configuration menu (`idf.py menuconfig`) go to `Example Configuration` ->
|
||||
1. WIFI SSID: WIFI network to which your PC is also connected to.
|
||||
2. WIFI Password: WIFI password
|
||||
|
||||
* In order to test the file server demo :
|
||||
1. compile and burn the firmware `make flash`
|
||||
2. run `make monitor` and note down the IP assigned to your ESP module. The default port is 80
|
||||
1. compile and burn the firmware `idf.py -p PORT flash`
|
||||
2. run `idf.py monitor` and note down the IP assigned to your ESP module. The default port is 80
|
||||
3. test the example interactively on a web browser (assuming IP is 192.168.43.130):
|
||||
1. open path `http://192.168.43.130/` or `http://192.168.43.130/index.html` to see an HTML web page with list of files on the server (initially empty)
|
||||
2. use the file upload form on the webpage to select and upload a file to the server
|
||||
|
@@ -1,6 +1,3 @@
|
||||
set(COMPONENT_SRCS "main.c" "file_server.c")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||
|
||||
set(COMPONENT_EMBED_FILES "favicon.ico" "upload_script.html")
|
||||
|
||||
register_component()
|
||||
idf_component_register(SRCS "main.c" "file_server.c"
|
||||
INCLUDE_DIRS "."
|
||||
EMBED_FILES "favicon.ico" "upload_script.html")
|
@@ -1,5 +1,5 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
|
||||
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
phy_init, data, phy, 0xf000, 0x1000,
|
||||
factory, app, factory, 0x10000, 1M,
|
||||
|
|
@@ -1,6 +1,4 @@
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
|
||||
CONFIG_APP_OFFSET=0x10000
|
||||
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
|
||||
|
@@ -3,11 +3,11 @@
|
||||
The Example consists of HTTPD server persistent sockets demo.
|
||||
This sort of persistency enables the server to have independent sessions/contexts per client.
|
||||
|
||||
* Run `make menuconfig` (or `idf.py menuconfig` if using CMake build system) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.
|
||||
* Open the project configuration menu (`idf.py menuconfig`) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.
|
||||
|
||||
* In order to test the HTTPD server persistent sockets demo :
|
||||
1. compile and burn the firmware "make flash"
|
||||
2. run "make monitor" and note down the IP assigned to your ESP module. The default port is 80
|
||||
1. compile and burn the firmware `idf.py -p PORT flash`
|
||||
2. run `idf.py -p PORT monitor` and note down the IP assigned to your ESP module. The default port is 80
|
||||
3. run the test script "python2 scripts/adder.py \<IP\> \<port\> \<N\>"
|
||||
* the provided test script sends (POST) numbers from 1 to N to the server which has a URI POST handler for adding these numbers into an accumulator that is valid throughout the lifetime of the connection socket, hence persistent
|
||||
* the script does a GET before closing and displays the final value of the accumulator
|
||||
|
@@ -1,4 +1,2 @@
|
||||
set(COMPONENT_SRCS "main.c")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||
|
||||
register_component()
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS ".")
|
@@ -57,7 +57,7 @@ Only if you deploy the website to SD card, then the following pin connection is
|
||||
|
||||
### Configure the project
|
||||
|
||||
Enter `make menuconfig` if you are using GNU Make based build system or enter `idf.py menuconfig` if you are using CMake based build system.
|
||||
Open the project configuration menu (`idf.py menuconfig`).
|
||||
|
||||
In the `Example Connection Configuration` menu:
|
||||
|
||||
@@ -88,7 +88,7 @@ npm run build
|
||||
|
||||
After a while, you will see a `dist` directory which contains all the website files (e.g. html, js, css, images).
|
||||
|
||||
Enter `make -j4 flash monitor` if you are using GNU Make based build system or enter `idf.py build flash monitor` if you are using CMake based build system.
|
||||
Run `idf.py -p PORT flash monitor` to build and flash the project..
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
set(COMPONENT_SRCS "esp_rest_main.c" "rest_server.c")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||
|
||||
register_component()
|
||||
idf_component_register(SRCS "esp_rest_main.c"
|
||||
"rest_server.c"
|
||||
INCLUDE_DIRS ".")
|
||||
|
||||
if(CONFIG_EXAMPLE_WEB_DEPLOY_SF)
|
||||
set(WEB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../front/web-demo")
|
||||
|
@@ -172,7 +172,7 @@ esp_err_t start_rest_server(const char *base_path)
|
||||
REST_CHECK(base_path, "wrong base path", err);
|
||||
rest_server_context_t *rest_context = calloc(1, sizeof(rest_server_context_t));
|
||||
REST_CHECK(rest_context, "No memory for rest context", err);
|
||||
strncpy(rest_context->base_path, base_path, ESP_VFS_PATH_MAX);
|
||||
strlcpy(rest_context->base_path, base_path, sizeof(rest_context->base_path));
|
||||
|
||||
httpd_handle_t server = NULL;
|
||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
|
||||
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
|
||||
nvs, data, nvs, 0x9000, 0x6000,
|
||||
phy_init, data, phy, 0xf000, 0x1000,
|
||||
factory, app, factory, 0x10000, 1M,
|
||||
|
|
@@ -5,5 +5,4 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
|
||||
|
@@ -4,11 +4,11 @@ The Example consists of HTTPD server demo with demostration of URI handling :
|
||||
1. URI \hello for GET command returns "Hello World!" message
|
||||
2. URI \echo for POST command echoes back the POSTed message
|
||||
|
||||
* Run `make menuconfig` (or `idf.py menuconfig` if using CMake build system) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.
|
||||
* Open the project configuration menu (`idf.py menuconfig`) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.
|
||||
|
||||
* In order to test the HTTPD server persistent sockets demo :
|
||||
1. compile and burn the firmware "make flash"
|
||||
2. run "make monitor" and note down the IP assigned to your ESP module. The default port is 80
|
||||
1. compile and burn the firmware `idf.py -p PORT flash`
|
||||
2. run `idf.py -p PORT monitor` and note down the IP assigned to your ESP module. The default port is 80
|
||||
3. test the example :
|
||||
* run the test script : "python2 scripts/client.py \<IP\> \<port\> \<MSG\>"
|
||||
* the provided test script first does a GET \hello and displays the response
|
||||
|
@@ -1,4 +1,2 @@
|
||||
set(COMPONENT_SRCS "main.c")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
||||
|
||||
register_component()
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS ".")
|
Reference in New Issue
Block a user