1

I have a MKS GEN L v1.0 3dprinter board that works fine uploading using the IDE. But I need to install to it using the arduino-cli.

For some reason, the command arduino-cli board list says that the board has an unknown FQBN. Which is fine, I guess. I guess I don't know how to compile & upload without the FQBN.

The options I need selected (which work in the IDE) are:

  • Board: Arduino/Genuino Mega or Mega 2560
  • Processor: ATmega2560
  • Programmer: AVRISP mkII

I don't understand why these options aren't clearly available in the arduino-cli.

I ran these commands: arduino-cli core install arduino:avr and arduino-cli core install arduino:megaavr

I ran arduino-cli board list. It says /dev/ttyUSB0, serial, Serial Port (USB), "Unknown" for FQBN....

I run arduino-cli compile Marlin. It says "unknown FQBN".

So how do I install using the same parameters in the IDE?

4
  • did you install the AVR boards package in CLI? IDE has the AVR boards package bundled in the installation folder, but the CLI doesn't use it from there
    – Juraj
    Commented Jun 26, 2023 at 11:52
  • I did run : arduino-cli core install arduino:avr and arduino-cli core install arduino:megaavr... Is there something else I should do? Commented Jun 26, 2023 at 12:03
  • and what CLI command do you run at what is the output exactly? (add it to the question)
    – Juraj
    Commented Jun 26, 2023 at 12:35
  • Ok I added it... Commented Jun 26, 2023 at 14:13

1 Answer 1

3

I would guess, that the arduino-cli doesn't recognize your boards FQBN, since it is not a genuine Arduino board. My Arduino Nano clones (with the CH340 USB-Serial-chip) aren't recognized as Arduino Nanos either. For me that's the same with the Arduino IDE.

Though, since you already know what board you have, you can find the FQBN yourself by looking through the list in the output of

arduino-cli board listall

or if you want to narrow the list down a bit:

arduino-cli board listall avr

There you will find the line with the Megas FQBN:

Arduino Mega or Mega 2560        arduino:avr:mega

Then you need to know, which Serial interface/COM port your Arduino has. This is done analog to the Arduino IDE: Check the list of connected boards via

arduino-cli board list

If you cannot identify it directly from the list, you might want to disconnect and connect it again, to see, what entry in this list reappears again.

Then compile and upload can be done like this (be sure to input your own COM port/Serial interface, if it differs from this):

arduino-cli compile --fqbn arduino:avr:mega
arduino-cli upload --fqbn arduino:avr:mega --port /dev/ttyUSB0

while being in the sketch folder.

1
  • Thank you... I have been searching for an answer to this for years... It is not clear the "FQBN" would be the same as that sub menu in the IDE Commented Jun 26, 2023 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.