ESP32Partitions icon indicating copy to clipboard operation
ESP32Partitions copied to clipboard

Nothing happens when I click Tools-ESP32 Partition Manager / setup.sh fails with error message

Open beegee-tokyo opened this issue 6 years ago • 21 comments

IDE: Arduino IDE 1.8.5 Unusual installation path: C:\Program Files (x86)\Arduino Sketchbook location: B:\Arduino-Dev ESP32 installation path: B:\Arduino-Dev\hardware\espressif\esp32 OS: Windows 7 Home Premium Service Pack 1 64-bit

First tried download ZIP file:

  • download ESP32Partitions.zip into C:\Program Files (x86)\Arduino\tools
  • extract content into tools directory

after that tools directory looks like

C:\Program Files (x86)\Arduin\tools\EPS32Partitions\
                                                    tool\
                                                         ESP32Partitions.jar
                                                         esp-partition.py

Tools-ESP32 Partition Manager is shown in the Arduino IDE menu, but when I click on it nothing happens.

Next I tried installation with setup.sh

  • download setup.sh into tools directory
  • remove existing ESP32Partitions directory (from first installation trial)
  • run setup.sh by double click - tried as well to run setup.sh from admin shell

error message

$ ./setup.sh

Self Extracting ESP32 Partition Manager Installer

Extracting...

install.vbs
tool/
tool/esp-partition.py
tool/ESP32Partitions.jar

Installing...
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Users\BeeGee\AppData\Local\Temp\self_extract.3bY8EJ\install.vbs(17, 2) Microsoft VBScript runtime error: Path not found

./setup.sh: line 37: cd: too many arguments
Press any Key to Continue...

Nothing is installed. Could it be because of my "non-standard" installation path of the Arduino IDE?

beegee-tokyo avatar Mar 18 '18 09:03 beegee-tokyo

@beegee-tokyo Download https://github.com/francis94c/ESP32Partitions.git and extract to ...~\Documents\Arduino\tools

You may create the "tools" folder if it does not exist then extract within it

fedy0 avatar Jun 30 '18 18:06 fedy0

I have exactly the same issue. Both files are in the tools directory as described above. Menu shows up in Arduino IDE, but pop-up does not appear.

SensorsIot avatar Sep 08 '18 22:09 SensorsIot

Hi, I have to join the little crowd of affected people as well.

Using Arduino IDE 1.8.6 on Ubuntu 18.04, and trying both the beta of your tool from your releases page (dubbed 0.0.1) and the newest available ZIP file directly from the repo (dubbed 0.0.2 from your commit message), the only response after clicking on the menu item for the Partition Manager is this Java exception:

java.io.IOException: Cannot run program "reg": error=2, Datei oder Verzeichnis nicht gefunden
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at java.lang.Runtime.exec(Runtime.java:450)
	at java.lang.Runtime.exec(Runtime.java:347)
	at com.espressif.partitions.ESP32Partitions.run(ESP32Partitions.java:51)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.IOException: error=2, Datei oder Verzeichnis nicht gefunden
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 18 more

As it stands, the tool is unusable at the moment.

johannesmaibaum avatar Sep 10 '18 08:09 johannesmaibaum

@johannesmaibaum The Error you are getting is due to the fact that at that point in the program, it's trying to read a key from your registry using the 'reg' program.

Unfortunately, Linux/Ubuntu does not have a registry to the best of my knowledge as i'm a windows user.

However, i can run a virtual Linux machine and try to find a fix for you.

francis94c avatar Sep 10 '18 08:09 francis94c

@SensorsIot What version of Python do you have installed?

francis94c avatar Sep 10 '18 08:09 francis94c

@francis94c Ah, sorry, didn't know that this is Windows-only so far. Got here by trying to run the EEPROM class examples from the official ESP32 Arduino core by espressif.

No, GNU/Linux has no registry in the Windows sense, but depending on what value you're trying to get from it, there might indeed be an equivalent way of acquiring that information. From a quick glance at your code (disclaimer: I'm neither a Java programmer nor a Windows registry expert), but form googling the key you are requesting inside your ESP32Partitions::run() method, I assume that you're trying to query the home directory path of the current user. In a GNU/Linux system, this info is usually provided by the environment variable HOME.

johannesmaibaum avatar Sep 10 '18 08:09 johannesmaibaum

Yeah, you are right @johannesmaibaum because the Arduino IDE tools folder in 'My Documents' which contains the actual python script 'esp-partition.py' that builds the UI, is relative the home path.

is the tools folder for Arduino IDE relative to the path in this Home variable?

francis94c avatar Sep 10 '18 09:09 francis94c

@francis94c If you install the Arduino IDE using default paths, the standard path for the tools folder would be $HOME/Arduino/tools.

johannesmaibaum avatar Sep 10 '18 09:09 johannesmaibaum

@francis94c By the way, I feel like hijacking this issue which wasn't GNU/Linux-related at all. Shouldn't we move this discussion to a new issue?

johannesmaibaum avatar Sep 10 '18 09:09 johannesmaibaum

Sure, feel free.

francis94c avatar Sep 10 '18 09:09 francis94c

@SensorsIot What version of Python do you have installed?

3.6. But maybe also 2.7 from an earlier project. I am a Python beginner :-(

SensorsIot avatar Sep 13 '18 21:09 SensorsIot

@SensorsIot Do you see a file esp-partition.py in C:\Users\{User Name}\Documents\Arduino\tools\ESP32Partitions\tool ?

If you do, open a terminal in that directory and run python esp-partition.py.

Let me know what happens.

francis94c avatar Sep 14 '18 04:09 francis94c

The ESP Partition tool appears in a pop-up. I extended the two app partitions to 0x1f0000 and the spiffs was reduced to 0xf000. After pressing "generate" the error message "An Arduino ESP32 path was not set" appears.

SensorsIot avatar Sep 17 '18 08:09 SensorsIot

@SensorsIot

Hi Sir Andreas Spiess, I'm glad you later tried it out.

You are almost there. Just set the path ONLY ONCE by starting your arduino IDE navigating to Tools >> ESP32 Partition Manager >> Espressif (@menu bar) >> Preferences

Then set the arduino-esp32 path and dump path to (this is my own case) C:\arduino-1.8.5\hardware\espressif\esp32 and C:\arduino-1.8.5\hardware\espressif\esp32\tools\partitions respectively.

If your arduino-esp32 installation was done through arduino board manager then your arduino-esp32 core would be in somewhere C:\User(Your PC name)\AppData\Local\Arduino15\packages\esp32
and dump path C:\User(Your PC name)\AppData\Local\Arduino15\packages\esp32\tools\partitions

Please note that this setup is done only ONCE.

I hope to see it in your wonderful reviews @your YouTube channel.

With love for open source from, @francis94c & @fedy0

fedy0 avatar Sep 21 '18 17:09 fedy0

I don't know is this helpful for anyone but instead of making your partitions you can use implemented in core from there , so instead EEPROMClass NAMES("eeprom0", 0x1000); write EEPROMClass NAMES("eeprom", 0x1000); , and it will work for example named "eeprom_class"

arminsalcin avatar Nov 15 '18 15:11 arminsalcin

@SensorsIot Do you see a file esp-partition.py in C:\Users\{User Name}\Documents\Arduino\tools\ESP32Partitions\tool ?

If you do, open a terminal in that directory and run python esp-partition.py.

Let me know what happens. I got an error when trying to execute esp-partittion.py: python esp-partition.py File "esp-partition.py", line 498 buff = sorted(self.ui_map.iteritems(), key=lambda(k, v): (v, k)) SyntaxError: invalid syntax I have no experience in python, and need to use this tool. Can you please help?

amontero0611 avatar Dec 28 '18 16:12 amontero0611

@SensorsIot Do you see a file esp-partition.py in C:\Users\{User Name}\Documents\Arduino\tools\ESP32Partitions\tool ? If you do, open a terminal in that directory and run python esp-partition.py. Let me know what happens. I got an error when trying to execute esp-partittion.py: python esp-partition.py File "esp-partition.py", line 498 buff = sorted(self.ui_map.iteritems(), key=lambda(k, v): (v, k)) SyntaxError: invalid syntax I have no experience in python, and need to use this tool. Can you please help?

Solved using python 2.7

amontero0611 avatar Dec 28 '18 17:12 amontero0611

The script was written using python 2.7

francis94c avatar Dec 28 '18 23:12 francis94c

Is there a way to write the same sorted function for python3 in the same code? I rewrote it for both (python 2 and 3): https://github.com/francis94c/ESP32Partitions/issues/2

But I commented out the sorted function as I am not able to write it with "if PY=2 sorted(…), else sorted(...)"

Adrianotiger avatar Mar 07 '19 16:03 Adrianotiger

You are almost there. Just set the path ONLY ONCE by starting your arduino IDE navigating to Tools >> ESP32 Partition Manager >> Espressif (@menu bar) >> Preferences

If your arduino-esp32 installation was done through arduino board manager then your arduino-esp32 core would be in somewhere C:\User(Your PC name)\AppData\Local\Arduino15\packages\esp32 and dump path C:\User(Your PC name)\AppData\Local\Arduino15\packages\esp32\tools\partitions

Please note that this setup is done only ONCE.

Two changes I made to get this working i) on windows you MUST have the display font set to Normal(100%). If you set it larger 125% or 150% you cannot access the button on the right of the path fields ii) the paths for window Arduino15 board manager install are actually C:\Users<username>\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2 for the Arduino ESP32 path and C:\Users<username>\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\tools\partitions for the dump path for version 1.0.2 release

drmpf avatar Aug 12 '19 05:08 drmpf

@johannesmaibaum The Error you are getting is due to the fact that at that point in the program, it's trying to read a key from your registry using the 'reg' program.

Unfortunately, Linux/Ubuntu does not have a registry to the best of my knowledge as i'm a windows user.

However, i can run a virtual Linux machine and try to find a fix for you.

Installed in ubuntu, getting the same error when click in the Tools -> ESP32 Partition Manager

sabado avatar Jun 14 '21 18:06 sabado