First time user with a collection of not-quite Genuino boards

I am using arduino-cli for the first time and have managed to install on Linux Mint.

When I say I have a collection of clones, I have 2 clones. The other boards are:

  • Espressif ESP32 Dev 4V (not really a clone)
  • BBC MicroBit
  • Nano clone
  • Micro clone (This I am VERY angry about as it was advertised as genuine but is actually a China made clone)
  • Various Arduino Duo and Decimila boards.
  • Having said that the price of a single Arduino-Micro (~£20) is way too expensive so I cheaper. What did I expect!

My issue is with the Unknown FQBN for the ESP32 and the Nano.

I have programmed both boards using the IDE without issue.

For the ESP32 I get:

Port Type Board Name FQBN Core
/dev/ttyUSB0 Serial Port (USB) Unknown

arduino-cli board attach serial:///dev/ttyUSB0 HelloWorld
Attach board error: no supported board found at serial:///dev/ttyUSB0

arduino-cli board attach esp32:esp32:esp32
Selected fqbn: esp32:esp32:esp32

For the Nano Clone I get:

Port Type Board Name FQBN Core
/dev/ttyUSB0 Serial Port (USB) Unknown

Maybe I deserve it for the Nano but what is with the ESP32.

My config contained:

board_manager:
additional_urls:

Which is the same as I used in the IDE. Is this correct? The only examples I found were for ESP8266.

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.

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.

Consecutive compiles and uploads are reasonably fast but the first build (when cache is empty) took nearly 30 seconds on my i7 Lenovo with 16gig ram running Linux Mint. I thought it had crashed! It is much slower than the IDE.

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. The MBED support for this board is abysmal and I am currently forced to use python!

I would like to use MS Code but at the moment the Arduino GUI offers a much better IDE.

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.

Kind regards

Stuart

daviessd:
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.

daviessd:
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.

These commands:

arduino-cli board attach esp32:esp32:esp32 HelloWorld
arduino-cli compile

are equivalent to this command:

arduino-cli compile --fqbn esp32:esp32:esp32

daviessd:
My config contained:

board_manager:
additional_urls:

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.

daviessd:
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.

daviessd:
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.

daviessd:
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.

daviessd:
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.

Thank you for taking the time to reply so completly.

You have covered all my issues and I will continue to follow the progress of arduino-cli with interest.

This will also make me much more wary of buying clones but I am still not in a position to spend £20 on a Arduino Mini, which is currently my go to board for non wifi apps.

The ESP32 is the chip I have invested most in and I will continue with that.

Again. Thanks for the reply:-)

Regards.

Stuart.

daviessd:
Thank you for taking the time to reply so completly.

You're welcome. I'm glad if I was able to be of assistance.

daviessd:
This will also make me much more wary of buying clones but I am still not in a position to spend £20 on a Arduino Mini, which is currently my go to board for non wifi apps.

Just an FYI, since the Arduino Mini doesn't have an on-board USB to serial adapter, there is no way a VID/PID can be associated with the board. The external USB to serial cable or module will be using a general purpose chip (e.g., FTDI FT232, CH340, CP2102, PL2303), with the manufacturer-supplied VID/PID. So the situation with this board will be the same as for your Nano clone and ESP32 board (that is, the convenience automagic board detection features of Arduino CLI won't work, but the essential features will work just fine).