When using the Arduino IDE on Windows (10) is there a way to get it to start the serial monitor automatically when the upload to the board completes?

I know this is a long shot, but pressing those extra 3 keys (CTRL-SHIFT-M) is really bugging me.


You could set up a macro triggered by the completion of the upload that automatically sends ctrl+shift+m. This could be done by watching for the exit of the upload application(AVRDUDE for example) or by calling a wrapper batch file from platform.txt's upload.pattern/program.pattern that runs the upload application and then triggers the Serial Monitor keyboard shortcut. There are a variety of Windows software options for doing this. EventGhost is the one I'm most familiar with but AutoHotkey could likely do it also.

To do it with EventGhost you would either:

  • Install the Process Watcher plugin and use, for example, the Process.Destroyed.avrdude event to trigger the Serial Monitor keyboard shortcut using the Send Keystrokes action. This will cause false triggers on Burn Bootloader but you can get around that issue by identifying uploads by the compilation application events(such as Process.Destroyed.arduino-builder) that will not occur with Burn Bootloader.
  • Run EventGhost.exe from the wrapper batch file with the -e command line option to generate the trigger event.

I think the first option is the best because it doesn't require modifying platform.txt, which will need to be redone on every update of any hardware core.

Not exactly what you're asking for, but a much more simple solution is to use Arduino IDE 1.6.5 or newer, which leaves the Serial Monitor open(but disabled) during uploads. This means you only need to load Serial Monitor once. You could have both the Arduino IDE window and the Serial Monitor window tiled on your screen so that you don't need to switch screens to go from editing/uploading your sketch and using Serial Monitor.

| improve this answer | |
  • thats more complicated then clicking CTRL+SHIFT+M – Dat Ha Oct 26 '16 at 22:31
  • @canadiancyborg of course it's more complicated. Any solution will be more complicated to initially set up than pressing three keys. Maybe there's a better answer but this is the one I know and have used to automate similar processes related to Arduino development. – per1234 Oct 27 '16 at 3:25
  • OK Three keys doesn't seem so bad now. I'll keep this because I'm sure I'll find a use for it on another binge of laziness. – Code Gorilla Oct 27 '16 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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