Can we add a timestamp on when the code was uploaded successfully on the terminal?
Closed this issue · 1 comments
Describe the request
When a code has successfully uploaded to the MCU, a time and date should also show when that happened, based on the host time. It will help debugging at times.
Describe the current behavior
Code uploads and some verbosity is provided, but no time.
Arduino IDE version
2.3.5
Operating system
Windows
Operating system version
11
Additional context
No response
Issue checklist
- I searched for previous requests in the issue tracker
- I verified the feature was still missing when using the latest nightly build
- My request contains all necessary details
Hi @alexceltare2. Thanks for your suggestion. This seems to be a very niche requirement so I think it will be better to implement the capability in your system's configuration. Fortunately the Arduino boards platform framework already provides the capability to run arbitrary commands during the compilation and upload process:
Although we normally define these on a per-platform basis, it is also possible to define hooks globally so that it will run regardless of which board is selected:
https://arduino.github.io/arduino-cli/dev/platform-specification/#platformlocaltxt
I'll provide instructions you can follow to do that:
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Take note of the path shown in the "Sketchbook location" field of the dialog.
- Click the "CANCEL" button.
The "Preferences" dialog will close. - Use your file manager (e.g., Windows "File Explorer") to create a folder named
hardwareunder the folder at the path you saw in the "Sketchbook location" field of the "Preferences" dialog. - Start any text editor.
- Create a new text file.
- Add the following content to the text file:
# An arbitrary high index number is used to ensure the hook won't override one defined in the platform. recipe.hooks.objcopy.postobjcopy.99.pattern=date -Iseconds # The Windows `date` command only provides the date, so the Windows-specific `time` command is used if running on a # Windows machine. recipe.hooks.objcopy.postobjcopy.99.pattern.windows=cmd /C "time /t" - Save the text file with the filename
platform.txtinside thehardwarefolder you created at step 4. - Select Tools > Reload Board Data from the Arduino IDE menus.
- Wait until you see a notification appear at the bottom right corner of the Arduino IDE window:
Board data reloaded.
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
- Click the "OK" button.
The "Preferences" dialog will close.
You will now see a timestamp printed in the Output panel at the end of the compilation process when you have the verbose compilation output preference enabled.
If you have any problems or questions while following those instructions or using the system, just post over on Arduino Forum and we'll be happy to assist you: