Skip to content
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

Add --all flag to core list command and gRPC interface #1166

Merged
merged 1 commit into from Feb 12, 2021

Conversation

silvanocerza
Copy link
Contributor

@silvanocerza silvanocerza commented Feb 3, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Adds a new feature.

  • What is the current behavior?

Calling core list returns only platforms installed with the CLI.

  • What is the new behavior?

Calling core list keeps returning only platforms installed with the CLI, but the --all flag can be used to return all installed and installable platforms, including those installed manually by the user in their Sketchbook hardware folder.

If both --all and --update flags are set --all takes precedence.

This also updates the gRPC interface.

Nope.

  • Other information:

Fixes arduino/arduino-pro-ide#355 and supersedes #1151


See how to contribute

cli/core/list.go Outdated Show resolved Hide resolved
@silvanocerza
Copy link
Contributor Author

Rebased the PR, the original commit has been modified quite a bit.

@silvanocerza silvanocerza force-pushed the scerza/core-list-all branch 3 times, most recently from 0d3124b to f03c76c Compare February 12, 2021 09:48
Setting that flags return all installed and installable platforms,
including installed manually by the user in their Sketchbook hardware
folder.
@silvanocerza silvanocerza merged commit 13f5203 into master Feb 12, 2021
@silvanocerza silvanocerza deleted the scerza/core-list-all branch February 12, 2021 11:15
@kittaakos
Copy link
Contributor

kittaakos commented Feb 18, 2021

Fixes arduino/arduino-pro-ide#355

Unfortunately, it does not fix the issues, and the new gRPC API is insufficient to solve arduino/arduino-pro-ide#355. core search is used to filter the boards. Here are the steps that I hope describe what's missing.

Empty state:

% rm -rf ~/Library/Arduino15          
% ls -al ~/Documents/Arduino          
total 0
drwxr-xr-x@  2 akos.kitta  staff   64 Feb 18 16:12 .
drwx------@ 24 akos.kitta  staff  768 Feb  5 08:38 ..

CLI version:

% ./arduino-cli version --format json
{
  "Application": "arduino-cli",
  "VersionString": "nightly-20210218",
  "Commit": "2c7b6ba5",
  "Status": "alpha",
  "Date": "2021-02-18T01:29:42Z"
}

List the platforms. It correctly empty:

% ./arduino-cli core list --format json
[]

List all the platforms including the installable ones and the ones that were automatically installed:

% ./arduino-cli core list --all --format json
[
  {
    "ID": "arduino-beta:mbed",
    "Latest": "1.3.1",
    "Name": "[DEPRECATED] Arduino mbed-enabled Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Portenta H7"
      },
      {
        "name": "Arduino Nano 33 BLE"
      },
      {
        "name": "This package was used for beta testing and won't be maintained anymore. Please remove this package and install the 'Arduino mbed-enabled Boards' package that is not labeled '[DEPRECATED]'"
      }
    ]
  },
  {
    "ID": "atmel-avr-xminis:avr",
    "Latest": "0.6.0",
    "Name": "Atmel AVR Xplained-minis",
    "Maintainer": "Atmel University France",
    "Website": "https://github.com/AtmelUniversityFrance/atmel-avr-xmini-boardmanagermodule/wiki",
    "Boards": [
      {
        "name": "atmega168pb-xmini"
      },
      {
        "name": "atmega328pb-xmini"
      },
      {
        "name": "atmega328p-xmini"
      }
    ]
  },
  {
    "ID": "Arrow:samd",
    "Latest": "2.1.0",
    "Name": "Arrow Boards",
    "Maintainer": "Axel Elettronica S.r.l.",
    "Website": "http://axelelettronica.it/",
    "Email": "development@axelelettronica.it",
    "Boards": [
      {
        "name": "SmartEverything Fox"
      },
      {
        "name": "SmartEverything Fox3"
      },
      {
        "name": "SmartEverything Lion"
      },
      {
        "name": "SmartEverything Dragonfly"
      },
      {
        "name": "Analog ADI"
      },
      {
        "name": "SmartTutto"
      }
    ]
  },
  {
    "ID": "emoro:avr",
    "Latest": "3.2.2",
    "Name": "EMORO 2560",
    "Maintainer": "Inovatic-ICT",
    "Website": "http://www.emoro.eu/shop/system/download/EMoRo2560_and_GLAM_brochure.pdf.0b83da8ad90db30722cca3a5d2529494",
    "Email": "support@inovatic-ict.com",
    "Boards": [
      {
        "name": "EMoRo 2560. Board based on ATmega 2560 MCU"
      }
    ]
  },
  {
    "ID": "industruino:samd",
    "Latest": "1.0.1",
    "Name": "Industruino SAMD Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Industruino",
    "Website": "https://industruino.com/",
    "Email": "connect@industruino.com",
    "Boards": [
      {
        "name": "Industruino D21G"
      }
    ]
  },
  {
    "ID": "arduino:samd",
    "Latest": "1.8.11",
    "Name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino MKR WiFi 1010"
      },
      {
        "name": "Arduino Zero"
      },
      {
        "name": "Arduino MKR1000"
      },
      {
        "name": "Arduino MKRZERO"
      },
      {
        "name": "Arduino MKR FOX 1200"
      },
      {
        "name": "Arduino MKR WAN 1300"
      },
      {
        "name": "Arduino MKR WAN 1310"
      },
      {
        "name": "Arduino MKR GSM 1400"
      },
      {
        "name": "Arduino MKR NB 1500"
      },
      {
        "name": "Arduino MKR Vidor 4000"
      },
      {
        "name": "Arduino Nano 33 IoT"
      },
      {
        "name": "Arduino M0 Pro"
      },
      {
        "name": "Arduino M0"
      },
      {
        "name": "Arduino Tian"
      },
      {
        "name": "Adafruit Circuit Playground Express"
      }
    ]
  },
  {
    "ID": "arduino:samd_beta",
    "Latest": "1.6.25",
    "Name": "Arduino SAMD Beta Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino MKR Vidor 4000"
      }
    ]
  },
  {
    "ID": "arduino:mbed",
    "Latest": "1.3.2",
    "Name": "Arduino mbed-enabled Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Portenta H7"
      },
      {
        "name": "Arduino Nano 33 BLE"
      }
    ]
  },
  {
    "ID": "arduino:nrf52",
    "Latest": "1.0.2",
    "Name": "Arduino nRF52 Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Primo"
      },
      {
        "name": "Arduino Primo Core"
      }
    ]
  },
  {
    "ID": "arduino:avr",
    "Latest": "1.8.3",
    "Name": "Arduino AVR Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Yún"
      },
      {
        "name": "Arduino Uno"
      },
      {
        "name": "Arduino Uno WiFi"
      },
      {
        "name": "Arduino Diecimila"
      },
      {
        "name": "Arduino Nano"
      },
      {
        "name": "Arduino Mega"
      },
      {
        "name": "Arduino MegaADK"
      },
      {
        "name": "Arduino Leonardo"
      },
      {
        "name": "Arduino Leonardo Ethernet"
      },
      {
        "name": "Arduino Micro"
      },
      {
        "name": "Arduino Esplora"
      },
      {
        "name": "Arduino Mini"
      },
      {
        "name": "Arduino Ethernet"
      },
      {
        "name": "Arduino Fio"
      },
      {
        "name": "Arduino BT"
      },
      {
        "name": "Arduino LilyPadUSB"
      },
      {
        "name": "Arduino Lilypad"
      },
      {
        "name": "Arduino Pro"
      },
      {
        "name": "Arduino ATMegaNG"
      },
      {
        "name": "Arduino Robot Control"
      },
      {
        "name": "Arduino Robot Motor"
      },
      {
        "name": "Arduino Gemma"
      },
      {
        "name": "Adafruit Circuit Playground"
      },
      {
        "name": "Arduino Yún Mini"
      },
      {
        "name": "Arduino Industrial 101"
      },
      {
        "name": "Linino One"
      }
    ]
  },
  {
    "ID": "arduino:megaavr",
    "Latest": "1.8.7",
    "Name": "Arduino megaAVR Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Uno WiFi Rev2"
      },
      {
        "name": "Arduino Nano Every"
      }
    ]
  },
  {
    "ID": "arduino:sam",
    "Latest": "1.6.12",
    "Name": "Arduino SAM Boards (32-bits ARM Cortex-M3)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Due"
      }
    ]
  },
  {
    "ID": "Intel:i586",
    "Latest": "1.6.7+1.0",
    "Name": "Intel i586 Boards",
    "Maintainer": "Intel",
    "Website": "http://maker.intel.com/",
    "Email": "support@intel.com",
    "Boards": [
      {
        "name": "Galileo"
      }
    ]
  },
  {
    "ID": "Intel:i686",
    "Latest": "1.6.7+1.0",
    "Name": "Intel i686 Boards",
    "Maintainer": "Intel",
    "Website": "http://maker.intel.com/",
    "Email": "support@intel.com",
    "Boards": [
      {
        "name": "Edison"
      }
    ]
  },
  {
    "ID": "Intel:arc32",
    "Latest": "2.0.4",
    "Name": "Intel Curie Boards",
    "Maintainer": "Intel",
    "Website": "http://maker.intel.com/",
    "Email": "support@intel.com",
    "Boards": [
      {
        "name": "Arduino 101"
      }
    ]
  },
  {
    "ID": "littleBits:avr",
    "Latest": "1.0.0",
    "Name": "littleBits Arduino AVR Modules",
    "Maintainer": "littleBits Electronics",
    "Website": "http://www.littlebits.cc/bits/w6-arduino",
    "Email": "support@littlebits.cc",
    "Boards": [
      {
        "name": "littleBits w6 Arduino module"
      }
    ]
  },
  {
    "ID": "Microsoft:win10",
    "Latest": "1.1.2",
    "Name": "Windows 10 Iot Core",
    "Maintainer": "Microsoft.IoT",
    "Website": "https://github.com/ms-iot/iot-utilities/tree/master/IotCoreAppDeployment/ArduinoIde/",
    "Email": "bfjelds@microsoft.com",
    "Boards": [
      {
        "name": "Windows 10 IoT Core"
      }
    ]
  }
]

Now search for a board, for example, Nano. It should return with all installable platforms where either the name of the platform, the ID of the platform or the name or any board contains Nano. It works:

% ./arduino-cli core search "Nano" --format json
[
  {
    "ID": "arduino:avr",
    "Latest": "1.8.3",
    "Name": "Arduino AVR Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Yún"
      },
      {
        "name": "Arduino Uno"
      },
      {
        "name": "Arduino Uno WiFi"
      },
      {
        "name": "Arduino Diecimila"
      },
      {
        "name": "Arduino Nano"
      },
      {
        "name": "Arduino Mega"
      },
      {
        "name": "Arduino MegaADK"
      },
      {
        "name": "Arduino Leonardo"
      },
      {
        "name": "Arduino Leonardo Ethernet"
      },
      {
        "name": "Arduino Micro"
      },
      {
        "name": "Arduino Esplora"
      },
      {
        "name": "Arduino Mini"
      },
      {
        "name": "Arduino Ethernet"
      },
      {
        "name": "Arduino Fio"
      },
      {
        "name": "Arduino BT"
      },
      {
        "name": "Arduino LilyPadUSB"
      },
      {
        "name": "Arduino Lilypad"
      },
      {
        "name": "Arduino Pro"
      },
      {
        "name": "Arduino ATMegaNG"
      },
      {
        "name": "Arduino Robot Control"
      },
      {
        "name": "Arduino Robot Motor"
      },
      {
        "name": "Arduino Gemma"
      },
      {
        "name": "Adafruit Circuit Playground"
      },
      {
        "name": "Arduino Yún Mini"
      },
      {
        "name": "Arduino Industrial 101"
      },
      {
        "name": "Linino One"
      }
    ]
  },
  {
    "ID": "arduino:megaavr",
    "Latest": "1.8.7",
    "Name": "Arduino megaAVR Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Uno WiFi Rev2"
      },
      {
        "name": "Arduino Nano Every"
      }
    ]
  },
  {
    "ID": "arduino:samd",
    "Latest": "1.8.11",
    "Name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino MKR WiFi 1010"
      },
      {
        "name": "Arduino Zero"
      },
      {
        "name": "Arduino MKR1000"
      },
      {
        "name": "Arduino MKRZERO"
      },
      {
        "name": "Arduino MKR FOX 1200"
      },
      {
        "name": "Arduino MKR WAN 1300"
      },
      {
        "name": "Arduino MKR WAN 1310"
      },
      {
        "name": "Arduino MKR GSM 1400"
      },
      {
        "name": "Arduino MKR NB 1500"
      },
      {
        "name": "Arduino MKR Vidor 4000"
      },
      {
        "name": "Arduino Nano 33 IoT"
      },
      {
        "name": "Arduino M0 Pro"
      },
      {
        "name": "Arduino M0"
      },
      {
        "name": "Arduino Tian"
      },
      {
        "name": "Adafruit Circuit Playground Express"
      }
    ]
  },
  {
    "ID": "arduino:mbed",
    "Latest": "1.3.2",
    "Name": "Arduino mbed-enabled Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Portenta H7"
      },
      {
        "name": "Arduino Nano 33 BLE"
      }
    ]
  },
  {
    "ID": "arduino-beta:mbed",
    "Latest": "1.3.1",
    "Name": "[DEPRECATED] Arduino mbed-enabled Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Portenta H7"
      },
      {
        "name": "Arduino Nano 33 BLE"
      },
      {
        "name": "This package was used for beta testing and won't be maintained anymore. Please remove this package and install the 'Arduino mbed-enabled Boards' package that is not labeled '[DEPRECATED]'"
      }
    ]
  }
]

Install a platform manually:

% git clone --depth 1 https://github.com/damellis/attiny ~/Documents/Arduino/hardware/attiny/avr
Cloning into '/Users/akos.kitta/Documents/Arduino/hardware/attiny/avr'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0
Unpacking objects: 100% (10/10), done.

Now verify the new all flag for the platform list. attiny:avr should be there, and it is there:

% ./arduino-cli core list --all --format json                                                   
[
  {
    "ID": "arduino:samd",
    "Latest": "1.8.11",
    "Name": "Arduino SAMD Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino MKR WiFi 1010"
      },
      {
        "name": "Arduino Zero"
      },
      {
        "name": "Arduino MKR1000"
      },
      {
        "name": "Arduino MKRZERO"
      },
      {
        "name": "Arduino MKR FOX 1200"
      },
      {
        "name": "Arduino MKR WAN 1300"
      },
      {
        "name": "Arduino MKR WAN 1310"
      },
      {
        "name": "Arduino MKR GSM 1400"
      },
      {
        "name": "Arduino MKR NB 1500"
      },
      {
        "name": "Arduino MKR Vidor 4000"
      },
      {
        "name": "Arduino Nano 33 IoT"
      },
      {
        "name": "Arduino M0 Pro"
      },
      {
        "name": "Arduino M0"
      },
      {
        "name": "Arduino Tian"
      },
      {
        "name": "Adafruit Circuit Playground Express"
      }
    ]
  },
  {
    "ID": "arduino:samd_beta",
    "Latest": "1.6.25",
    "Name": "Arduino SAMD Beta Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino MKR Vidor 4000"
      }
    ]
  },
  {
    "ID": "arduino:mbed",
    "Latest": "1.3.2",
    "Name": "Arduino mbed-enabled Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Portenta H7"
      },
      {
        "name": "Arduino Nano 33 BLE"
      }
    ]
  },
  {
    "ID": "arduino:nrf52",
    "Latest": "1.0.2",
    "Name": "Arduino nRF52 Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Primo"
      },
      {
        "name": "Arduino Primo Core"
      }
    ]
  },
  {
    "ID": "arduino:avr",
    "Latest": "1.8.3",
    "Name": "Arduino AVR Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Yún"
      },
      {
        "name": "Arduino Uno"
      },
      {
        "name": "Arduino Uno WiFi"
      },
      {
        "name": "Arduino Diecimila"
      },
      {
        "name": "Arduino Nano"
      },
      {
        "name": "Arduino Mega"
      },
      {
        "name": "Arduino MegaADK"
      },
      {
        "name": "Arduino Leonardo"
      },
      {
        "name": "Arduino Leonardo Ethernet"
      },
      {
        "name": "Arduino Micro"
      },
      {
        "name": "Arduino Esplora"
      },
      {
        "name": "Arduino Mini"
      },
      {
        "name": "Arduino Ethernet"
      },
      {
        "name": "Arduino Fio"
      },
      {
        "name": "Arduino BT"
      },
      {
        "name": "Arduino LilyPadUSB"
      },
      {
        "name": "Arduino Lilypad"
      },
      {
        "name": "Arduino Pro"
      },
      {
        "name": "Arduino ATMegaNG"
      },
      {
        "name": "Arduino Robot Control"
      },
      {
        "name": "Arduino Robot Motor"
      },
      {
        "name": "Arduino Gemma"
      },
      {
        "name": "Adafruit Circuit Playground"
      },
      {
        "name": "Arduino Yún Mini"
      },
      {
        "name": "Arduino Industrial 101"
      },
      {
        "name": "Linino One"
      }
    ]
  },
  {
    "ID": "arduino:megaavr",
    "Latest": "1.8.7",
    "Name": "Arduino megaAVR Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Uno WiFi Rev2"
      },
      {
        "name": "Arduino Nano Every"
      }
    ]
  },
  {
    "ID": "arduino:sam",
    "Latest": "1.6.12",
    "Name": "Arduino SAM Boards (32-bits ARM Cortex-M3)",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Due"
      }
    ]
  },
  {
    "ID": "Intel:i586",
    "Latest": "1.6.7+1.0",
    "Name": "Intel i586 Boards",
    "Maintainer": "Intel",
    "Website": "http://maker.intel.com/",
    "Email": "support@intel.com",
    "Boards": [
      {
        "name": "Galileo"
      }
    ]
  },
  {
    "ID": "Intel:i686",
    "Latest": "1.6.7+1.0",
    "Name": "Intel i686 Boards",
    "Maintainer": "Intel",
    "Website": "http://maker.intel.com/",
    "Email": "support@intel.com",
    "Boards": [
      {
        "name": "Edison"
      }
    ]
  },
  {
    "ID": "Intel:arc32",
    "Latest": "2.0.4",
    "Name": "Intel Curie Boards",
    "Maintainer": "Intel",
    "Website": "http://maker.intel.com/",
    "Email": "support@intel.com",
    "Boards": [
      {
        "name": "Arduino 101"
      }
    ]
  },
  {
    "ID": "Arrow:samd",
    "Latest": "2.1.0",
    "Name": "Arrow Boards",
    "Maintainer": "Axel Elettronica S.r.l.",
    "Website": "http://axelelettronica.it/",
    "Email": "development@axelelettronica.it",
    "Boards": [
      {
        "name": "SmartEverything Fox"
      },
      {
        "name": "SmartEverything Fox3"
      },
      {
        "name": "SmartEverything Lion"
      },
      {
        "name": "SmartEverything Dragonfly"
      },
      {
        "name": "Analog ADI"
      },
      {
        "name": "SmartTutto"
      }
    ]
  },
  {
    "ID": "emoro:avr",
    "Latest": "3.2.2",
    "Name": "EMORO 2560",
    "Maintainer": "Inovatic-ICT",
    "Website": "http://www.emoro.eu/shop/system/download/EMoRo2560_and_GLAM_brochure.pdf.0b83da8ad90db30722cca3a5d2529494",
    "Email": "support@inovatic-ict.com",
    "Boards": [
      {
        "name": "EMoRo 2560. Board based on ATmega 2560 MCU"
      }
    ]
  },
  {
    "ID": "industruino:samd",
    "Latest": "1.0.1",
    "Name": "Industruino SAMD Boards (32-bits ARM Cortex-M0+)",
    "Maintainer": "Industruino",
    "Website": "https://industruino.com/",
    "Email": "connect@industruino.com",
    "Boards": [
      {
        "name": "Industruino D21G"
      }
    ]
  },
  {
    "ID": "arduino-beta:mbed",
    "Latest": "1.3.1",
    "Name": "[DEPRECATED] Arduino mbed-enabled Boards",
    "Maintainer": "Arduino",
    "Website": "http://www.arduino.cc/",
    "Email": "packages@arduino.cc",
    "Boards": [
      {
        "name": "Arduino Portenta H7"
      },
      {
        "name": "Arduino Nano 33 BLE"
      },
      {
        "name": "This package was used for beta testing and won't be maintained anymore. Please remove this package and install the 'Arduino mbed-enabled Boards' package that is not labeled '[DEPRECATED]'"
      }
    ]
  },
  {
    "ID": "atmel-avr-xminis:avr",
    "Latest": "0.6.0",
    "Name": "Atmel AVR Xplained-minis",
    "Maintainer": "Atmel University France",
    "Website": "https://github.com/AtmelUniversityFrance/atmel-avr-xmini-boardmanagermodule/wiki",
    "Boards": [
      {
        "name": "atmega168pb-xmini"
      },
      {
        "name": "atmega328pb-xmini"
      },
      {
        "name": "atmega328p-xmini"
      }
    ]
  },
  {
    "ID": "littleBits:avr",
    "Latest": "1.0.0",
    "Name": "littleBits Arduino AVR Modules",
    "Maintainer": "littleBits Electronics",
    "Website": "http://www.littlebits.cc/bits/w6-arduino",
    "Email": "support@littlebits.cc",
    "Boards": [
      {
        "name": "littleBits w6 Arduino module"
      }
    ]
  },
  {
    "ID": "Microsoft:win10",
    "Latest": "1.1.2",
    "Name": "Windows 10 Iot Core",
    "Maintainer": "Microsoft.IoT",
    "Website": "https://github.com/ms-iot/iot-utilities/tree/master/IotCoreAppDeployment/ArduinoIde/",
    "Email": "bfjelds@microsoft.com",
    "Boards": [
      {
        "name": "Windows 10 IoT Core"
      }
    ]
  },
  {
    "ID": "attiny:avr",
    "Name": "ATtiny Microcontrollers",
    "Boards": [
      {
        "name": "ATtiny25/45/85",
        "fqbn": "attiny:avr:ATtinyX5"
      },
      {
        "name": "ATtiny24/44/84",
        "fqbn": "attiny:avr:ATtinyX4"
      }
    ],
    "ManuallyInstalled": true
  }
]

Now run a core search for ATtiny to hit either the name of the platform, the ID of the platform or any board name:

% ./arduino-cli core search "ATtiny" --format json
[]

It does not work. So I cannot search for boards within manually installed cores.

@silvanocerza
Copy link
Contributor Author

I feel like we need a board search instead of core search to solve the issue we have. 🤔

@kittaakos
Copy link
Contributor

I feel like we need a board search instead

Yes, that would be the ultimate solution. I am looking forward to such an API.

We have to keep in mind that we need the ID of the platform for each board. This would be required when the user selects a board that is not yet installed. We need to propose to install the platform. (I know I can derive the ID of the platform from the FQBN, but I would like to avoid introducing some logic based on assumption and leave this to the CLI.)

@per1234
Copy link
Contributor

per1234 commented Feb 19, 2021

I'm fine with a board search being added. This is consistent with the core search and lib search conventions.

However, I'm wondering what Akos's exact requirements are for it. Arduino Pro IDE needs to know about two classes of boards, which come from different sources:

Currently, arduino-cli board listall only lists the boards of installed platforms. So do you need arduino-cli board search to provide the full list of both classes of board @kittaakos?

@kittaakos
Copy link
Contributor

Currently, arduino-cli board listall only lists the boards of installed platforms. So do you need arduino-cli board search to provide the full list of both classes of board @kittaakos?

This would be the user requirement from the new IDE: list (and search) for all boards that come from:

  • manually installed platforms,
  • platforms installed by the manager,
  • platforms that could be installed via the manager (must contain all default not yet installed platforms + 3rd party ones).

The last requirement is to open the new IDE on a brand new machine, browse a board from the dialog, pick it, and install the corresponding platform if required.

@per1234
Copy link
Contributor

per1234 commented Feb 19, 2021

I think it would be good to design the board search command so that the user can control whether uninstalled boards are listed.

I think there are two distinct use cases for the command line users of board search:

  • Determine the platform ID of a board they want to use so they can install support for it via arduino-cli core install.
  • Determine the FQBN of an installed board for use in arduino-cli compile commands.

I'm thinking the default command should only show installed boards, then something like board search --all provides all available boards.

@ubidefeo
Copy link

A board search command would be inline with a board-centric paradigm.
It is also a non-breaking feature which makes us all happy, @silvanocerza

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

Successfully merging this pull request may close these issues.

Please Recognize Programmers In ./1.2.2/programmers.txt
5 participants