chatup
Hi, I'm trying to compile a code to esp32 but I get an error.
 
error.png
Reply 0 0
ggiraudon
Same problem here. It seems that the compilation environment is ignoring some environment variables. Or at least its not find its way to "cmd.exe" which is located in %SystemRoot$\System32
Is there any file/place we can alter the build script to specify the full path for "cmd" ?
This seems to be something to do with the arduino CLI build environment.
Reply 0 0
ggiraudon
Quick and dirty workaround :
(assuming you are using the ESP SDK version 3.0.5, if not, adjust path below accordingly)

Navigate to C:\Users\ggira\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5
Open platform.txt in your favorite text editor.
Find all instances of "=cmd" and replace them with "=c:\windows\system32\cmd.exe"
 
That should temporarily solve the issue. You'll have to repeat the process if you update the ESP32 SDK
 
Enjoy
Reply 0 0
thiagoralves
This seems to be an issue related to arduino-cli. I'm wondering if the latest ESP SDK update has anything to do with it. Are you guys able to compile code for the ESP32 normally on Arduino IDE?
Reply 0 0
ggiraudon
Yes, it compiles just fine under the Arduino IDE without modifying the platform.txt file.
I've tried downgrading/upgrading the ESP SDK to several different versions and the result is the same. It compiles under the arduino IDE but not under the OpenPLC Editor.
It looks like a simple problem of environment variables (either PATH or ComSpec) not being set.
Reply 0 0
Joluxer
 
for more investigation I'd like get more information about your situation.
Please start a pristine cmd.exe and tell us the unshortened output of the "PATH" command, mark it in the window, copy (right mouse click on the window top bar or hitting "Ctrl-C") and paste it into a text file in notepad.exe and attach it here.
Same question for the output of the failing build: please click into the build output window pane, hit "Ctrl-A Ctrl-C" sequence, this copies the whole window content, paste it in an other text file in notepad.exe and attach this text file here too.
Also, please, tell us your Windows version, so I can setup my test environment as close to yours as possible.
 
Thanks for your support
 
Regards, Joluxer
Reply 0 0
Joluxer
Meanwhile I could reproduce the problem on Windows 11. It is a long-known symptom of the Arduino development environment and I could isolate the cause for OpenPLC Editor setup.
 
As often seen, the problem occurs only, when file names or directory names contain spaces.
 
I'll work a quick fix and publish soon here.
 
Regards, J'Lo
Reply 0 0
Joluxer
After some testing, here my quickfix. The build system complained about problems with the PATH variable and I could track this down on my system.
 
To fix it temporarily and to give me more support information, please replace two files in your OpenPLC Editor installation. The fix targets Windows systems only.
 
One of the files is the start script of the OpenPLC Editor, located in the base directory of your OpenPLC Editor installation, named "OpenPLC Editor.bat". Depending on your file explorer settings, you might see the main file name part only: "OpenPLC Editor". Please, take the file from attached ZIP archive and copy it over to replace the existing file.
 
The other file is the build controller, which will give me more information, in case, the fix is not complete. Please, replace this too in advance. This file is usable on all host platforms, that can run OpenPLC editor. It is located in a subdirectory of the OpenPLC Editor installation, the subdirectory is named "arduino". The file name is "builder.py" and may be displayed just as "builder". Please, take the file from attached ZIP archive and copy it over to replace the existing file.
 
Please, give me some short feedback, when you are testing.
 
Regards, Joluxer
Reply 1 0
Arvid
Hi Joluxer,
It worked for me and I managed to compile Blink for ESP32 WROOM! Cheers!
Reply 0 0
thiagoralves
New Windows installer is out. If you're still having issues with that, please download the new Windows installer from the Autonomy website.
Reply 1 0
chatup
Hi, thank you all very much. I was able to upload the code by modifying the platform.txt and replacing "=cmd" with c:\windows\system32\cmd.exe".
I designed my own PLC to do the tests and I already uploaded the tutorial to my YT channel "El inge Tayu" in case you want to see it.
Reply 0 0
Joluxer
Hi, thank you all very much. I was able to upload the code by modifying the platform.txt and replacing "=cmd" with c:\windows\system32\cmd.exe".
I designed my own PLC to do the tests and I already uploaded the tutorial to my YT channel "El inge Tayu" in case you want to see it.
Replacing the path in the platform.txt should not be needed any more, if you use the quick fix or the new installer. When the Arduino folks change their mind and update the platform.txt for you, you might run into the same issue again.
 
Anyway, thank you for using and testing OpenPLC Editor.
Reply 0 0
Write a reply...
Reply