Skip to content

[ci skip] Show how to use the configuration file #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,42 @@ Great! Now we are ready to compile and upload the sketch.

#### Adding 3rd party cores

To add 3rd party core packages add a link of the additional package to the file `arduino-cli.yaml`
To use 3rd party core packages, pass a link to the the additional package index
file with the `--additional-urls` option to any command that supports additional
cores:

If you want to add the ESP8266 core, for example:
```console
$ arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
$
$ arduino-cli core search esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
ID Version Name
esp8266:esp8266 2.5.2 esp8266
```

To avoid passing the `--additional-urls` option every time you run a command,
you can list the URLs to additional package indexes in the CLI configuration
file. If you don't have a configuration file yet (it's the case of a fresh
install) you can create one with the command:

```console
$ arduino-cli config init
Config file PATH: /home/user/.arduino15/arduino-cli.yaml
```

This will create a configuration file in its default location for the current
operating system and will print the full path to the file.

For example, to add the ESP8266 core, edit the configration file and add the
following:

```yaml
board_manager:
additional_urls:
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
```
And then run:
From now on, commands supporting custom cores will automatically use the
additional URL from the configuration file:
```console
$ arduino-cli core update-index
Expand All @@ -257,16 +282,6 @@ ID Version Name
esp8266:esp8266 2.5.2 esp8266
```

Alternatively, you can pass the `--additional-urls` to any command involving the additional cores:

```console
$ arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
$
$ arduino-cli core search esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
ID Version Name
esp8266:esp8266 2.5.2 esp8266
```

### Step 5. Compile the sketch

To compile the sketch we have to run the `compile` command with the proper FQBN we just got in the
Expand Down