Pip install esptool выдает ошибку

I recently tried to load MicroPython on ESP8266 board, but failed. To do that I had to install esptool. I successfully installed it but when I wanted to use it, it would not work.

For instance,

esptool.py --help
'not recognized as internal or external command, operable program or batch file'

I found many questions on this topic, but none of the answers helped me. I tried adding everything to the Windows path and it still did not work.

Hasta Tamang's user avatar

Hasta Tamang

2,2051 gold badge18 silver badges17 bronze badges

asked Feb 26, 2019 at 18:42

OskarCvj's user avatar

3

Try installing esptool using pip command on Windows.
Then use only «esptool» instead of «esptool.py»

enter image description here

Dharman's user avatar

Dharman

31.1k25 gold badges86 silver badges137 bronze badges

answered May 23, 2020 at 17:05

brijesh khokhar's user avatar

I was in the same position as the OP.
On Windows 10 I must use this syntax at a CMD prompt launched as an admin:

py -m esptool --help

I’m running Python 3.10.2 and esptool was installed using

py -m pip install --user pip

answered Mar 10, 2022 at 0:41

user373533's user avatar

1

pip3 install esptool (Administration Mode)

Problem :

C:\WINDOWS\system32>esptool —chip esp328266 -p COM3 erase_flash
‘esptool’ is not recognized as an internal or external command,
operable program or batch file.

AFTER DOING THIS

C:\WINDOWS\system32>pip3 install esptool

Collecting esptool
Downloading esptool-3.1.tar.gz (175 kB)

———-Successfull———————-

C:\WINDOWS\system32>esptool.py —chip esp8266 -p COM3 erase_flash
esptool.py v3.1
Serial port COM3
Connecting….
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: e8:db:84:9b:5a:57
Uploading stub
Running stub
Stub running
Chip erase completed successfully in 2.7s
Hard resetting via RTS pin…

answered Aug 17, 2021 at 8:47

Superman_Shield's user avatar

By using «esptool -h» I could check the help option.

answered May 16, 2019 at 17:20

Akshay's user avatar

AkshayAkshay

1,01912 silver badges21 bronze badges

1

Hi @gitAnuj1234 ,

Thanks for reporting this issue. I think this might be a PATH issue with your install.

If you run «pip» as a normal user on Linux (ie pip install esptool rather than sudo pip install esptool then the esptool.py executable is installed to the directory ~/local/.bin directory (ie the hidden .local/bin directory inside your home directory).

In a default Ubuntu install, this directory is normally part of your user’s PATH (there’s a line in .profile which adds it). Maybe the .profile file or the PATH has been modified on your install.

Some workarounds, either of which should which should work:

  • Run esptool.py as ~/.local/bin/esptool.py -p /dev/ttyUSB0 ...
  • Edit the .profile file in your home directory and look for a line like this:
# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"

… and add it if it’s not already there (note you have to log out of your session and back in before changes to .profile take effect).

I recently tried to load MicroPython on ESP8266 board, but failed. To do that I had to install esptool. I successfully installed it but when I wanted to use it, it would not work.

For instance,

esptool.py --help
'not recognized as internal or external command, operable program or batch file'

I found many questions on this topic, but none of the answers helped me. I tried adding everything to the Windows path and it still did not work.

Hasta Tamang's user avatar

Hasta Tamang

2,2051 gold badge18 silver badges17 bronze badges

asked Feb 26, 2019 at 18:42

OskarCvj's user avatar

3

Try installing esptool using pip command on Windows.
Then use only «esptool» instead of «esptool.py»

enter image description here

Dharman's user avatar

Dharman

31.1k25 gold badges86 silver badges137 bronze badges

answered May 23, 2020 at 17:05

brijesh khokhar's user avatar

I was in the same position as the OP.
On Windows 10 I must use this syntax at a CMD prompt launched as an admin:

py -m esptool --help

I’m running Python 3.10.2 and esptool was installed using

py -m pip install --user pip

answered Mar 10, 2022 at 0:41

user373533's user avatar

1

pip3 install esptool (Administration Mode)

Problem :

C:\WINDOWS\system32>esptool —chip esp328266 -p COM3 erase_flash
‘esptool’ is not recognized as an internal or external command,
operable program or batch file.

AFTER DOING THIS

C:\WINDOWS\system32>pip3 install esptool

Collecting esptool
Downloading esptool-3.1.tar.gz (175 kB)

———-Successfull———————-

C:\WINDOWS\system32>esptool.py —chip esp8266 -p COM3 erase_flash
esptool.py v3.1
Serial port COM3
Connecting….
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: e8:db:84:9b:5a:57
Uploading stub
Running stub
Stub running
Chip erase completed successfully in 2.7s
Hard resetting via RTS pin…

answered Aug 17, 2021 at 8:47

Superman_Shield's user avatar

By using «esptool -h» I could check the help option.

answered May 16, 2019 at 17:20

Akshay's user avatar

AkshayAkshay

1,01912 silver badges21 bronze badges

1

User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

(resolved) problem with esptool.py

Hi all —

Since migrating to V4 of the IDF (under Windows), I’ve run into an issue using esptool.py. Whereas I used to be able to run a command like this:

Code: Select all

C:\esp32_projects\wifibutton>esptool.py write_flash 0x9000 nvs_reuse.bin

I now have to do it like this:

Code: Select all

C:\esp32_projects\wifibutton>python C:\esp32_toolchain\python_env\idf4.0_py3.7_env\Lib\site-packages\esptool.py write_flash 0x9000 nvs_reuse.bin

Obviously not convenient. If I attempt to run it the old way, it’s as though the arguments aren’t getting passed through to the script. Did I miss a step in the installation, or is there some workaround I’m not aware of?

Thanks…

Last edited by mzimmers on Thu Dec 12, 2019 10:41 pm, edited 1 time in total.


ESP_Angus

Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: problem with esptool.py

Postby ESP_Angus » Wed Dec 04, 2019 3:01 am

Hi mzimmers,

Are you using the IDF Command Prompt, or MSYS2, or something else?

The V4.0 Windows installer setups a Python virtualenv with a dedicated copy of Python and its own set of installed Python modules. If you run the IDF Command Prompt then you’ll be inside this Python environment.

The fact that there is a file «idf4.0_py3.7_env\Lib\site-packages\esptool.py» suggests that «pip install esptool» has been run while inside the virtualenv. This is not required by ESP-IDF but it’s fine, doesn’t harm anything (ESP-IDF will use the copy of esptool inside IDF_PATH/components/esptool_py/esptool).

If you’re using IDF Command Prompt, then because esptool was installed with pip in the virtualenv then you should be able to run «esptool.py write_flash 0x9000 nvs_reuse.bin» without needing anything else. If it doesn’t work in the virtualenv, try running «pip install esptool» again.

If you’re using a different command prompt, the solution may be different. Running «esptool.py» with the default Python environment (ie a normal Command Prompt) may work depending on how the Windows python installation is configured.


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 04, 2019 3:05 am

Hi Angus — yes, I am running the ESP-IDF Command Prompt. (I was using MYSYS2 when working with V3 of the IDF).

I’ll try re-installing esptool again tomorrow and report back.

Thanks…


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 04, 2019 2:53 pm

No luck.

When I start up the ESP-IDF Command Prompt, here’s what I get:

Code: Select all

Using Python in C:\Users\mzimmers.CYBERDATA\AppData\Local\Programs\Python\Python37\
Python 3.7.3
Using Git in C:\Program Files\Git\bin\
git version 2.21.0.windows.1
Setting IDF_PATH: C:\esp-idf

Adding ESP-IDF tools to PATH...
    C:\esp32_toolchain\tools\xtensa-esp32-elf\esp32-2019r1-8.2.0\xtensa-esp32-elf\bin
    C:\esp32_toolchain\tools\esp32ulp-elf\2.28.51.20170517\esp32ulp-elf-binutils\bin
    C:\esp32_toolchain\tools\cmake\3.13.4\bin
    C:\esp32_toolchain\tools\openocd-esp32\v0.10.0-esp32-20190313\openocd-esp32\bin
    C:\esp32_toolchain\tools\mconf\v4.6.0.0-idf-20190628\
    C:\esp32_toolchain\tools\ninja\1.9.0\
    C:\esp32_toolchain\tools\idf-exe\1.0.1\
    C:\esp32_toolchain\tools\ccache\3.7\
    C:\esp32_toolchain\python_env\idf4.0_py3.7_env\Scripts
    C:\esp-idf\tools

Checking if Python packages are up to date...
Python requirements from C:\esp-idf\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build


C:\esp-idf>

And when I try to run esptool.py, here’s the (start of) output:

Code: Select all

C:\esp32_projects\wifibutton\mfg>esptool.py write_flash 0x9000 nvs_reuse.bin
esptool.py v2.8
usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
               [--before {default_reset,no_reset,no_reset_no_sync}]
               [--after {hard_reset,soft_reset,no_reset}] [--no-stub]

The output is the same whether I execute the command with no parameters, or with nonsense parameters.


plusorc

Posts: 34
Joined: Sat Nov 09, 2019 6:27 am

Re: problem with esptool.py

Postby plusorc » Wed Dec 04, 2019 3:24 pm

@mzimmers
Can you test this ?
Put the full address of the Bin file you’re flashing .. not the IDF environment
I recently has a similar issue and it was esptool needing the full path of the Bin file

@ESP_Angus
With all due respect , I found the IDF Command in windows is very inconvenient
I wish there is a way to add those to the Path and be able to run idf.py from any directory .
I use vscode and can’t find a way to invoke idf.py from vscode , because I have to use the IDF command
If I copy the link of the shortcut , I get «This has to be run from ….»
a message telling that I have to be in the directory to use the idf.py


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 04, 2019 6:41 pm

Hi plusorc — thanks for the suggestion. I’m really more interested, however, in getting the command to work the way that Angus says it should. I probably messed up something with my install; I’m hoping that someone might have an idea exactly where to look.


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Tue Dec 10, 2019 7:57 pm

BTT. Any suggestions? Thanks…


ESP_Angus

Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: problem with esptool.py

Postby ESP_Angus » Wed Dec 11, 2019 3:24 am

Hi mzimmers,

Sorry, I gave you some incorrect information — I thought that «pip install esptool» would install an esptool.py.exe on the PATH, but it’s actually «esptool.exe».

I ran through the install steps on a clean VM again. You should be able to run:

Code: Select all

esptool write_flash 0x9000 nvs_reuse.bin

In the ESP-IDF Tools Command Prompt window, and this should work.

(You could also choose to «pip install esptool» inside your global Python install to run esptool.exe from any command prompt window.)

BTW, even though ESP-IDF build system will print full paths to everything:

Code: Select all

C:\Users\gus\.espressif\python_env\idf4.0_py2.7_env\Scripts\python.exe ..\..\..\components\esptool_py\esptool\esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build\bootloader\bootloader.bin 0x8000 build\partition_table\partition-table.bin 0x10000 build\hello-world.bin

You can strip off the first part and run this, if you’re in the ESP-IDF Command Prompt then python.exe is on the PATH:

Code: Select all

python.exe ..\..\..\components\esptool_py\esptool\esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build\bootloader\bootloader.bin 0x8000 build\partition_table\partition-table.bin 0x10000 build\hello-world.bin

OR

Code: Select all

python.exe %IDF_PATH%\components\esptool_py\esptool\esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build\bootloader\bootloader.bin 0x8000 build\partition_table\partition-table.bin 0x10000 build\hello-world.bin

(These last two work without the «pip install esptool» step required.)


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 11, 2019 3:35 pm

Hi, Angus — thanks, that did help. Now: can anything be done about making this command briefer?

Code: Select all

$ python C:\esp-idf\components\nvs_flash\nvs_partition_generator\nvs_partition_gen.py generate nvs_reuse.csv nvs_reuse.bin <size>


ESP_Angus

Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: problem with esptool.py

Postby ESP_Angus » Wed Dec 11, 2019 11:49 pm

mzimmers wrote: ↑

Wed Dec 11, 2019 3:35 pm


Hi, Angus — thanks, that did help. Now: can anything be done about making this command briefer?

Code: Select all

$ python C:\esp-idf\components\nvs_flash\nvs_partition_generator\nvs_partition_gen.py generate nvs_reuse.csv nvs_reuse.bin <size>

Maybe, but it’s not straghtforward on Windows. On other OSes it’s pretty simple to add C:\esp-idf\components\nvs_flash\nvs_partition_generator\ to your PATH and then you can run nvs_partition_gen.py as a script…

On Windows this depends on what associations are crerated for .py files to launch with on Windows. If you can set them to launch with a Python interpreter that has all of the libraries required (either the python.exe inside the IDF virtualenv, or your global Python if you’ve installed anything that’s needed there) then this will work. But it’s outside the scope of ESP-IDF, sorry.

I’d suggest adding a custom target to your project CMakeLists file to run the generator automatically on each build, instead.


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 45 guests

I recently tried to load MicroPython on ESP8266 board, but failed. To do that I had to install esptool. I successfully installed it but when I wanted to use it, it would not work.

For instance,

esptool.py --help
'not recognized as internal or external command, operable program or batch file'

I found many questions on this topic, but none of the answers helped me. I tried adding everything to the Windows path and it still did not work.

Hasta Tamang's user avatar

Hasta Tamang

2,2051 gold badge17 silver badges17 bronze badges

asked Feb 26, 2019 at 18:42

OskarCvj's user avatar

3

Try installing esptool using pip command on Windows.
Then use only «esptool» instead of «esptool.py»

enter image description here

Dharman's user avatar

Dharman

30.5k22 gold badges84 silver badges133 bronze badges

answered May 23, 2020 at 17:05

brijesh khokhar's user avatar

I was in the same position as the OP.
On Windows 10 I must use this syntax at a CMD prompt launched as an admin:

py -m esptool --help

I’m running Python 3.10.2 and esptool was installed using

py -m pip install --user pip

answered Mar 10, 2022 at 0:41

user373533's user avatar

pip3 install esptool (Administration Mode)

Problem :

C:WINDOWSsystem32>esptool —chip esp328266 -p COM3 erase_flash
‘esptool’ is not recognized as an internal or external command,
operable program or batch file.

AFTER DOING THIS

C:WINDOWSsystem32>pip3 install esptool

Collecting esptool
Downloading esptool-3.1.tar.gz (175 kB)

———-Successfull———————-

C:WINDOWSsystem32>esptool.py —chip esp8266 -p COM3 erase_flash
esptool.py v3.1
Serial port COM3
Connecting….
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: e8:db:84:9b:5a:57
Uploading stub
Running stub
Stub running
Chip erase completed successfully in 2.7s
Hard resetting via RTS pin…

answered Aug 17, 2021 at 8:47

Superman_Shield's user avatar

By using «esptool -h» I could check the help option.

answered May 16, 2019 at 17:20

Akshay's user avatar

AkshayAkshay

1,01912 silver badges21 bronze badges

1

Operating System

Linux

Esptool Version

v4.4

Python Version

Python 3.10.9

Full Esptool Command Line that Was Run

pip install esptool

Esptool Output

Defaulting to user installation because normal site-packages is not writeable
Collecting esptool
Using cached esptool-4.4-py3-none-any.whl
Collecting bitstring<4,>=3.1.6
Using cached bitstring-3.1.9-py3-none-any.whl (38 kB)
Collecting pyserial>=3.0
Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Collecting ecdsa>=0.16.0
Using cached ecdsa-0.18.0-py2.py3-none-any.whl (142 kB)
Collecting reedsolo<=1.5.4,>=1.5.3
Using cached reedsolo-1.5.4.tar.gz (271 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: cryptography>=2.1.4 in /usr/lib/python3.10/site-packages (from esptool) (38.0.4)
Requirement already satisfied: cffi>=1.12 in /usr/lib/python3.10/site-packages (from cryptography>=2.1.4->esptool) (1.15.1)
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3.10/site-packages (from ecdsa>=0.16.0->esptool) (1.16.0)
Requirement already satisfied: pycparser in /usr/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=2.1.4->esptool) (2.21)
Building wheels for collected packages: reedsolo
Building wheel for reedsolo (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [124 lines of output]
Cython is installed, building creedsolo module
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
copying reedsolo.py -> build/lib.linux-x86_64-cpython-310
running build_ext
building 'creedsolo' extension
creating build/temp.linux-x86_64-cpython-310
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.10 -c creedsolo.c -o build/temp.linux-x86_64-cpython-310/creedsolo.o
creedsolo.c: In function ‘__pyx_tp_dealloc_array’:
creedsolo.c:32027:5: error: lvalue required as increment operand
32027 |     ++Py_REFCNT(o);
|     ^~
creedsolo.c:32029:5: error: lvalue required as decrement operand
32029 |     --Py_REFCNT(o);
|     ^~
creedsolo.c: In function ‘__pyx_tp_dealloc_memoryview’:
creedsolo.c:32338:5: error: lvalue required as increment operand
32338 |     ++Py_REFCNT(o);
|     ^~
creedsolo.c:32340:5: error: lvalue required as decrement operand
32340 |     --Py_REFCNT(o);
|     ^~
creedsolo.c: In function ‘__pyx_tp_dealloc__memoryviewslice’:
creedsolo.c:32588:5: error: lvalue required as increment operand
32588 |     ++Py_REFCNT(o);
|     ^~
creedsolo.c:32590:5: error: lvalue required as decrement operand
32590 |     --Py_REFCNT(o);
|     ^~
creedsolo.c: In function ‘__Pyx_InitGlobals’:
creedsolo.c:33787:1: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
33787 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.10/Python.h:130,
from creedsolo.c:16:
/usr/include/python3.10/ceval.h:122:37: note: declared here
122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
|                                     ^~~~~~~~~~~~~~~~~~
creedsolo.c: In function ‘__Pyx_ParseOptionalKeywords’:
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
In file included from /usr/include/python3.10/unicodeobject.h:1046,
from /usr/include/python3.10/Python.h:83:
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c: In function ‘__Pyx_decode_c_string’:
creedsolo.c:37955:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
37955 |         return PyUnicode_FromUnicode(NULL, 0);
|         ^~~~~~
/usr/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
|                                          ^~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for reedsolo
Running setup.py clean for reedsolo
Failed to build reedsolo
Installing collected packages: reedsolo, pyserial, bitstring, ecdsa, esptool
Attempting uninstall: reedsolo
Found existing installation: reedsolo 1.7.0
Uninstalling reedsolo-1.7.0:
Successfully uninstalled reedsolo-1.7.0
Running setup.py install for reedsolo ... error
error: subprocess-exited-with-error
× Running setup.py install for reedsolo did not run successfully.
│ exit code: 1
╰─> [126 lines of output]
Cython is installed, building creedsolo module
running install
/home/killkrt/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
copying reedsolo.py -> build/lib.linux-x86_64-cpython-310
running build_ext
building 'creedsolo' extension
creating build/temp.linux-x86_64-cpython-310
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.10 -c creedsolo.c -o build/temp.linux-x86_64-cpython-310/creedsolo.o
creedsolo.c: In function ‘__pyx_tp_dealloc_array’:
creedsolo.c:32027:5: error: lvalue required as increment operand
32027 |     ++Py_REFCNT(o);
|     ^~
creedsolo.c:32029:5: error: lvalue required as decrement operand
32029 |     --Py_REFCNT(o);
|     ^~
creedsolo.c: In function ‘__pyx_tp_dealloc_memoryview’:
creedsolo.c:32338:5: error: lvalue required as increment operand
32338 |     ++Py_REFCNT(o);
|     ^~
creedsolo.c:32340:5: error: lvalue required as decrement operand
32340 |     --Py_REFCNT(o);
|     ^~
creedsolo.c: In function ‘__pyx_tp_dealloc__memoryviewslice’:
creedsolo.c:32588:5: error: lvalue required as increment operand
32588 |     ++Py_REFCNT(o);
|     ^~
creedsolo.c:32590:5: error: lvalue required as decrement operand
32590 |     --Py_REFCNT(o);
|     ^~
creedsolo.c: In function ‘__Pyx_InitGlobals’:
creedsolo.c:33787:1: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
33787 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.10/Python.h:130,
from creedsolo.c:16:
/usr/include/python3.10/ceval.h:122:37: note: declared here
122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
|                                     ^~~~~~~~~~~~~~~~~~
creedsolo.c: In function ‘__Pyx_ParseOptionalKeywords’:
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
In file included from /usr/include/python3.10/unicodeobject.h:1046,
from /usr/include/python3.10/Python.h:83:
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35153:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35153 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|                     ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:580:45: note: declared here
580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
|                                             ^~~~~~~~~~~~~~~~~~~
creedsolo.c:35169:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
35169 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|                         ^
/usr/include/python3.10/cpython/unicodeobject.h:446:26: note: declared here
446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
creedsolo.c: In function ‘__Pyx_decode_c_string’:
creedsolo.c:37955:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
37955 |         return PyUnicode_FromUnicode(NULL, 0);
|         ^~~~~~
/usr/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
|                                          ^~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of reedsolo
Moving to /home/killkrt/.local/lib/python3.10/site-packages/__pycache__/reedsolo.cpython-310.pyc
from /tmp/pip-uninstall-gi7m6xdu/reedsolo.cpython-310.pyc
Moving to /home/killkrt/.local/lib/python3.10/site-packages/reedsolo-1.7.0.dist-info/
from /home/killkrt/.local/lib/python3.10/site-packages/~eedsolo-1.7.0.dist-info
Moving to /home/killkrt/.local/lib/python3.10/site-packages/reedsolo.py
from /tmp/pip-uninstall-1ypacc6k/reedsolo.py
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> reedsolo
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure

What is the Expected Behaviour?

No error

More Information

This issue is quite similar to #615

I’ve already tried to execute the following commands, but it didn’t solve the issue:
pip install --upgrade reedsolo
pip install --upgrade reedsolo --install-option="--cythonize" --verbose
pip install --only-binary :all: --extra-index-url https://dl.espressif.com/pypi/ reedsolo

GNU C++ version: 12.2.1 20230111
Clang version: 15.0.7

Arch Linux: 6.1.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 18 Jan 2023 19:54:38 +0000 x86_64 GNU/Linux

Other Steps to Reproduce

No response

User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

(resolved) problem with esptool.py

Hi all —

Since migrating to V4 of the IDF (under Windows), I’ve run into an issue using esptool.py. Whereas I used to be able to run a command like this:

Code: Select all

C:esp32_projectswifibutton>esptool.py write_flash 0x9000 nvs_reuse.bin

I now have to do it like this:

Code: Select all

C:esp32_projectswifibutton>python C:esp32_toolchainpython_envidf4.0_py3.7_envLibsite-packagesesptool.py write_flash 0x9000 nvs_reuse.bin

Obviously not convenient. If I attempt to run it the old way, it’s as though the arguments aren’t getting passed through to the script. Did I miss a step in the installation, or is there some workaround I’m not aware of?

Thanks…

Last edited by mzimmers on Thu Dec 12, 2019 10:41 pm, edited 1 time in total.


ESP_Angus

Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: problem with esptool.py

Postby ESP_Angus » Wed Dec 04, 2019 3:01 am

Hi mzimmers,

Are you using the IDF Command Prompt, or MSYS2, or something else?

The V4.0 Windows installer setups a Python virtualenv with a dedicated copy of Python and its own set of installed Python modules. If you run the IDF Command Prompt then you’ll be inside this Python environment.

The fact that there is a file «idf4.0_py3.7_envLibsite-packagesesptool.py» suggests that «pip install esptool» has been run while inside the virtualenv. This is not required by ESP-IDF but it’s fine, doesn’t harm anything (ESP-IDF will use the copy of esptool inside IDF_PATH/components/esptool_py/esptool).

If you’re using IDF Command Prompt, then because esptool was installed with pip in the virtualenv then you should be able to run «esptool.py write_flash 0x9000 nvs_reuse.bin» without needing anything else. If it doesn’t work in the virtualenv, try running «pip install esptool» again.

If you’re using a different command prompt, the solution may be different. Running «esptool.py» with the default Python environment (ie a normal Command Prompt) may work depending on how the Windows python installation is configured.


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 04, 2019 3:05 am

Hi Angus — yes, I am running the ESP-IDF Command Prompt. (I was using MYSYS2 when working with V3 of the IDF).

I’ll try re-installing esptool again tomorrow and report back.

Thanks…


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 04, 2019 2:53 pm

No luck.

When I start up the ESP-IDF Command Prompt, here’s what I get:

Code: Select all

Using Python in C:Usersmzimmers.CYBERDATAAppDataLocalProgramsPythonPython37
Python 3.7.3
Using Git in C:Program FilesGitbin
git version 2.21.0.windows.1
Setting IDF_PATH: C:esp-idf
Adding ESP-IDF tools to PATH...
C:esp32_toolchaintoolsxtensa-esp32-elfesp32-2019r1-8.2.0xtensa-esp32-elfbin
C:esp32_toolchaintoolsesp32ulp-elf2.28.51.20170517esp32ulp-elf-binutilsbin
C:esp32_toolchaintoolscmake3.13.4bin
C:esp32_toolchaintoolsopenocd-esp32v0.10.0-esp32-20190313openocd-esp32bin
C:esp32_toolchaintoolsmconfv4.6.0.0-idf-20190628
C:esp32_toolchaintoolsninja1.9.0
C:esp32_toolchaintoolsidf-exe1.0.1
C:esp32_toolchaintoolsccache3.7
C:esp32_toolchainpython_envidf4.0_py3.7_envScripts
C:esp-idftools
Checking if Python packages are up to date...
Python requirements from C:esp-idfrequirements.txt are satisfied.
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
C:esp-idf>

And when I try to run esptool.py, here’s the (start of) output:

Code: Select all

C:esp32_projectswifibuttonmfg>esptool.py write_flash 0x9000 nvs_reuse.bin
esptool.py v2.8
usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
[--before {default_reset,no_reset,no_reset_no_sync}]
[--after {hard_reset,soft_reset,no_reset}] [--no-stub]

The output is the same whether I execute the command with no parameters, or with nonsense parameters.


plusorc

Posts: 34
Joined: Sat Nov 09, 2019 6:27 am

Re: problem with esptool.py

Postby plusorc » Wed Dec 04, 2019 3:24 pm

@mzimmers
Can you test this ?
Put the full address of the Bin file you’re flashing .. not the IDF environment
I recently has a similar issue and it was esptool needing the full path of the Bin file

@ESP_Angus
With all due respect , I found the IDF Command in windows is very inconvenient
I wish there is a way to add those to the Path and be able to run idf.py from any directory .
I use vscode and can’t find a way to invoke idf.py from vscode , because I have to use the IDF command
If I copy the link of the shortcut , I get «This has to be run from ….»
a message telling that I have to be in the directory to use the idf.py


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 04, 2019 6:41 pm

Hi plusorc — thanks for the suggestion. I’m really more interested, however, in getting the command to work the way that Angus says it should. I probably messed up something with my install; I’m hoping that someone might have an idea exactly where to look.


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Tue Dec 10, 2019 7:57 pm

BTT. Any suggestions? Thanks…


ESP_Angus

Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: problem with esptool.py

Postby ESP_Angus » Wed Dec 11, 2019 3:24 am

Hi mzimmers,

Sorry, I gave you some incorrect information — I thought that «pip install esptool» would install an esptool.py.exe on the PATH, but it’s actually «esptool.exe».

I ran through the install steps on a clean VM again. You should be able to run:

Code: Select all

esptool write_flash 0x9000 nvs_reuse.bin

In the ESP-IDF Tools Command Prompt window, and this should work.

(You could also choose to «pip install esptool» inside your global Python install to run esptool.exe from any command prompt window.)

BTW, even though ESP-IDF build system will print full paths to everything:

Code: Select all

C:Usersgus.espressifpython_envidf4.0_py2.7_envScriptspython.exe ......componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin

You can strip off the first part and run this, if you’re in the ESP-IDF Command Prompt then python.exe is on the PATH:

Code: Select all

python.exe ......componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin

OR

Code: Select all

python.exe %IDF_PATH%componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin

(These last two work without the «pip install esptool» step required.)


User avatar

mzimmers

Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: problem with esptool.py

Postby mzimmers » Wed Dec 11, 2019 3:35 pm

Hi, Angus — thanks, that did help. Now: can anything be done about making this command briefer?

Code: Select all

$ python C:esp-idfcomponentsnvs_flashnvs_partition_generatornvs_partition_gen.py generate nvs_reuse.csv nvs_reuse.bin <size>

ESP_Angus

Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: problem with esptool.py

Postby ESP_Angus » Wed Dec 11, 2019 11:49 pm

mzimmers wrote: ↑

Wed Dec 11, 2019 3:35 pm

Hi, Angus — thanks, that did help. Now: can anything be done about making this command briefer?

Code: Select all

$ python C:esp-idfcomponentsnvs_flashnvs_partition_generatornvs_partition_gen.py generate nvs_reuse.csv nvs_reuse.bin <size>

Maybe, but it’s not straghtforward on Windows. On other OSes it’s pretty simple to add C:esp-idfcomponentsnvs_flashnvs_partition_generator to your PATH and then you can run nvs_partition_gen.py as a script…

On Windows this depends on what associations are crerated for .py files to launch with on Windows. If you can set them to launch with a Python interpreter that has all of the libraries required (either the python.exe inside the IDF virtualenv, or your global Python if you’ve installed anything that’s needed there) then this will work. But it’s outside the scope of ESP-IDF, sorry.

I’d suggest adding a custom target to your project CMakeLists file to run the generator automatically on each build, instead.


Who is online

Users browsing this forum: No registered users and 54 guests

pip3 установить esptool (режим администратора)

Проблема :

C:WINDOWSsystem32>esptool —chip esp328266 -p COM3 erase_flash
«esptool» не распознается как внутренняя или внешняя команда,
работающая программа или командный файл.

ПОСЛЕ ЭТОГО

C:WINDOWSsystem32>pip3 установить esptool

Сбор esptool
Скачиваем esptool-3.1.tar.gz (175 кБ)

———-Успешно———

C:WINDOWSsystem32>esptool.py —chip esp8266 -p COM3 erase_flash
esptool.py v3.1
Последовательный порт COM3
Подключение….
Чип ESP8266EX.
Особенности: Wi-Fi
Кристалл 26МГц
MAC: e8:db:84:9b:5a:57
Загрузка заглушки
Бегущая заглушка
Заглушка работает
Стирание чипа успешно завершено за 2,7 с
Аппаратный сброс через пин RTS…

Welcome to the Raspberry Pi forums.

Maybe you have installed the package to a location that is not on the path for your shell?

Code: Select all

pi@RPi3BplusOffice:~ $ sudo pip3 install esptool
Collecting esptool
Downloading https://www.piwheels.org/simple/esptool/esptool-2.7-py3-none-any.whl (140kB)
100% |████████████████████████████████| 143kB 876kB/s
Requirement already satisfied: pyserial>=3.0 in /usr/lib/python3/dist-packages (from esptool)
Collecting ecdsa (from esptool)
Downloading https://files.pythonhosted.org/packages/23/a8/8aa68e70959e1287da9154e5164bb8bd5dd7025e
41ae54e8d177b8d165c9/ecdsa-0.13.2-py2.py3-none-any.whl (59kB)
100% |████████████████████████████████| 61kB 537kB/s
Collecting pyaes (from esptool)
Downloading https://www.piwheels.org/simple/pyaes/pyaes-1.6.1-py3-none-any.whl
Installing collected packages: ecdsa, pyaes, esptool
Successfully installed ecdsa-0.13.2 esptool-2.7 pyaes-1.6.1
pi@RPi3BplusOffice:~ $ 
pi@RPi3BplusOffice:~ $ which esptool.py
/usr/local/bin/esptool.py
pi@RPi3BplusOffice:~ $ esptool.py --help
usage: esptool [-h] [--chip {auto,esp8266,esp32}] [--port PORT] [--baud BAUD]
[--before {default_reset,no_reset,no_reset_no_sync}]
[--after {hard_reset,soft_reset,no_reset}] [--no-stub]
[--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]]
{load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image
,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,
erase_region,version}
...
esptool.py v2.7 - ESP8266 ROM Bootloader Utility
positional arguments:
{load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chi
p_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,
version}
Run esptool {command} -h for additional help
load_ram            Download an image to RAM and execute
dump_mem            Dump arbitrary memory to disk
read_mem            Read arbitrary memory location
write_mem           Read-modify-write to arbitrary memory location
write_flash         Write a binary blob to flash
run                 Run application code in flash
image_info          Dump headers from an application image
make_image          Create an application image from binary files
elf2image           Create an application image from ELF file
read_mac            Read MAC address from OTP ROM
chip_id             Read Chip ID from OTP ROM
flash_id            Read SPI flash manufacturer and device ID
read_flash_status   Read SPI flash status register
write_flash_status  Write SPI flash status register
read_flash          Read SPI flash content
verify_flash        Verify a binary blob against flash
erase_flash         Perform Chip Erase on SPI flash
erase_region        Erase a region of the flash
version             Print esptool version
optional arguments:
-h, --help            show this help message and exit
--chip {auto,esp8266,esp32}, -c {auto,esp8266,esp32}
Target chip type
--port PORT, -p PORT  Serial port device
--baud BAUD, -b BAUD  Serial port baud rate used when flashing/reading
--before {default_reset,no_reset,no_reset_no_sync}
What to do before connecting to the chip
--after {hard_reset,soft_reset,no_reset}, -a {hard_reset,soft_reset,no_reset}
What to do after esptool.py is finished
--no-stub             Disable launching the flasher stub, only talk to ROM
bootloader. Some features will not be available.
--trace, -t           Enable trace-level output of esptool.py interactions.
--override-vddsdio [{1.8V,1.9V,OFF}]
Override ESP32 VDDSDIO internal voltage regulator (use
with care)
pi@RPi3BplusOffice:~ $

Понравилась статья? Поделить с друзьями:

Интересное по теме:

  • Pip install turtle ошибка
  • Pioneer vsx 527 сброс ошибок
  • Pioneer utility ошибка подключения 23
  • Pip install eel ошибка
  • Pioneer mosfet 50wx4 ошибка 23

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии