Serial comm isssue.

Status
Not open for further replies.

WMXZ

Well-known member
Now, I have a weird problem,
System Win10 Arduino1.8.3 TD1.38b3. Teensy3.6, 96 MHz, faster

Simple blink program with wait for Serial and serial printout in loop


Code:
void setup() {
  // put your setup code here, to run once:
  pinMode(13,OUTPUT);
  while(!Serial){digitalWriteFast(13,!digitalReadFast(13));delay(1000); }
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("loop");
  delay(1000);
}

expected behavior: slow blink until Serial connection and then continuously print out
using Arduino Monitor, all OK
using puttytel, all OK

so far so good
As I wanted to program a standalone Serial interface, I tried the QT terminal example.
I used that in the past as starting point to a couple of Serial interface programs.
It always worked, but now some strange things are happening

connection succeeds (at least the terminal program says so)
BUT teensy continues blinking, also it does NOT see the Serial connection.
Once I close the Terminal connection (the program says disconnected), Teensy stops blinking.

QT terminal does not show anything anymore
BUT arduino monitor puttytel, once connected, give me the loop printouts
So indeed Teensy program detected Serial line

For the record:
Qt Creator 3.2.2 (opensource)
Based on Qt 5.3.2 (MSVC 2010, 32 bit)
Built on Oct 10 2014 at 11:19:03

Now, I understand that this is very difficult to debug, as there are multiple objects
(usb-serial, win10-usb-serial, qt-serialport library)

However, if there is someone with QT (koromix are you reading?) and willing to falsify/verify observed behaviour, that would be helpful.
 
Only obvious thing would be user error as I've done this: Is the 'Serial' icon 'clicked' and highlighted blue as active?
 
Only obvious thing would be user error as I've done this: Is the 'Serial' icon 'clicked' and highlighted blue as active?

The message shows up in status line according to
Code:
    if (serial->open(QIODevice::ReadWrite)) {
            console->setEnabled(true);
            console->setLocalEchoEnabled(p.localEchoEnabled);
            ui->actionConnect->setEnabled(false);
            ui->actionDisconnect->setEnabled(true);
            ui->actionConfigure->setEnabled(false);
            ui->statusBar->showMessage(tr("Connected to %1 : %2, %3, %4, %5, %6")
                                       .arg(p.name).arg(p.stringBaudRate).arg(p.stringDataBits)
                                       .arg(p.stringParity).arg(p.stringStopBits).arg(p.stringFlowControl));
    } else {
        QMessageBox::critical(this, tr("Error"), serial->errorString());

        ui->statusBar->showMessage(tr("Open error"));
    }
Also comport and com characteristics are "COM3,9600,8,None,1,None" which seem to be good to me
 
problem narrowed
(I had a forgotten edit of the stock example that did not allow all read data to be printed out)

updated situation:

run Qt example terminal
open com port: nothing happens on Teensy
close com port: teensy recognizes Serial and exits setup()
open com port again: read now teensy print outs
 
Status
Not open for further replies.
Back
Top