From cc267ab0df7923a9e63a1992ad9c0797b58489d5 Mon Sep 17 00:00:00 2001 From: dongheng Date: Fri, 26 Jul 2019 11:24:03 +0800 Subject: [PATCH] feat(hello_world): add example hello_world from esp-idf and modify it for ESP8266 Commit ID: b0456cc9 --- README.md | 6 +- docs/en/api-guides/build-system.rst | 2 +- docs/en/api-guides/fota-from-old-new.rst | 2 +- docs/en/get-started/index.rst | 14 ++--- examples/README.md | 33 +++++++++++ .../get-started/hello_world/CMakeLists.txt | 6 ++ .../Makefile | 2 +- examples/get-started/hello_world/README.md | 5 ++ .../hello_world/main/CMakeLists.txt | 2 + .../main/component.mk | 0 .../hello_world/main/hello_world_main.c | 38 +++++++++++++ .../project_template/CMakeLists.txt | 6 -- .../components/CMakeLists.txt | 3 - .../project_template/components/component.mk | 1 - .../components/folder1/file1.c | 0 .../components/folder2/file2.c | 0 .../project_template/main/CMakeLists.txt | 3 - .../project_template/main/user_main.c | 22 -------- .../get-started/project_template/readme.txt | 56 ------------------- .../1MB_flash/new_to_new_no_old/README.md | 2 +- .../new_to_new_no_old/main/Kconfig.projbuild | 2 +- .../new_to_new_no_old_copy/README.md | 2 +- .../main/Kconfig.projbuild | 2 +- .../1MB_flash/new_to_new_with_old/README.md | 2 +- .../main/Kconfig.projbuild | 2 +- .../2+MB_flash/new_to_new_no_old/README.md | 2 +- .../new_to_new_no_old/main/Kconfig.projbuild | 2 +- .../2+MB_flash/new_to_new_with_old/README.md | 2 +- .../main/Kconfig.projbuild | 2 +- .../system/ota/simple_ota_example/README.md | 12 ++-- 30 files changed, 113 insertions(+), 120 deletions(-) create mode 100644 examples/README.md create mode 100644 examples/get-started/hello_world/CMakeLists.txt rename examples/get-started/{project_template => hello_world}/Makefile (82%) create mode 100644 examples/get-started/hello_world/README.md create mode 100644 examples/get-started/hello_world/main/CMakeLists.txt rename examples/get-started/{project_template => hello_world}/main/component.mk (100%) create mode 100644 examples/get-started/hello_world/main/hello_world_main.c delete mode 100644 examples/get-started/project_template/CMakeLists.txt delete mode 100644 examples/get-started/project_template/components/CMakeLists.txt delete mode 100644 examples/get-started/project_template/components/component.mk delete mode 100644 examples/get-started/project_template/components/folder1/file1.c delete mode 100644 examples/get-started/project_template/components/folder2/file2.c delete mode 100644 examples/get-started/project_template/main/CMakeLists.txt delete mode 100644 examples/get-started/project_template/main/user_main.c delete mode 100644 examples/get-started/project_template/readme.txt diff --git a/README.md b/README.md index 1ee5900e..7283f500 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ export IDF_PATH=~/esp/ESP8266_RTOS_SDK ``` ## Start a Project -Now you are ready to prepare your application for ESP8266. To start off quickly, we can use `examples/get-started/project_template` project from `examples` directory in SDK. +Now you are ready to prepare your application for ESP8266. To start off quickly, we can use `examples/get-started/hello_world` project from `examples` directory in SDK. Once you've found the project you want to work with, change to its directory and you can configure and build it. @@ -81,10 +81,10 @@ You are almost there. To be able to proceed further, connect ESP8266 board to PC ## Configuring the Project -Being in terminal window, go to directory of `project_template` application by typing `cd ~/esp/ESP8266_RTOS_SDK/examples/get-started/project_template`. Then start project configuration utility `menuconfig`: +Being in terminal window, go to directory of `hello_world` application by typing `cd ~/esp/ESP8266_RTOS_SDK/examples/get-started/hello_world`. Then start project configuration utility `menuconfig`: ``` -cd ~/esp/ESP8266_RTOS_SDK/examples/get-started/project_template +cd ~/esp/ESP8266_RTOS_SDK/examples/get-started/hello_world make menuconfig ``` diff --git a/docs/en/api-guides/build-system.rst b/docs/en/api-guides/build-system.rst index b897bbc6..d11815d8 100644 --- a/docs/en/api-guides/build-system.rst +++ b/docs/en/api-guides/build-system.rst @@ -7,7 +7,7 @@ concept of "components" Read this document if you want to know how to organise a new ESP8266\_RTOS\ -SDK (ESP-IDF Style) project. -We recommend using the project_template project at directory of examples/get-started as a starting point for your project. +We recommend using the hello_world project at directory of examples/get-started as a starting point for your project. Using the Build System ====================== diff --git a/docs/en/api-guides/fota-from-old-new.rst b/docs/en/api-guides/fota-from-old-new.rst index 312d5f58..ee351bf6 100644 --- a/docs/en/api-guides/fota-from-old-new.rst +++ b/docs/en/api-guides/fota-from-old-new.rst @@ -111,7 +111,7 @@ Configure the flash size according to your actual development board's flash. (mypassword) WiFi Password (192.168.0.3) HTTP Server IP (8070)HTTP Server Port - (/project_template.ota.bin) HTTP GET Filename + (/hello_world.ota.bin) HTTP GET Filename - WiFi SSID: Wi-Fi SSID of router - WiFi Password: Wi-Fi password of router diff --git a/docs/en/get-started/index.rst b/docs/en/get-started/index.rst index 2917dfb5..48e6bb74 100644 --- a/docs/en/get-started/index.rst +++ b/docs/en/get-started/index.rst @@ -144,12 +144,12 @@ Python packages required by ESP8266\_RTOS\_SDK are located in the ``$IDF_PATH/re Start a Project =============== -Now you are ready to prepare your application for ESP8266. To start off quickly, we will use :example:`get-started/project_template` project from :idf:`examples` directory in IDF. +Now you are ready to prepare your application for ESP8266. To start off quickly, we will use :example:`get-started/hello_world` project from :idf:`examples` directory in IDF. -Copy :example:`get-started/project_template` to ``~/esp`` directory:: +Copy :example:`get-started/hello_world` to ``~/esp`` directory:: cd ~/esp - cp -r $IDF_PATH/examples/get-started/project_template . + cp -r $IDF_PATH/examples/get-started/hello_world . You can also find a range of example projects under the :idf:`examples` directory in ESP-IDF. These example project directories can be copied in the same way as presented above, to begin your own projects. @@ -171,9 +171,9 @@ You are almost there. To be able to proceed further, connect ESP8266 board to PC Configure ========= -Being in terminal window, go to directory of ``project_template`` application by typing ``cd ~/esp/project_template``. Then start project configuration utility ``menuconfig``:: +Being in terminal window, go to directory of ``hello_world`` application by typing ``cd ~/esp/hello_world``. Then start project configuration utility ``menuconfig``:: - cd ~/esp/project_template + cd ~/esp/hello_world make menuconfig If previous steps have been done correctly, the following menu will be displayed: @@ -245,7 +245,7 @@ This will compile the application and all the ESP8266\_RTOS\_SDK components, gen Leaving... Hard resetting via RTS pin... -If there are no issues, at the end of build process, you should see messages describing progress of loading process. Finally, the end module will be reset and "project_template" application will start. +If there are no issues, at the end of build process, you should see messages describing progress of loading process. Finally, the end module will be reset and "hello_world" application will start. If you'd like to use the Eclipse IDE instead of running ``make``, check out the :doc:`Eclipse guide `. @@ -255,7 +255,7 @@ If you'd like to use the Eclipse IDE instead of running ``make``, check out the Monitor ======= -To see if "project_template" application is indeed running, type ``make monitor``. +To see if "hello_world" application is indeed running, type ``make monitor``. $ make monitor MONITOR diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 00000000..e117bfd1 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,33 @@ +# Examples + +This directory contains a range of example ESP8266_RTOS_SDK projects. These are intended to demonstrate parts of ESP8266_RTOS_SDK functionality, and to provide code that you can copy and adapt into your own projects. + +# Example Layout + +The examples are grouped into subdirectories by category. Each category directory contains one or more example projects: + +* `get-started` contains some very simple examples with minimal functionality. +* `peripherals` contains examples showing driver functionality for the various onboard ESP8266 peripherals. +* `protocols` contains examples showing network protocol interactions. +* `provisioning` contains examples showing how to configurate target AP information to ESP8266. +* `storage` contains examples showing data storage methods using SPI flash. +* `system` contains examples which demonstrate some debugging, factory-test and OTA. +* `wifi` contains examples of advanced Wi-Fi features. (For network protocol examples, see `protocols` instead.) + +# Using Examples + +Building an example is the same as building any other project: + +* Follow the Getting Started instructions which include building the "Hello World" example. +* Change into the directory of the new example you'd like to build. +* Run `make menuconfig` to open the project configuration menu. Most examples have a project-specific "Example Configuration" section here (for example, to set the WiFi SSID & password to use). +* `make` to build the example. +* Follow the printed instructions to flash, or run `make flash`. + +# Copying Examples + +Each example is a standalone project. The examples *do not have to be inside the SDK directory*. You can copy an example directory to anywhere on your computer in order to make a copy that you can modify and work with. + +The `IDF_PATH` environment variable is the only thing that connects the example to the rest of ESP8266_RTOS_SDK. + +If you're looking for a more bare-bones project to start from, try [esp-idf-template](https://github.com/espressif/esp-idf-template). diff --git a/examples/get-started/hello_world/CMakeLists.txt b/examples/get-started/hello_world/CMakeLists.txt new file mode 100644 index 00000000..519e5a1d --- /dev/null +++ b/examples/get-started/hello_world/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(hello-world) \ No newline at end of file diff --git a/examples/get-started/project_template/Makefile b/examples/get-started/hello_world/Makefile similarity index 82% rename from examples/get-started/project_template/Makefile rename to examples/get-started/hello_world/Makefile index cdc8da0e..0d1f5e68 100644 --- a/examples/get-started/project_template/Makefile +++ b/examples/get-started/hello_world/Makefile @@ -3,7 +3,7 @@ # project subdirectory. # -PROJECT_NAME := project_template +PROJECT_NAME := hello-world include $(IDF_PATH)/make/project.mk diff --git a/examples/get-started/hello_world/README.md b/examples/get-started/hello_world/README.md new file mode 100644 index 00000000..4fb3c40c --- /dev/null +++ b/examples/get-started/hello_world/README.md @@ -0,0 +1,5 @@ +# Hello World Example + +Starts a FreeRTOS task to print "Hello World" + +See the README.md file in the upper level 'examples' directory for more information about examples. diff --git a/examples/get-started/hello_world/main/CMakeLists.txt b/examples/get-started/hello_world/main/CMakeLists.txt new file mode 100644 index 00000000..c299e037 --- /dev/null +++ b/examples/get-started/hello_world/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "hello_world_main.c" + INCLUDE_DIRS "") \ No newline at end of file diff --git a/examples/get-started/project_template/main/component.mk b/examples/get-started/hello_world/main/component.mk similarity index 100% rename from examples/get-started/project_template/main/component.mk rename to examples/get-started/hello_world/main/component.mk diff --git a/examples/get-started/hello_world/main/hello_world_main.c b/examples/get-started/hello_world/main/hello_world_main.c new file mode 100644 index 00000000..61bd0a6e --- /dev/null +++ b/examples/get-started/hello_world/main/hello_world_main.c @@ -0,0 +1,38 @@ +/* Hello World Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_system.h" +#include "esp_spi_flash.h" + + +void app_main() +{ + printf("Hello world!\n"); + + /* Print chip information */ + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + printf("This is ESP8266 chip with %d CPU cores, WiFi, ", + chip_info.cores); + + printf("silicon revision %d, ", chip_info.revision); + + printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), + (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); + + for (int i = 10; i >= 0; i--) { + printf("Restarting in %d seconds...\n", i); + vTaskDelay(1000 / portTICK_PERIOD_MS); + } + printf("Restarting now.\n"); + fflush(stdout); + esp_restart(); +} diff --git a/examples/get-started/project_template/CMakeLists.txt b/examples/get-started/project_template/CMakeLists.txt deleted file mode 100644 index cd360d1a..00000000 --- a/examples/get-started/project_template/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists -# in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.5) - -include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(project_template) diff --git a/examples/get-started/project_template/components/CMakeLists.txt b/examples/get-started/project_template/components/CMakeLists.txt deleted file mode 100644 index 67473b67..00000000 --- a/examples/get-started/project_template/components/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -set(COMPONENT_SRCDIRS "folder1" "folder2") - -register_component() diff --git a/examples/get-started/project_template/components/component.mk b/examples/get-started/project_template/components/component.mk deleted file mode 100644 index 31b90bf4..00000000 --- a/examples/get-started/project_template/components/component.mk +++ /dev/null @@ -1 +0,0 @@ -COMPONENT_SRCDIRS := folder1 folder2 diff --git a/examples/get-started/project_template/components/folder1/file1.c b/examples/get-started/project_template/components/folder1/file1.c deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/get-started/project_template/components/folder2/file2.c b/examples/get-started/project_template/components/folder2/file2.c deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/get-started/project_template/main/CMakeLists.txt b/examples/get-started/project_template/main/CMakeLists.txt deleted file mode 100644 index 31addfc4..00000000 --- a/examples/get-started/project_template/main/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -set(COMPONENT_SRCS "user_main.c") - -register_component() diff --git a/examples/get-started/project_template/main/user_main.c b/examples/get-started/project_template/main/user_main.c deleted file mode 100644 index 789e496f..00000000 --- a/examples/get-started/project_template/main/user_main.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include - -#include "esp_system.h" - -/****************************************************************************** - * FunctionName : app_main - * Description : entry of user application, init user function here - * Parameters : none - * Returns : none -*******************************************************************************/ -void app_main(void) -{ - printf("SDK version:%s\n", esp_get_idf_version()); -} diff --git a/examples/get-started/project_template/readme.txt b/examples/get-started/project_template/readme.txt deleted file mode 100644 index 288a84cf..00000000 --- a/examples/get-started/project_template/readme.txt +++ /dev/null @@ -1,56 +0,0 @@ -This is a simple project template. - -sample_lib is an example for multi-level folder Makefile, notice the folder structure and each Makefile, you can get the clue. - - -HOWTO: -1. Copy this folder to anywhere. -Example: - Copy to ~/workspace/project_template - You can rename this folder as you like. - -2. Export SDK_PATH and BIN_PATH. -Example: - Your SDK path is ~/esp_iot_rtos_sdk, and want generate bin at ~/esp8266_bin. - Do follow steps: - 1>. export SDK_PATH=~/esp_iot_rtos_sdk - 2>. export BIN_PATH=~/esp8266_bin - SDK and project are seperate, you can update SDK without change your project. - -3. Enter project_template folder, run ./gen_misc.sh, and follow the tips and steps. - - -Compile Options: -(1) COMPILE - Possible value: xcc - Default value: - If not set, use gcc by default. - -(2) BOOT - Possible value: none/old/new - none: no need boot - old: use boot_v1.1 - new: use boot_v1.2 - Default value: new - -(3) APP - Possible value: 0/1/2 - 0: original mode, generate eagle.app.v6.flash.bin and eagle.app.v6.irom0text.bin - 1: generate user1 - 2: generate user2 - Default value: 0 - -(3) SPI_SPEED - Possible value: 20/26.7/40/80 - Default value: 40 - -(4) SPI_MODE - Possible value: QIO/QOUT/DIO/DOUT - Default value: QIO - -(4) SPI_SIZE_MAP - Possible value: 0/2/3/4/5/6 - Default value: 0 - -For example: - make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0 diff --git a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/README.md b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/README.md index 6f22d39e..f025d28e 100644 --- a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/README.md +++ b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/README.md @@ -136,7 +136,7 @@ When the example starts up, it will print "ota: Starting OTA example..." then: * Check whether your PC can ping the ESP8266 at its IP, and make sure that the IP, AP and other configuration settings are correct in menuconfig. * Check if there is any firewall software on the PC that prevents incoming connections. -* Check whether you can see the configured file (default project_template.ota.bin) when browsing the file listing at http://127.0.0.1/ +* Check whether you can see the configured file (default hello_world.ota.bin) when browsing the file listing at http://127.0.0.1/ * If you have another PC or a phone, try viewing the file listing from the separate host. ## Error "ota_begin error err=0x104" diff --git a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/main/Kconfig.projbuild b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/main/Kconfig.projbuild index 20b385a2..74a06d93 100644 --- a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old/main/Kconfig.projbuild @@ -32,7 +32,7 @@ config SERVER_PORT config EXAMPLE_FILENAME string "HTTP GET Filename" - default "/project_template.bin" + default "/hello_world.bin" help Filename of the app image file to download for the OTA update. diff --git a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/README.md b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/README.md index b1374791..fe3f9d3e 100644 --- a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/README.md +++ b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/README.md @@ -146,7 +146,7 @@ When the example starts up, it will print "ota: Starting OTA example..." then: * Check whether your PC can ping the ESP8266 at its IP, and make sure that the IP, AP and other configuration settings are correct in menuconfig. * Check if there is any firewall software on the PC that prevents incoming connections. -* Check whether you can see the configured file (default project_template.ota.bin) when browsing the file listing at http://127.0.0.1/ +* Check whether you can see the configured file (default hello_world.ota.bin) when browsing the file listing at http://127.0.0.1/ * If you have another PC or a phone, try viewing the file listing from the separate host. ## Error "ota_begin error err=0x104" diff --git a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/main/Kconfig.projbuild b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/main/Kconfig.projbuild index 20b385a2..74a06d93 100644 --- a/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota/1MB_flash/new_to_new_no_old_copy/main/Kconfig.projbuild @@ -32,7 +32,7 @@ config SERVER_PORT config EXAMPLE_FILENAME string "HTTP GET Filename" - default "/project_template.bin" + default "/hello_world.bin" help Filename of the app image file to download for the OTA update. diff --git a/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/README.md b/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/README.md index e14e4324..a1b74e13 100644 --- a/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/README.md +++ b/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/README.md @@ -159,7 +159,7 @@ When the example starts up, it will print "ota: Starting OTA example..." then: * Check whether your PC can ping the ESP8266 at its IP, and make sure that the IP, AP and other configuration settings are correct in menuconfig. * Check if there is any firewall software on the PC that prevents incoming connections. -* Check whether you can see the configured file (default project_template.ota.bin) when browsing the file listing at http://127.0.0.1/ +* Check whether you can see the configured file (default hello_world.ota.bin) when browsing the file listing at http://127.0.0.1/ * If you have another PC or a phone, try viewing the file listing from the separate host. ## Error "ota_begin error err=0x104" diff --git a/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/main/Kconfig.projbuild b/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/main/Kconfig.projbuild index 5ac58b65..b24c7756 100644 --- a/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota/1MB_flash/new_to_new_with_old/main/Kconfig.projbuild @@ -40,7 +40,7 @@ config SERVER_PORT config EXAMPLE_FILENAME string "HTTP GET Filename" - default "/project_template.ota.bin" + default "/hello_world.ota.bin" help Filename of the app image file to download for the OTA update. diff --git a/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/README.md b/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/README.md index 03cf3afd..1e614bc1 100644 --- a/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/README.md +++ b/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/README.md @@ -127,7 +127,7 @@ When the example starts up, it will print "ota: Starting OTA example..." then: * Check whether your PC can ping the ESP8266 at its IP, and make sure that the IP, AP and other configuration settings are correct in menuconfig. * Check if there is any firewall software on the PC that prevents incoming connections. -* Check whether you can see the configured file (default project_template.ota.bin) when browsing the file listing at http://127.0.0.1/ +* Check whether you can see the configured file (default hello_world.ota.bin) when browsing the file listing at http://127.0.0.1/ * If you have another PC or a phone, try viewing the file listing from the separate host. ## Error "ota_begin error err=0x104" diff --git a/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/main/Kconfig.projbuild b/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/main/Kconfig.projbuild index 20b385a2..74a06d93 100644 --- a/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota/2+MB_flash/new_to_new_no_old/main/Kconfig.projbuild @@ -32,7 +32,7 @@ config SERVER_PORT config EXAMPLE_FILENAME string "HTTP GET Filename" - default "/project_template.bin" + default "/hello_world.bin" help Filename of the app image file to download for the OTA update. diff --git a/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/README.md b/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/README.md index b921e9ac..7c63f82c 100644 --- a/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/README.md +++ b/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/README.md @@ -151,7 +151,7 @@ When the example starts up, it will print "ota: Starting OTA example..." then: * Check whether your PC can ping the ESP8266 at its IP, and make sure that the IP, AP and other configuration settings are correct in menuconfig. * Check if there is any firewall software on the PC that prevents incoming connections. -* Check whether you can see the configured file (default project_template.ota.bin) when browsing the file listing at http://127.0.0.1/ +* Check whether you can see the configured file (default hello_world.ota.bin) when browsing the file listing at http://127.0.0.1/ * If you have another PC or a phone, try viewing the file listing from the separate host. ## Error "ota_begin error err=0x104" diff --git a/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/main/Kconfig.projbuild b/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/main/Kconfig.projbuild index 5ac58b65..b24c7756 100644 --- a/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota/2+MB_flash/new_to_new_with_old/main/Kconfig.projbuild @@ -40,7 +40,7 @@ config SERVER_PORT config EXAMPLE_FILENAME string "HTTP GET Filename" - default "/project_template.ota.bin" + default "/hello_world.ota.bin" help Filename of the app image file to download for the OTA update. diff --git a/examples/system/ota/simple_ota_example/README.md b/examples/system/ota/simple_ota_example/README.md index 27a1d625..c73dd2d2 100644 --- a/examples/system/ota/simple_ota_example/README.md +++ b/examples/system/ota/simple_ota_example/README.md @@ -31,17 +31,17 @@ The OTA_workflow.png diagram demonstrates the overall workflow: Connect your host PC to the same AP that you will use for the ESP8266. ### Step 2: Generate the OTA Binary -For our upgrade example OTA file, we're going to use the `get-started/project_template` example. +For our upgrade example OTA file, we're going to use the `get-started/hello_world` example. Build the example: ``` -cd $IDF_PATH/examples/get-started/project_template +cd $IDF_PATH/examples/get-started/hello_world make cd build ``` -Note: You've probably noticed there is nothing special about the "project_template" example when used for OTA updates. This is because any .bin app file which is built by ESP8266_RTOS_SDK can be used as an app image for OTA. The only difference is whether it is written to a factory partition or an OTA partition. +Note: You've probably noticed there is nothing special about the "hello_world" example when used for OTA updates. This is because any .bin app file which is built by ESP8266_RTOS_SDK can be used as an app image for OTA. The only difference is whether it is written to a factory partition or an OTA partition. ### Step 3: Run HTTPS Server @@ -69,7 +69,7 @@ Start the HTTPS server: openssl s_server -WWW -key ca_key.pem -cert ca_cert.pem -port 8070 ``` -Copy the generated binary(project_template.bin) into the folder in which the HTTPS server is running. +Copy the generated binary(hello_world.bin) into the folder in which the HTTPS server is running. If you have any firewall software running that will block incoming access to port 8070, configure it to allow access while running the example. ### Step 4: Build OTA Example @@ -83,7 +83,7 @@ Change back to the OTA example directory, and type `make menuconfig` to configur https://:/ for e.g, -https://192.168.0.3:8070/project_template.bin +https://192.168.0.3:8070/hello_world.bin ``` Save your changes, and type `make` to build the example. @@ -112,7 +112,7 @@ When the example starts up, it will print "Starting OTA example..." then: * Check your PC can ping the ESP8266 at its IP, and that the IP, AP and other configuration settings are correct in menuconfig. * Check if any firewall software is preventing incoming connections on the PC. -* Check whether you can see the configured file (default project_template.bin), by checking the output of following command: +* Check whether you can see the configured file (default hello_world.bin), by checking the output of following command: ``` curl -v https://:/