espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.31k stars 1.57k forks source link

Outdated get-started document + running on Python3 (GIT8266O-707) #1129

Open adam-ah opened 3 years ago

adam-ah commented 3 years ago

Environment

MacOS, latest version of RTOS SDK Documentation from https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/index.html

Problem Description - get-started documentation

The get-started guide is getting very outdated, does not mention installing the toolchain via install.sh and setting up the environment via export.sh.

Would you accept pull request to update it?

Problem Description - reliance on the abandoned Python 2 environment

Related to the documentation issues above, the RTOS SDK focuses on the now obsolete Python 2 environment.

The shebang code in the tools also inconsistently calls for python, python2, and python3, further highlighting that the SDK both requires Python 2 and Python 3 to be present:

components/partition_table/test_gen_esp32part_host/gen_esp32part_tests.py:#!/usr/bin/env python components/partition_table/gen_esp32part.py:#!/usr/bin/env python components/partition_table/parttool.py:#!/usr/bin/env python components/partition_table/gen_empty_partition.py:#!/usr/bin/env python components/esptool_py/esptool/ecdsa/ellipticcurve.py:#! /usr/bin/env python components/esptool_py/esptool/ecdsa/ecdsa.py:#! /usr/bin/env python components/esptool_py/esptool/ecdsa/numbertheory.py:#! /usr/bin/env python components/esptool_py/esptool/test/test_imagegen.py:#!/usr/bin/env python components/esptool_py/esptool/test/test_esptool.py:#!/usr/bin/env python components/esptool_py/esptool/espsecure.py:#!/usr/bin/env python components/esptool_py/esptool/flasher_stub/compare_stubs.py:#!/usr/bin/env python components/esptool_py/esptool/flasher_stub/wrap_stub.py:#!/usr/bin/env python3 components/esptool_py/esptool/flasher_stub/esptool_test_stub.py:#!/usr/bin/env python components/esptool_py/esptool/esptool.py:#!/usr/bin/env python components/esptool_py/esptool/espefuse.py:#!/usr/bin/env python components/mbedtls/mbedtls/tests/scripts/test_generate_test_code.py:#!/usr/bin/env python3 components/mbedtls/mbedtls/tests/scripts/generate_test_code.py:#!/usr/bin/env python3 components/mbedtls/mbedtls/tests/scripts/check-files.py:#!/usr/bin/env python3 components/mbedtls/mbedtls/scripts/abi_check.py:#!/usr/bin/env python3 components/app_update/otatool.py:#!/usr/bin/env python components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py:#!/usr/bin/env python docs/gen-version-specific-includes.py:#!/usr/bin/env python docs/gen-dxd.py:#!/usr/bin/env python docs/gen-toolchain-links.py:#!/usr/bin/env python examples/provisioning/legacy/softap_prov/softap_prov_test.py:#!/usr/bin/env python examples/protocols/http_server/advanced_tests/scripts/test.py:#!/usr/bin/env python examples/protocols/http_server/simple/http_server_simple_test.py:#!/usr/bin/env python examples/protocols/http_server/simple/scripts/client.py:#!/usr/bin/env python examples/protocols/http_server/persistent_sockets/scripts/adder.py:#!/usr/bin/env python tools/ldgen/test/test_fragments.py:#!/usr/bin/env python tools/ldgen/test/test_generation.py:#!/usr/bin/env python tools/ldgen/ldgen.py:#!/usr/bin/env python tools/gen_esp_err_to_name.py:#!/usr/bin/env python tools/cmake/convert_to_cmake.py:#!/usr/bin/env python tools/idf_monitor.py:#!/usr/bin/env python tools/ci/envsubst.py:#!/usr/bin/env python tools/check_kconfigs.py:#!/usr/bin/env python tools/idf.py:#!/usr/bin/env python3 tools/idf_tools.py:#!/usr/bin/env python3 tools/test_check_kconfigs.py:#!/usr/bin/env python tools/idf_size.py:#!/usr/bin/env python tools/check_python_dependencies.py:#!/usr/bin/env python3 tools/kconfig_new/test/test_confserver.py:#!/usr/bin/env python tools/kconfig_new/confserver.py:#!/usr/bin/env python tools/kconfig_new/confgen.py:#!/usr/bin/env python tools/kconfig_new/gen_kconfig_doc.py:#!/usr/bin/env python tools/windows/eclipse_make.py:#!/usr/bin/env python tools/pack_fw.py:#!/usr/bin/env python2 tools/esp_prov/esp_prov.py:#!/usr/bin/env python

However, it seems simply editing the shebang in the following files are enough to run the stack on Python 3. modified: tools/check_python_dependencies.py modified: tools/idf.py modified: tools/idf_tools.py

NB, Python 2 has been explicitly made abandoned over a year and a half ago, and there is no good reason to force people to hack around to try to run the SDK on Python 2. Python 3 is available on all systems by now and the SDK should be ported to Python to ASAP as well.

st1vms commented 2 years ago

However, it seems simply editing the shebang in the following files are enough to run the stack on Python 3. modified: tools/check_python_dependencies.py modified: tools/idf.py modified: tools/idf_tools.py

I tried this very step, by also installing the library using install.sh and export.sh it fixed the python : Command not found error for my python3 environment. Thanks a lot @adam-ah :1st_place_medal:

mrx23dot commented 5 months ago

On Windows I got this from following the tutorial

D:\DRIVE\Projects\FW_esp8266\src>make menuconfig
D:\Progs\esp8266_rtos_sdk/make/project.mk:60: esp-idf build system only supports GNU Make versions 3.81 or newer. You may see unexpected results with other Makes.
D:\Progs\esp8266_rtos_sdk/make/project.mk:94: *** IDF_PATH variable is not set to a valid directory..  Stop.

D:\DRIVE\Projects\FW_esp8266\src>echo %IDF_PATH%
D:\Progs\esp8266_rtos_sdk