Pages: [1]   Go Down
Author Topic: Serial monitor works in terminal but not in IDE  (Read 600 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I start the Arduino IDE in a terminal window (Fedora smiley-cool and then click on the Serial Monitor icon, the data being generated by the program running in the Diecimila board shows up properly in the terminal screen from which the IDE was initiated.  The data does not show up in the black space at the bottom of the IDE.

If I run the IDE as a freestanding GUI (not calling it from a terminal window) the Serial Monitor turns yellow to indicate it's working, but no data returned from the board shows up in the terminal space at the bottom of the IDE.  I know data is being returned from the blinking of the Tx LED on the board, and because the program has not been changed when switching from terminal initiation to GUI initiation.

The program:

/*
 * CountandBlink
 *
 */

int ledPin = 13;                // LED connected to digital pin 13

void setup()                    // run once, when the sketch starts
{

  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  Serial.begin(115200);           // set up Serial library at 115200 bps
  Serial.println();
}

void loop()                     // run over and over again
{
     for (int i=0; i <= 10; i++){
      Serial.println(i);
      // delay(100);
        digitalWrite(ledPin, HIGH);
        delay(20);
        digitalWrite(ledPin, LOW);
        delay(50);
   }
  
}


Ideas??

Yes - the baud rate on the monitor screen is set at 115200.
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try a lower baud rate, start with 19200 and then work upwards
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good idea - no dice, switched to 1200 - results exactly the same - terminal fine, IDE shows nada.
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very odd. I had a similar problem trying to use the IDE Serial Monitor at 115k baud which worked ok at lower baud rates, sorry to hear that didn't fix it for you.

Other things to try:

Try the example ASCII sketch (your sketch sends a cr as the first character and perhaps the IDE is doing something odd)    

Try the dimmer example sketch to see if you can send data to the board.

Try setting the IDE serial port to know good serial device and see if you can see that data.

Good luck
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Very odd. I had a similar problem trying to use the IDE Serial Monitor at 115k baud which worked ok at lower baud rates, sorry to hear that didn't fix it for you.

Other things to try:

Try the example ASCII sketch (your sketch sends a cr as the first character and perhaps the IDE is doing something odd)  

[size=12]Tried ASCII Table at 9600.  Same result calling terminal displays data, IDE will not. [/size]

Try the dimmer example sketch to see if you can send data to the board.

Try setting the IDE serial port to know good serial device and see if you can see that data.

[size=12]I am not sure what you mean by last two suggestions.  I use the USB port (/dev/ttyUSB0) to upload the program, and I can see the return in the terminal I use to call the Anduino IDE, so I know the port works bidirectionally.[/size]

Good luck
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

>>Try setting the IDE serial port to know good serial device and see if you can see that data.

I am suggesting a test of the IDE serial monitor code to see it has some problem accessing serial services. I am guessing that the executable code that handles the IDE serial monitor is not the same as the code that handles uploads and downloads to the board.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Strange.  When you upload a sketch, for example, do you see text in the black area at the bottom of the IDE?  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Strange.  When you upload a sketch, for example, do you see text in the black area at the bottom of the IDE?  

No.  But I do see this in the terminal from which the IDE was called:

Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Binary sketch size: 2320 bytes (of a 14336 byte maximum)

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One other interesting point:

The baud rate in the IDE window must be set to the same speed as defined in the serial setup, i.e. Serial.begin(115200); for the returns to be seen in the terminal window.  It's clearly the serial monitor in the IDE that is catching the returns.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So you never see any text in the black area at the bottom of the IDE?  Whether you run from the terminal or not?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So you never see any text in the black area at the bottom of the IDE?  Whether you run from the terminal or not?


Correct - there are never any characters displayed in the black window at the bottom if the IDE.  If I run the IDE as a GUI by simply clicking on it and then on "Run" the only thing I see on the screen is the IDE.

I can upload a program to the Arduino board and run it via the IDE, but there is never any information displayed in IDE Serial Monitor during the upload or after turning on the Serial Monitor..  I know the app is actually running by looking at the blinking LED on pin 13 which is being turned on and off by the app.

I can also start the IDE by clicking on it and then on "Run in Terminal".  Now when I turn on the Serial Monitor, the data returned by the app on the Arduino board  starts flowing in the terminal window that was used to call the IDE, but not in the IDE Serial Monitor window.
Logged

Pages: [1]   Go Up
Jump to: