My issue is with the Unknown FQBN for the ESP32 and the Nano.
This is expected and normal for any board that uses a general purpose USB to serial adapter chip (e.g., FTDI FT232, CH340). The reason is that these chips use a VID/PID provided by the manufacturer, rather than a custom, board-specific ID as is done on the more modern official Arduino boards. This means there is no way to know which board that generic VID/PID is associated with. You’ll notice that the Arduino IDE’s Tools > Board menu and Tools > Board Info are also unable to identify these boards. This is not a situation where Arduino intentionally didn’t provide support for clones and 3rd party compatible boards. The same applies even to the official Arduino Nano (and Diecimila as well, I believe), which uses the FTDI FT232 with its manufacturer-provided VID/PID. There is simply no possible way for these boards to be identified.
It doesn’t mean you can’t use the boards. It only means that the convenience features like arduino-cli board attach and arduino-cli board list don’t work quite as well with these boards. The essential features will still work perfectly well.
arduino-cli board attach serial:///dev/ttyUSB0 HelloWorld
Attach board error: no supported board found at serial:///dev/ttyUSB0
arduino-cli board attach detects the FQBN of the board connected to the given port and associates that FQBN with the specified sketch so that you don’t need to provide a --fqbn option for commands related to that sketch. arduino-cli board attach does exactly the same thing. You don’t even need to use arduino-cli board attach if you don’t want, it’s purely a convenience feature.
arduino-cli board attach esp32:esp32:esp32 HelloWorld
are equivalent to this command:
arduino-cli compile --fqbn esp32:esp32:esp32
My config contained:
Which is the same as I used in the IDE. Is this correct?
Yes, but note that the Boards Manager URL now recommended in the official documentation is https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json. The one you’re using is what used to be in the documentation. It’s likely the old URL will continue to work, but we have no guarantee about this.
Also when compiling for the ESP32 I had issues with ‘serial’ not being defined. It took me ages to learn that I required ‘pyserial’ installed.
This is nothing specific to Arduino CLI. You would have the same problem with the Arduino IDE. It’s not even an Arduino problem, it’s an issue imposed by the way the 3rd party ESP32 platform was configured.
It has taken me a day to get to the point where I can compile and upload to the ESP32. I am not really sure what arduino-cli offers me.
Arduino CLI offers you a lightweight command line tool to work with Arduino sketches. This is useful to people who like working from the command line or for automation such as scripts or continuous integration. Many Arduino users don’t have a need for these use cases and will prefer to use the Arduino IDE, Arduino Web Editor, or Arduino Pro IDE. What they don’t know is that they are still using Arduino CLI even then, because it is the heart of those GUI tools. So we all benefit from Arduino CLI even if we don’t chose to use it directly. It’s likely that many of the 3rd party alternative IDEs will also use Arduino CLI, if they aren’t already.
What about my Microbit boards is there any chance of getting those working. In fairness I was not able to use the Arduino IDE either but I am always hopeful.
Give this a try:
It says it supports the micro:bit. I haven’t tried it because I don’t own that board, but the author, Sandeep Mistry, does some very good work.
I think the ideas behind arduino-cli are great, unify cli and GUI but we poor (financially) makers need tools we can use even on cheap clones. When we become rich we will be able to afford Genuine Adruino products.
Arduino IDE is already a tool for all Arduino users, whether they are able to support Arduino’s work on it or not. Arduino has done a lot of work to provide good support for 3rd party boards, even though these boards compete directly with the official products.
There are some rare compatibility issues with Arduino CLI and certain 3rd party platforms, but this is more a matter of the platform author needing to fix their configuration. I’m sure that support will improve quickly as more people begin to use Arduino CLI and the development progresses. I think you’ll have no problems with any of the boards you listed above though.