1

I'm trying to run Arduino IDE (CLI) from php script using shell_exec() with my Raspberry Pi that works as server. The command that build and upload sketch is inside a bash script. When I run it with terminal locally, it works fine, but if I run it using Postman from client side, Arduino IDE gives me this error:

Picked up JAVA_TOOL_OPTIONS: 
Settings issues: Arduino cannot run because it could not
create a folder to store your settings.

Bash script:

#...arduino command 

/opt/arduino-1.8.3/arduino --board arduino:samd:mkr1000 --port /dev/ttyACM0 --upload /path/of/sketch/sketch.ino

Php script:

...
$command = './compileAndUpload.sh';
shell_exec($command);
...

I tried to modify settings.path from preferences.txt in Arduino folder thinking the problem was related permissions but it did not work.

Could someone help me? Thanks

Albert Lazaro de Lara
  • 2,540
  • 6
  • 26
  • 41
  • Perhaps the user account that the PHP script runs under (web server user?) doesn't have the appropriate rights to create the directory? What does the web server error logs say? – stevieb Aug 24 '17 at 13:38
  • Apache error.log gives the message: "Picked up JAVA_TOOL_OPTIONS: Settings issues: Arduino cannot run because it could not create a folder to store your settings." Nothing else. – Cozza Pazza Aug 24 '17 at 15:14

0 Answers0