ESP32Partitions icon indicating copy to clipboard operation
ESP32Partitions copied to clipboard

ESP32Partitions tool doesn't work on GNU/Linux

Open johannesmaibaum opened this issue 6 years ago • 7 comments

Pasting the relevant parts from #1 :

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

In a GNU/Linux system, the info that the tools is requesting from the Windows registry is usually provided by the environment variable called HOME.

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

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

Checkout the latest commit on master, extract the zip into your tools folder as you did before and see if works.

francis94c avatar Sep 10 '18 09:09 francis94c

Now it throws:

java.lang.ArrayIndexOutOfBoundsException: 4
	at com.espressif.partitions.ESP32Partitions.run(ESP32Partitions.java:64)
	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)

johannesmaibaum avatar Sep 10 '18 10:09 johannesmaibaum

My Bad, That line was still relating to windows... I'm moving it now.

francis94c avatar Sep 10 '18 10:09 francis94c

I guess the latest commit will fix the issue now.

francis94c avatar Sep 10 '18 10:09 francis94c

Now it doesn't throw an exception anymore, but I think that I'm now really affected by #1 , i.e. I don't see any message in the IDE, but there is also no GUI coming up.

Manually running python esp-partition.py from inside $HOME/Arduino/tools/ESP32Partitions/tool/ does bring up a GUI though.

In case you're wondering: python --version returns Python 2.7.15rc1 on my machine.

johannesmaibaum avatar Sep 10 '18 11:09 johannesmaibaum

@johannesmaibaum Do you have any other python version installed on your machine alongside the 2.7 you have?

francis94c avatar Dec 28 '18 23:12 francis94c

@francis94c Yes, I have both Python 2 and Python 3 installed:

$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Both are installed from the standard Ubuntu repositories.

johannesmaibaum avatar Jan 04 '19 14:01 johannesmaibaum