QT App can't read serial without reset via Arduino Serial Monitor

Status
Not open for further replies.

DrewHamilton

New member
Hi All,

I have a QT Gui which autodetects a Teensy 4.0 and sets up a serial connection. I am having an issue in which my GUI tells me I am connected successfully via serial, but it isn't reading any new data. When this happens, I've found that I can open the Arduino Serial Monitor and that seems to "reset" the Teensy. If I close out the serial monitor and restart my GUI, I can successfully connect and read the data coming in. I could be way off here, but it seems like the Arduino Serial Monitor is either resetting the Teensy or setting up the RS232 connection in a way that QT can then get through to it.

My hypothesis at the moment is that the Arduino Serial Monitor is doing something with RTS/DTR or flow control (which I am a little shaky on), which resets the Teensy. I would like to be able to do this as well from my QT application, as the Teensy seems to be hanging on something (but only when I use QT).

I have attached the full INO file to conform to forum rules, but attaching all of the QT Application would just be too much, so I've attached the serialport.cpp portion.

Any help would really be appreciated.

Best,
Drew Hamilton
 

Attachments

  • Virus_Board_REV2_Gain_Control.ino
    4.6 KB · Views: 54
  • serialport.cpp
    10.2 KB · Views: 68
Which operating system are you using?

On Linux, a common issue is default to unix line discipline rather than raw mode.

On Windows (all versions) a potential problem happen if your code on Teensy waits with "while (!Serial)" and you don't raise DTR.

On Windows 7 (and all pre-10 versions) there is a driver bug which strikes if you have previously uploaded code or unplugged the USB cable while your program had the COM port open.
 
I am using Windows 10.

Urg. I've added a DTR(true) after opening my serial connection in QT and, for the time being, I am not having issues. I have a bad feeling this will come back once the issue is closed, but for now I can't seem to reproduce the problem so I can only thank you for your time. ;)

Also, thank your for your incredible contributions to open-source, open-hardware everything.

Best,
Drew
 
Status
Not open for further replies.
Back
Top