After doing a fresh OS install on my MacBook I needed to go through the process of setting up the Arduino IDE again. This time I decided to try the Arduino Web Editor as I could save all of my scripts to my account and not need to worry about preserving them if I ever re-installed my OS again or upgraded to a new machine, which is long overdue.
The nice thing about the Arduino Web Editor is that you can upload all of your scripts and it will import all of the detected libraries for you automatically. It also has a nice list view of your scripts that lets you dip into each of them quickly to pull out code you might need.
Troubleshooting the installation
As part of setting up the Arduino Web Editor you need to install the Arduino Create Agent on your machine to help compile and flash your code onto the board. I ran into a bit of trouble when trying to install the Create Agent on Mac OS with the installer spitting out the following error during the installation process:
Problem running post-install step. Installation may not complete correctly Error running osascript -e "do shell script \"security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /Users/username/Applications/ArduinoCreateAgent/ArduinoCreateAgent.app/Contents/MacOS/ca.cert.pem\" with administrator privileges": 0:222: execution error: SecTrustSettingsSetTrustSettings: The authorization was denied since no user interaction was possible. (1)
After clicking “Okay” the installer progressed to its completed screen but when navigating back to the Arduino Web Editor tab in my browser it was complaining about being unable to detect the Arduino create agent.
On closer inspection of the error it appears that the installer is not getting sufficient permission to add Arduino’s certificate as a trusted one to the system keychain because '“no user interaction was possible”, even after I had entered my administrator password during the installation.
So I just copied the failed command out of the above error and ran it as sudo in the terminal, like this:
Make sure you replace
username in the command below with your username.
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /Users/username/Applications/ArduinoCreateAgent/ArduinoCreateAgent.app/Contents/MacOS/ca.cert.pem
After being prompted for my admin password to run the command the certificate was successfully added and upon returning the Arduino Web Editor setup page in my browser it reported that the agent has now been detected successfully.
I just thought I’d post this tip as there doesn’t seem to be much about it on the forums when I was naively pasting the error in search of a solution instead of just reading the error :)
Now, time to start playing with the boards again…