IDE - Serial monitor should stay open

Hi!

I would like to suggest that it would be way easier for debugging purposes within the arduino IDE to let the serial monitor open when uploading a new sketch. It is very annoying to reopen the serial monitor again and again.

Here is the discussion in another forum with some ideas: http://arduino.cc/forum/index.php/topic,66219.0.html

One idea would also be to give the user the possibility to dock the serial monitor to the IDE where she/he likes (eg. left, right etc.)

I think that would make a few people happy! :)

Other than that: The Arduino project is very very very cool! :)

asuryan: Hi!

I would like to suggest that it would be way easier for debugging purposes within the arduino IDE to let the serial monitor open when uploading a new sketch. It is very annoying to reopen the serial monitor again and again.

There is a technical reason why it does not. Modern OS's - Especially Windows lock the serial port when it is in use and thus cannot be used for uploading. You can prove this by using a different serial monitor like PUTTY when uploading. The upload will fail.

Thanks for your attention! :)

Then the serial monitor could check that flag every second (or something like that) and grab control back when the upload is complete.

Yes something like that!

Well Im not really good in programming I have just a basic understanding for this stuff so please dont be hard to me when I do not really understand what you are talking about... ;)

But the "Serial monitor" is just a visual representation of the "Serial port" right!? When it is possible to programmatical visually open the "Serial monitor window" --> Button press --> show the window --> open the serial port, then there must be functions to do so! :)

Something like this pseudo code:

function serialMonitorBtn_press(){
      serialWindow.showWindow():
      serialPort.openConnection(serialWindow);
      serialWindow.wasVisible = true;
}

function uploadBtn_press(sketch){
     if(serialWindow.wasVisible == true){
               serialPort.closeConnection(serialWindow);
     }
     //
     serialPort.openConnection(arduino);
     serialPort.uploadSketch(sketch);
     serialPort.closeConnection(arduino);
     //
     if(serialWindow.wasVisible == true){
               serialPort.openConnection(serialWindow);
     }
}

If even that does not work maybe bruteforce it: The IDE reports to the user interface: "Done uploading" so there must be a function that returns the state of the upload process. Inside the function that returns that could be:

function done(){
      userInterfaceText = "Done uploading"
      //Why not add this tiny lines of code to reopen the window again? :)
      if(serialWindow.wasVisible == true){
              serialMonitor.showWindow(); //again!
      }
}

--> There has to be some structure like that because it is also possible to programmaticly close the window when the upload button is pressed! <-- So the window opens without the need of pressing the button because the showWindow function must exist! :)

Maybe this is totally bruteforce and I dont really understand what you are saying but this is what I personnally thought of. :) Im NOT talking about opening 2 serial connections to the arduino!! With this approach there must only one all the time but programmatical it must be possible to open, close the serial port AND let the visual representation of the serial port (the serial monitor) persist and give the conncection back to it when done. When it is not possible... well I have to Autohotkey myself a little script (yep, bruteforce approach) to do so... ;)

Maybe Im totally wrong and really dont understand how the IDE software works so please bear with me if I dont understand you... ;)

Ok... I got it. Too bad... :( (maybe programmatical open and close the window/port after upload? ;) ) Maybe in the future there will be an option! Thanks for your time! :)

maybe programmatical open and close the window/port after upload?

This is a feature on the Wiring IDE (which can program Arduino boards) - The Arduino team seems a bit slow on the uptake of ideas as this has been suggested many times before.

When I work on the IDE, I watch for the upload icon to change color and clear, then I hit the Serial monitor button.

What if there was a menu item/checkbox "open serial on upload"? Then, the program did the Serial monitor opening right after it clears the icon (in effect, just clicking that button for me)? And if I uncheck the menu option, I'll have to do that manually in the future. If the default was manual, then newer users wouldn't run into it be accident.

Yep, I imagine that would take about 20 minutes or less to implement auto opening/closing of the serial monitor if you were up to speed with the IDE java code. And people have been asking for something similar for at least as long as I've been on this forum.

To be fair I guess there are more important things to do and a limited number of people to do them.


Rob

Graynomad: To be fair I guess there are more important things to do and a limited number of people to do them.

Like autosave and upload without compiling. I have never thought that opening the serial monitor was much of a bother.

KE7GKP: How do you "upload without compiling"? The output of the compiler is what gets uploaded. The Atmel chip does not understand C in any of its forms or variations (like Arduino).

He probably means direct uploading of a sketch's intel hex file made from a prior verify or upload. The older versions of the IDE use to save a copy of the hex file in the sketch folder, but that 'feature' went away and new versions delete the hex file when you close the IDE. There was never an option to be able to upload directly from a hex file but many had asked to have that feature. I would certainly like to at least see the return of saving the hex file into the sketch folder as I found a nice little standalone windows GUI interface that can drive AVRDUDE to upload a hex file.

Lefty

To be fair I guess there are more important things to do and a limited number of people to do them.

Like I said - it's been implemented in the Wiring IDE (as well as a progress bar for compiling/uploading) so no doubt Arduino will nab it from there at some point.

smeezekitty:

asuryan: Hi!

I would like to suggest that it would be way easier for debugging purposes within the arduino IDE to let the serial monitor open when uploading a new sketch. It is very annoying to reopen the serial monitor again and again.

There is a technical reason why it does not. Modern OS's - Especially Windows lock the serial port when it is in use and thus cannot be used for uploading. You can prove this by using a different serial monitor like PUTTY when uploading. The upload will fail.

This is not technically correct. Most modern OS's do allow multiple opens of the same file/device. It is not the OS that locks the port. It is the Application that requests the OS to lock it by requesting exclusive access to the file/device. The applications could just as easily not ask for exclusive access of the port when they open the port which would allow multiple applications to have the port open simultaneously. If avrdude and the IDE didn't ask for exclusive use of the port, then the IDE could keep the port open while avrdude opened it and used it and then the IDE could start using it again (reading it) once avrdude finished and exited.

In fact in a unix OS, you could also fork a child process and the child could be handed a port that was already opened.

--- bill