Skip to content

CLI: upload returns 0 on failure with third party package #4127

Open
@marvinroger

Description

@marvinroger

I have a strange problem. I am using the Arduino CLI tu build a sketch. With an official board, calling arduino --upload --board arduino:avr:uno --port /dev/ttyUSB0 sketch.ino; echo $? does return 1 when the upload failed, and 0 when it worked.

But with a third party package (ESP8266), the above command with esp8266com:esp8266:nodemcuv2 always return 0, even on failure.

Digging in the code, I found out that the command exits with code 1 when success is false, which should be the case when the exit code of the upload command is different that 0. But the fact is the upload command from the ESP8266 package, which uses esptool, exits with a non-0 (255) value when the upload fails (I just tested manually). Still, arduino --upload exits with 0.

I really don't understand what is happening...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions