Arduino-cli upload waittime

Hello!
If uploading a bin file the cli waits about 30sec before uploading.

I compile my project for a MEGA2650 with arduino GUI 1.8.15by using
Menu -> scetch -> export compiled binary
on my laptop.

Then I transfer this file to an raspberry via sshfs.
On raspberry, I upload these file by using CLI.

arduino-cli upload -i project.ino.mega.hex --port /dev/ttyACM0 --fqbn arduino:avr:mega --verbose

It works pretty well, but...

Between starting the command and actually uploading, CLI waits about 25 seconds.
Why???
All paths (cli + bin file) are absolute in real, port is the right one, board too.

Thank you.

Hello smaldiyer

It's normal for the CLI to take a few seconds before actually uploading the binary file. This is because the CLI needs to initialize the board and establish a connection with it before the upload can begin. The delay can also depend on the board you're using and the speed of your computer's serial port.

In your case, the delay seems to be around 25 seconds, which is a bit longer than usual. There could be a few reasons for this, such as a slow serial connection or a large binary file that takes longer to transfer. It's also possible that there is some other process running on your Raspberry Pi that is causing the delay.

To investigate the issue further, you can try running the upload command with the "--verify" flag to see if that makes a difference. You can also try connecting to the serial port manually and sending some commands to see if there is any delay in the response.

I hope this helps! Let me know if you have any other questions.

Before starting the upload, Arduino CLI must initialize by reading the configuration of the boards platforms and their installed tools. The time required to do that depends on how many boards platforms you have installed and the performance of the computer. The Raspberry Pi, especially the lower spec ones, are not so powerful so you will experience a longer initialization time on these computers.

If you would like to eliminate the initialization time, you can run the avrdude upload command directly. You will see the avrdude command generated by Arduino CLI in the output from running your arduino-cli upload command. You can copy and paste that command.

@apkbgmi @ptillisch
Thank you for your quick reply.

I will try '--verify' but I think your explanation hits the problem.
I use the Raspberry as an gateway to program my boards on the roof and in the cellar. So I installed ALL boards I use in my house and the initialization time seem therefor to be "long".

I will switch (back) to avrdude in my programing bash script. Some time ago I already used avrdude in my script, but changed to CLI when I stumbled over it by searching for compiling without GUI.

So thank you all!!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.