Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Set custom Arduino IDE preferences #1464

Closed
DRSDavidSoft opened this issue Feb 26, 2022 · 3 comments
Closed

Set custom Arduino IDE preferences #1464

DRSDavidSoft opened this issue Feb 26, 2022 · 3 comments

Comments

@DRSDavidSoft
Copy link

DRSDavidSoft commented Feb 26, 2022

Hi there, I'm looking into the documentation, but haven't quite figured this out yet.

Is there a way to pass some preferences to the ide? The command line would be something like --pref key=value, but I was wondering if there is a way to set such configuration in arduino.json, and have it be passed using the setPref() method call:

public async setPref(key, value) {

So maybe I could write config like this:

{
    "preferences": {
        "upload.tool": "avrdude_custom"
    }
}
@github-actions github-actions bot added the triage New issues that have not been reviewed. label Feb 26, 2022
@davidcooper1
Copy link
Contributor

Hi! After a bit of research, I found that the arduino.json can have build preferences added in the following format:

{
    "buildPreferences": [
        ["upload.tool", "avrdude_custom"]
    ]
}

Essentially just put any preference you want into the array as an array with the first element being the key and the second the value.

@DRSDavidSoft
Copy link
Author

@davidcooper1 Great, going to test this right away!

Thank you for the tip!

@github-actions github-actions bot removed the triage New issues that have not been reviewed. label Feb 28, 2022
@gruenfron
Copy link

Essentially just put any preference you want into the array as an array with the first element being the key and the second the value.

Oh wow, thanks for pointing out.

    "port": "192.168.xx.yy",
    "buildPreferences": [
        [
            "runtime.pwd.192.168.xx.yy",
            "mySecretPassword"
        ]
    ],

This easily solves my ESP32 simple OTA upload-with-password problem showing "Authorization required: No authorization data found" (#676).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants