Uploading Via arduino-cli?

Alright, so I think I have this figured out. Naturally, I was over-complicating things when I tried to do this the first time around.

  1. Install Arduino-CLI for your OS of choice (I’m on mac, so I just used brew).
  2. Run arduino-cli config init to create a configuration file. The program should give you an output telling you where the config file was placed. It should be named arduino-cli.yaml.
  3. Edit the config file to include https://github.com/bigjosh/Move38-Arduino-Platform/releases/latest/download/package_move38.com-blinks_index.json in the “board_manager” section under “additional urls”. It should look like this:
board_manager:
  additional_urls:
    - https://github.com/bigjosh/Move38-Arduino-Platform/releases/latest/download/package_move38.com-blinks_index.json
  1. Save the changes to the config file and run arduino-cli core update-index for the changes in your config to take place.

  2. Make sure you have the proper compiler installed by running arduino-cli core install arduino:avr

All of these above steps are explained in more detail in their own docs, which you can follow in case my instructions aren’t very clear. I just thought it would be helpful to include the proper board strings and package urls for Blinks.

From here, you should be able to compile and upload the sketch using the arduino-cli program. However, make sure you are in the parent directory of your sketch folder, not in the sketch folder itself. Otherwise these commands get a little confused.

  • **Compile (Verify) Sketch: ** arduino-cli compile --fqbn Move38-Blinks-Library:avr:blink SketchName

  • **Upload: ** arduino-cli upload -b Move38-Blinks-Library:avr:blink -programmer SketchName

Note that the above commands take the name of the sketch without the ‘.ino’ extension. Arduino-CLI is assuming that the name of the sketch is within a folder that matches the name of the sketch file. The IDE also behaves this way, but the CLI program is a little less obvious about it.

Hopefully this helps, if there’s anything I missed let me know. This will probably be the way I handle my workflow on my macbook from here on out!

4 Likes