@@ -234,17 +234,42 @@ Great! Now we are ready to compile and upload the sketch.
234
234
235
235
#### Adding 3rd party cores
236
236
237
- To add 3rd party core packages add a link of the additional package to the file ` arduino-cli.yaml `
237
+ To use 3rd party core packages, pass a link to the the additional package index
238
+ file with the ` --additional-urls ` option to any command that supports additional
239
+ cores:
238
240
239
- If you want to add the ESP8266 core, for example:
241
+ ``` console
242
+ $ arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
243
+ $
244
+ $ arduino-cli core search esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
245
+ ID Version Name
246
+ esp8266:esp8266 2.5.2 esp8266
247
+ ```
248
+
249
+ To avoid passing the ` --additional-urls ` option every time you run a command,
250
+ you can list the URLs to additional package indexes in the CLI configuration
251
+ file. If you don't have a configuration file yet (it's the case of a fresh
252
+ install) you can create one with the command:
253
+
254
+ ``` console
255
+ $ arduino-cli config init
256
+ Config file PATH: /home/user/.arduino15/arduino-cli.yaml
257
+ ```
258
+
259
+ This will create a configuration file in its default location for the current
260
+ operating system and will print the full path to the file.
261
+
262
+ For example, to add the ESP8266 core, edit the configration file and add the
263
+ following:
240
264
241
265
``` yaml
242
266
board_manager :
243
267
additional_urls :
244
268
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
245
269
` ` `
246
270
247
- And then run:
271
+ From now on, commands supporting custom cores will automatically use the
272
+ additional URL from the configuration file:
248
273
249
274
` ` ` console
250
275
$ arduino-cli core update-index
@@ -257,16 +282,6 @@ ID Version Name
257
282
esp8266:esp8266 2.5.2 esp8266
258
283
```
259
284
260
- Alternatively, you can pass the ` --additional-urls ` to any command involving the additional cores:
261
-
262
- ``` console
263
- $ arduino-cli core update-index --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
264
- $
265
- $ arduino-cli core search esp8266 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
266
- ID Version Name
267
- esp8266:esp8266 2.5.2 esp8266
268
- ```
269
-
270
285
### Step 5. Compile the sketch
271
286
272
287
To compile the sketch we have to run the ` compile ` command with the proper FQBN we just got in the
0 commit comments