francis94c / ESP32Partitions

35 stars 9 forks source link

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

Open beegee-tokyo opened 6 years ago

beegee-tokyo commented 6 years ago

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:

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

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?

fedy0 commented 6 years ago

@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

SensorsIot commented 6 years ago

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.

johannesmaibaum commented 6 years ago

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.

francis94c commented 6 years ago

@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 commented 6 years ago

@SensorsIot What version of Python do you have installed?

johannesmaibaum commented 6 years ago

@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.

francis94c commented 6 years ago

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?

johannesmaibaum commented 6 years ago

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

johannesmaibaum commented 6 years ago

@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?

francis94c commented 6 years ago

Sure, feel free.

SensorsIot commented 6 years ago

@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 :-(

francis94c commented 6 years ago

@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.

SensorsIot commented 6 years ago

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.

fedy0 commented 6 years ago

@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

arminsalcin commented 5 years ago

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"

amontero0611 commented 5 years ago

@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 commented 5 years ago

@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

francis94c commented 5 years ago

The script was written using python 2.7

Adrianotiger commented 5 years ago

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(...)"

drmpf commented 5 years ago

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\\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2 for the Arduino ESP32 path and C:\Users\\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\tools\partitions for the dump path for version 1.0.2 release

sabado commented 3 years ago

@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