Problem: can't print to the serial monitor, it appears that the serial monitor disconnects itself after uploading a program.
I'm brand new to arduino, and I'm trying to upload a basic program to print to the serial monitor.
I use an arduino uno and my OS is Ubuntu. I am connecting the arduino to my PC via USB. Using Arduino Studio Release 0.0.5 experimental build 0.0.5-16058
(I am able to communicate via the digital output pins, tested by making a simple circuit to make the led light blink)
Here is the program:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print("test");
delay(500);
}
Here is the result of the build, look at the last line and it says the serial monitor was disconnected? Why would this happen automatically?
[2/2/2016 8:51:26 PM] - Start Building
[2/2/2016 8:51:26 PM] - CPP File Created [/tmp/build1454471486915/test.cpp]
[2/2/2016 8:51:26 PM] - test.cpp compiled
[2/2/2016 8:51:26 PM] - CDC.cpp compiled
[2/2/2016 8:51:27 PM] - HID.cpp compiled
[2/2/2016 8:51:27 PM] - HardwareSerial.cpp compiled
[2/2/2016 8:51:27 PM] - HardwareSerial0.cpp compiled
[2/2/2016 8:51:27 PM] - HardwareSerial1.cpp compiled
[2/2/2016 8:51:27 PM] - HardwareSerial2.cpp compiled
[2/2/2016 8:51:27 PM] - HardwareSerial3.cpp compiled
[2/2/2016 8:51:27 PM] - IPAddress.cpp compiled
[2/2/2016 8:51:27 PM] - Print.cpp compiled
[2/2/2016 8:51:27 PM] - Stream.cpp compiled
[2/2/2016 8:51:27 PM] - Tone.cpp compiled
[2/2/2016 8:51:27 PM] - USBCore.cpp compiled
[2/2/2016 8:51:27 PM] - WInterrupts.c compiled
[2/2/2016 8:51:27 PM] - WMath.cpp compiled
[2/2/2016 8:51:27 PM] - WString.cpp compiled
[2/2/2016 8:51:27 PM] - abi.cpp compiled
[2/2/2016 8:51:27 PM] - hooks.c compiled
[2/2/2016 8:51:27 PM] - main.cpp compiled
[2/2/2016 8:51:27 PM] - new.cpp compiled
[2/2/2016 8:51:28 PM] - wiring.c compiled
[2/2/2016 8:51:28 PM] - wiring_analog.c compiled
[2/2/2016 8:51:28 PM] - wiring_digital.c compiled
[2/2/2016 8:51:28 PM] - wiring_pulse.c compiled
[2/2/2016 8:51:28 PM] - wiring_shift.c compiled
[2/2/2016 8:51:28 PM] - CDC.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - HID.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - HardwareSerial.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - HardwareSerial0.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - HardwareSerial1.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - HardwareSerial2.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - HardwareSerial3.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - IPAddress.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - Print.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - Stream.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - Tone.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - USBCore.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - WInterrupts.c.o linked to core.a
[2/2/2016 8:51:28 PM] - WMath.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - WString.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - abi.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - hooks.c.o linked to core.a
[2/2/2016 8:51:28 PM] - main.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - new.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - test.cpp.o linked to core.a
[2/2/2016 8:51:28 PM] - test.ino linked to core.a
[2/2/2016 8:51:28 PM] - wiring.c.o linked to core.a
[2/2/2016 8:51:28 PM] - wiring_analog.c.o linked to core.a
[2/2/2016 8:51:28 PM] - wiring_digital.c.o linked to core.a
[2/2/2016 8:51:28 PM] - wiring_pulse.c.o linked to core.a
[2/2/2016 8:51:28 PM] - wiring_shift.c.o linked to core.a
[2/2/2016 8:51:28 PM] - test.cpp.elf linked to core.a
[2/2/2016 8:51:28 PM] - test EEPROM
[2/2/2016 8:51:28 PM] - test.hex builded
[2/2/2016 8:51:28 PM] - Uploading...
[2/2/2016 8:51:30 PM] - Uploaded
[2/2/2016 8:51:30 PM] - [arduino ide - serial monitor] Serial monitor connected to /dev/ttyACM0
[2/2/2016 8:51:36 PM] - [arduino ide - serial monitor] Serial monitor disconnected from /dev/ttyACM0
-
Are you using the Arduino IDE? If so, what version? If not, what are you using?Nick Gammon– Nick Gammon ♦2016年02月03日 04:44:55 +00:00Commented Feb 3, 2016 at 4:44
-
Yes, ArduinoStudio Release 0.0.5 experimental build 0.0.5-16058James Wierzba– James Wierzba2016年02月03日 04:50:13 +00:00Commented Feb 3, 2016 at 4:50
-
Does the serial monitor disconnect when you hold open the monitor and after that hold the reset button?Avamander– Avamander2016年02月03日 20:08:12 +00:00Commented Feb 3, 2016 at 20:08
1 Answer 1
I'm not sure why your IDE is doing that, but the official Arduino IDE from Arduino.cc works on Ubuntu and does not have that issue. Download from Arduino Software download page.
-
I thought arduino studio was the official IDE, I'll download it and try it when I get home. Thank you for the suggestionJames Wierzba– James Wierzba2016年02月03日 14:53:13 +00:00Commented Feb 3, 2016 at 14:53
-
@JamesWierzba "Arduino Studio" is from Arduino.org, whereas this answer links to the standard IDE produced by Arduino.cc. Neither is more official than the other; the original Arduino company split into two factions and are now offering competing products and software.CharlieHanson– CharlieHanson2016年02月03日 18:16:42 +00:00Commented Feb 3, 2016 at 18:16
-
I edited my answer to clarify that I was referring to the version from Arduino.cc. Arduino.cc has a forum where you can ask questions like that. Arduino.org does not appear to have a forum (as far as I can see).2016年02月03日 19:40:55 +00:00Commented Feb 3, 2016 at 19:40
-
I downloaded the Arduino IDE you suggested and printing to the serial monitor now works. ThanksJames Wierzba– James Wierzba2016年02月04日 14:48:13 +00:00Commented Feb 4, 2016 at 14:48