Hello. I wanted to share this fix i found out, which made me think how arduino IDE works.
Short question: Does Arduino IDE's Serial monitor unplugs and plugs the usb port programatically every time you click on it, before starting to listen to the port serial communication?
Long Question:
I recently started programming etmega328p on AVR-C on ubuntu. I do really good, and i upload whatever i do here: (Even tho i started on windows with atmel studio, i slowly moved to linux).
using linux, in order to debug my programs, i use serial monitor from arduino IDE. More specifically, i setup a serial communication on every program i make, so i can have an output to help me debug. This code in particular. Now, I see the output of this code, using the Serial Monitor of the Arduino IDE, which is not the mist professional way, but it works always.
I made an attempt yesterday to use a more professional solution and to see the serial using "sudo cat /dev/ttyUSB0" (or USB1,2,3.. depending the port). The thing is, it doesnt always works. It may work the first times i plug my atmega, upload the code and check the serial, but st some point it stucks. But after the first time it stucks, every time after that, i try to check the serial, i see nothing. Example below. On the third
`sudo cat /dev/ttyUSB0`
, i re-created the error, by trying to upload code to the device, while simultaneously checking the serial.
And, as you can see the `sudo cat /dev/ttyUSB0` doesnt work after that.
I found a solution, from here that worked, where is suggests unplugging and plugging the usb port programatically bedore executing `sudo cat /dev/ttyUSB0`.
Now, whenever i used Arduino IDE's serial, i never ever had this issue. This made me think, how does arduino IDE's serial monitor work? does it unplug and plug programatically the usb every time i click on it? Should i ask about that the arduino forum?