Hi @sanagustin_4b. The lack of access to the system temporary folder seems likely to be problematic for more than Arduino IDE alone, since this folder is used by many different applications. So it would be a good idea to investigate the reason why the student accounts don't have access.
But as for the specific situation you encountered with Arduino IDE, I can suggest a workaround for the problem. When you compile a sketch in Arduino IDE, the process generates some files. By default, Arduino IDE stores these files under the arduino
subfolder of the operating system's standard temporary folder (/tmp
on Linux machines). However, you can configure Arduino IDE to store the files under a different location if for some reason /tmp/arduino
is not suitable.
I'll provide instructions you can follow to do that:
These instructions will only work for Arduino IDE versions 2.3.4 or newer.
- Select File > Quit from the Arduino IDE menus if it is running.
All Arduino IDE windows will close.
- Open the file at the following path in any text editor:
/home/<username>/.arduinoIDE/
(where <username>
is your Linux username)
The .arduinoIDE
folder may be hidden by default in your file manager and terminal.
- Add the following content to the
arduino-cli.yaml
file (or replace the existing content if equivalent content is already present in the file):build_cache:
path: <build cache folder path>
- Replace the
<build cache folder path>
placeholder with the path to the folder under which you want Arduino to store the files that are generated when you compile a sketch.
Arduino IDE periodically deletes contents of this folder (the files stored under it are only cached there for the sake of efficiency, and it can always regenerate the files on demand), so you should not use this folder to store any valuable files.
- Save the file.
- Start Arduino IDE.
Now try compiling a sketch again. Hopefully this time everything will work as expected.
If you only need to configure a couple of accounts one time, then the approach of manually editing the files using a text editor as I described above will be reasonable. However, in an institutional setting, it might be necessary to do this for many accounts. In that case, the system administrator would likely want to automate the process as part of the user account provisioning process.
This file is written in the common YAML language, so it is fairly easy to set up scripts to modify the file automatically.
The arduino-cli.yaml
configuration file can be generated and the data in the file adjusted using a command line tool named Arduino CLI, which is provided by Arduino. This is done using Arduino CLI's arduino-cli config
commands:
https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_config/
As an alternative to Arduino CLI, you can use any tool that supports the YAML language. For a general purpose command line tool for working with YAML, I can recommend the excellent yq:
You will find that a high quality YAML library is available for each programming language (example).