Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Serial monitor doesn't work unless project open (Read 10317 times)
DC
Newbies
*
Offline


Posts: 9
Joined: Nov 11th, 2015
Serial monitor doesn't work unless project open
Nov 13th, 2015 at 11:05pm
Print Post  
Hi,

I've notice that the serial monitor does not "monitor" unless a sketch or project is open in the IDE. Often I will launch VS just to check on the status of a board/sketch left running overnight.

This behavior is not exhibited in the Arduino IDE which will serial monitor a COM port without a sketch loaded.

Is this behavior by design, limitation or bug?

Thanks,
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial monitor doesn't work unless project open
Reply #1 - Nov 13th, 2015 at 11:37pm
Print Post  
Hi,

It monitors okay for me regardless of a project being open. 

Can you confirm the correct port is selected and send a screen shot of the serial monitor open wide enough to see the options that are selected from "connected" to "speed"?

Thanks
  
Back to top
IP Logged
 
DC
Newbies
*
Offline


Posts: 9
Joined: Nov 11th, 2015
Re: Serial monitor doesn't work unless project open
Reply #2 - Nov 14th, 2015 at 12:03am
Print Post  
Tim,

I've no clue what I did and it had to be me because it's working now. 

Thanks,
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial monitor doesn't work unless project open
Reply #3 - Nov 14th, 2015 at 12:18am
Print Post  
Great. 

Maybe the "connect" button had been unchecked or baud was wrong.

Anyway good to hear its working, let me know if it doesn't.

Thanks
  
Back to top
IP Logged
 
DC
Newbies
*
Offline


Posts: 9
Joined: Nov 11th, 2015
Re: Serial monitor doesn't work unless project open
Reply #4 - Nov 14th, 2015 at 12:20am
Print Post  
Tim, 

I take that back. I just switched from my Uno to the Yun, changed serial ports and launched the serial monitor (see attached jpg). The sketch running is indeed sending data to the serial port, verified by the Arduino IDE's serial monitor.

??
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial monitor doesn't work unless project open
Reply #5 - Nov 14th, 2015 at 12:33am
Print Post  
Okay, a few questions to try to narrow things down. I can't see it being connected to the selected board.

  • If you click "connect" so that it disconnects then click again to connect, do you see any output or an error
  • Does the problem happen if you use "View>Other Windows>Arduino Port Monitor"?
  • Are there any new line chars in the expected output (serial.println() or \n)?


Thanks
« Last Edit: Nov 14th, 2015 at 12:33am by Tim@Visual Micro »  
Back to top
IP Logged
 
DC
Newbies
*
Offline


Posts: 9
Joined: Nov 11th, 2015
Re: Serial monitor doesn't work unless project open
Reply #6 - Nov 14th, 2015 at 12:37am
Print Post  
Tim,

Here is a screen grab of the Uno. All I did was switch boards and ports then launch the serial monitor. It works. Switching to the Yun and no serial output is shown.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial monitor doesn't work unless project open
Reply #7 - Nov 14th, 2015 at 12:48am
Print Post  
Ah you are switching port? I thought when you said switch board you meant just using the toolbar but you actually have two different boards connected.

First off please answer the three questions in my previous post. 

Then do the following:-

Select the Yun port
Close the ide
Reopen the ide
Open the serial monitor

any data?

If no do this

Switch on Dtr
Uncheck and recheck Connect

any data?

If no, close the serial monitor and then re-open.

any data?

The idea is to take the Uno out of the equation so we can have a clean view of the connection to the Yun

  
Back to top
IP Logged
 
DC
Newbies
*
Offline


Posts: 9
Joined: Nov 11th, 2015
Re: Serial monitor doesn't work unless project open
Reply #8 - Nov 14th, 2015 at 12:59am
Print Post  
Tim,

I followed your steps and didn't get any data until after

Switch on DTR
Uncheck and recheck Connect


Then I started seeing output
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial monitor doesn't work unless project open
Reply #9 - Nov 14th, 2015 at 1:22am
Print Post  
Okay please leave dtr on. It should have been on by default anyway. The arduino ide has dtr always on.

Q: With dtr on can you confirm Visual Micro reliably shows the serial output in all situations?

I have to remind myself of the difference between Uno and Yun/Leonardo.

Q: Does your Yun code have while(!Serial){} in the Setup() or does it not use Serial if no Serial was detected during Setup?

Thanks
  
Back to top
IP Logged
 
DC
Newbies
*
Offline


Posts: 9
Joined: Nov 11th, 2015
Re: Serial monitor doesn't work unless project open
Reply #10 - Nov 14th, 2015 at 1:31am
Print Post  
Tim,

1. I've restarted the IDE several times and switched back to the UNO, even plugged a Mega 2560 into the mix. They all are now reliably working with the serial monitor.

2. There is no while(!Serial) in the sketch. I'm not sure I understand "does it not use Serial if no Serial was detected"
I don't do any checking for Serial status if that's what you are asking. I've kind of pieced several sensor sketches to together.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial monitor doesn't work unless project open
Reply #11 - Nov 14th, 2015 at 1:54am
Print Post  
Hi,

Great.

As far as I recall the Yun is a Leonardo type of board. They normally have a while(!Serial){} wait or a delay of a couple of seconds before they are allowed to progress through the Setup() method. 

This is because the usb port and Serial are handled by a more flexible type of "virtual/dynamic" Serial port. The Serial object is only created when a device connects to the port so if Serial is to be used some checks should be made.

I am still not entirely clear about why connecting without causing a reset should fail considering we know the mcu had been reset by the arduino ide in many of your tests.

When I get a mo I will, for my own sanity, have a play and try to understand what happens without a reset (dtr). It might be that the Leonardo detects a port close and frees the serial. 

Maybe you can blink the led but leave the serial print statements working as they have been. See if the arduino carries on running when you disconnect the serial. Does the led continue to blink? 

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint