Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: Anyone else seeing Serial problems with 3.5 recently?

  1. #1
    Junior Member
    Join Date
    Dec 2017
    Posts
    4

    Anyone else seeing Serial problems with 3.5 recently?

    Short Version.

    I can't get Serial out text to the serial monitor unless I first upload code and have a couple of delays inserted.

    Anyone else seeing this or is it just me?

    Related info.
    Windows 10, (just patched this morning)
    Teensy Loader 1.40
    Arduino 1.8.5
    Teensy 3.5

    Code snippit

    void setup() {

    delay(1000);
    Serial.begin(9600);
    delay(1000); // necessary for Serial to work

    Serial.println("Tone Out Version:06.3");
    .
    .
    .

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,104
    This isn't entirely new or uncommon. Update to Windows may have made a change in the timing? Try the code below.

    Code:
    void setup() {
      Serial.begin(9600); 
      while ( !Serial && millis()<4000) ; // necessary for Serial to allow time for computer to see arriving port
      Serial.print("Tone Out Version:06.3 :: millis()==");
      Serial.println(millis());
    // ...
    }
    void loop() {
    }
    NOTE: using IDE SerMon the millis() printed was over 1900 after Upload. That is the time it takes the IDE time to see the upload complete and restart the Monitor and have the USB port recognized as online.
    Last edited by defragster; 12-13-2017 at 10:30 PM.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,023
    Quote Originally Posted by Monta View Post
    Anyone else seeing this or is it just me?
    Seems to work fine here, no delays in setup() or before printing the first output.

    Click image for larger version. 

Name:	capture.png 
Views:	20 
Size:	232.6 KB 
ID:	12273
    (click for full size)

    If you'd like me to try your code, rather than this simple test, you'll need to post the complete program so I can copy and paste it into Arduino and run it here.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,104
    That doesn't show count==0?

    My machine to a T_3.6 is taking 2000...2047 millis to leave "while ( !Serial && millis()<4000)" with above code when the IDE auto restarts the SerMon.

    I can watch 'Reboot OK' and fresh open SerMon and see it at 400-500 ms. Above is slower than I saw before when it was under 800 ms for SerMon restart.

    Without the !Serial wait the first print is lost.

  5. #5
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,457
    Please consider that after an update, Windows will still be heavily occupied in the background, cleaning up, recompiling .NET assemblies, and so on, for several hours or even for days.
    That’s why you should wait some time, letting your PC run these tasks and do a new compile/upload test after the resource monitor tells you that the system is definitively idling again which will most probably shorten the init time for the usb serial port.

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,104
    This Machine is quite idle and been rebooted at least once. The slowness is the programmatic restart of the IDE SerMon - lowest above code shows is 1997 millis on multiple tries. As noted manual clean start of SerMon is faster so the device is there and ready.

    This two second delay agrees with what @Monta saw in OP.

    Plugging it in fresh with above code gets this to TyCommander which is normal showing 8 repeats plugging it in - where 400ms is the programmed time to get to setup():
    Code:
    Tone Out Version:06.3 :: millis()==420
    Tone Out Version:06.3 :: millis()==419
    Tone Out Version:06.3 :: millis()==413
    Tone Out Version:06.3 :: millis()==421
    Tone Out Version:06.3 :: millis()==410
    Tone Out Version:06.3 :: millis()==421
    Tone Out Version:06.3 :: millis()==414
    Tone Out Version:06.3 :: millis()==411
    ** TyCommander version was old - note removed
    Last edited by defragster; 12-14-2017 at 01:03 AM.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,023
    I've also seen the 2 second lag on Windows. Mac and Linux seem to be much faster. I don't know why.

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,104
    Something in the IDE w/Win_10 I'd say - the transition from Reboot done to Re-Open of SerMon.

    Got the new TyCommander installed - and integrated to Arduino 1.85&w/1.90BLD fix and it runs perfectly. Reset or Upload and it is online in ~420 ms like it always has been. IDE as noted when we pushed down the start sleep before setup() was IIRC ~750 ms.

  9. #9
    Junior Member
    Join Date
    Dec 2017
    Posts
    4
    I'm getting times all over the place;
    typically 2000 -3500 with occasional "timeouts" (max millis in while conditional) although I remember seeing one 750 ms.

    Tone Out Version:06.5 :: millis()==4500 //[code below]

    I had rebooted a couple of times yesterday (after the windows 10 updates) and these are times from today.
    At least this should the (!Serial && millis...) should fix the problem.

    Thanks for the replies!

    Related question?
    When I hit the reset button on the Teensy 3.5 with the Serial Monitor up, I have to close it and restart it.
    (It doesn't automagically reconnect)
    Is that standard operating procedure?

    -Monta


    void setup() {
    Serial.begin(9600);
    while ( !Serial && millis()<4500) ; // necessary for Serial to allow time for computer to see arriving port
    unsigned long x=millis();
    Serial.print("Tone Out Version:06.5 :: millis()==");

    while(1) {
    Serial.println(x);
    delay(1000);
    }
    // ...
    }
    void loop() {
    }

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,023
    Quote Originally Posted by Monta View Post
    Related question?
    When I hit the reset button on the Teensy 3.5 with the Serial Monitor up, I have to close it and restart it.
    (It doesn't automagically reconnect)
    Is that standard operating procedure?
    Assuming Teensy Loader is still running and still in auto mode, and assuming it successfully uploads the code again and reboots your Teensy, then yes, the serial monitor is supposed to reconnect automatically.

    I just tested on Linux 64 bit (Ubuntu 14.04) and Windows 10 64 bit (version 1703 build 15063.786). It's not working on Windows. Works great on Linux.

    I'm pretty sure this worked on prior versions of Windows. Will put this on my list of issues to check.

  11. #11
    Junior Member
    Join Date
    Dec 2017
    Posts
    4
    Thanks Paul for your great support (and the Teensy product line BTW).

    I move across platforms a lot, various Linuxes (what is the plural of Linux? Lini? Linux?) and various Windows platforms 7, 8.1, 10,
    and I couldn't remember if the serial monitor autorestarted on Windows 10.

    I installed two updates yesterday, I suspect KB4054517 "Cumulative Update", (as opposed to KB4053577 Flash Player )
    Just FYI, in case it helps your future debug or other users.

    -Monta

  12. #12
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,104
    Quote Originally Posted by PaulStoffregen View Post
    Assuming Teensy Loader is still running and still in auto mode, and assuming it successfully uploads the code again and reboots your Teensy, then yes, the serial monitor is supposed to reconnect automatically.

    I just tested on Linux 64 bit (Ubuntu 14.04) and Windows 10 64 bit (version 1703 build 15063.786). It's not working on Windows. Works great on Linux.

    I'm pretty sure this worked on prior versions of Windows. Will put this on my list of issues to check.
    IDE SerMon has been Finicky on Windows after reprogramming since I started 2/2015 - including unplugging and re-plugging a Teensy - another reason I'm so stuck on TyCommander, for Windows it is basically 100% reliable for programming and reconnecting {plus added functionality of multiple Teensy Program and SerMon and reset GUI button}. I do try to suffer SerMon on updates at least a few times - and it seems to have been working well on Upload from IDE just 4-6 times slower to reconnect. But the latest TyComm 0.8.8 Release now back in place 'Tools / Integrated to Arduino' and as shown above connects with minimal wait after any restart. And AFAIK it worked for at least one MAC user that was having SerMon issues last week.

  13. #13
    Junior Member
    Join Date
    Dec 2017
    Posts
    4
    Thanks for the TyComm comments.
    I wasn't aware of the tool; but my current project is using multiple Teensy's (2 at the moment, perhaps 3 shortly), so this might be very useful.

    A quick look at it I'm getting ~480ms serial start times. (TyCommander 0.8.8)
    It won't automagically reconnect serial after a board button reset, but it does with the GUI reset button, which is sufficient.

    -Monta

  14. #14
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,104
    Quote Originally Posted by Monta View Post
    Thanks for the TyComm comments.
    I wasn't aware of the tool; but my current project is using multiple Teensy's (2 at the moment, perhaps 3 shortly), so this might be very useful.

    A quick look at it I'm getting ~480ms serial start times. (TyCommander 0.8.8)
    It won't automagically reconnect serial after a board button reset, but it does with the GUI reset button, which is sufficient.

    -Monta
    The board button will show Teensy in '(bootloader)' on TyComm? That button is not RESET but PROGRAM. It takes the Teensy OFFLINE awaiting code upload in HID mode.

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,023
    I've made a first beta release of an ambitious redesign of the Arduino serial monitor and ports menu. It's meant to solve these long-standing issues.

    https://forum.pjrc.com/threads/49831...no-1-42-Beta-1

    If you're still watching this thread and experiencing this problem, please give this latest beta a try. It's still a bit rough around the edges, as you can see from the known issues list. But it does already solve some of these problems, and my hope is to be able to fix every long-standing serial issue by the 1.42 release. Some of these problems only happen on certain computers or with specific setups, so I'm really depending on feedback.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •