Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 32

Thread: Teensyduino USB issue

  1. #1
    Junior Member
    Join Date
    Dec 2016
    Posts
    11

    Teensyduino USB issue

    Hello forum,
    I have here a couple of Teensy-LCs and ran into trouble recently on a single PC with the Arduino 1.6.12 IDE:

    First, it is not possible to upload a program using the 'upload' button of the IDE, only the hardware button on the Teensy-LC is working. I'm getting this error message:

    Found serial '\\.\COM6', but unable to open for reboot request
    Teensy did not respond to a USB-based request to automatically reboot.
    Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.


    Further, the Serial Monitor isn't working. I'm getting 'Port busy'.

    I've already seen at least one older post where one person had a similar problem, but no solution was there.
    As all is working very well on my other PC, I can exclude any hardware issues with the Teensy-LC.
    I also tried other USB cables and the same with and without USB hubs.

    Any ideas?
    Last edited by socke; 12-06-2016 at 02:52 PM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    This definitely looks like a software issue. Changing hardware is unlikely to matter.

    Maybe some other software on your PC is automatically opening and hogging the COM port as soon as Teensy reboots and reappears as a serial device?

    Please try setting Tools > USB Type to MIDI or RawHID or anything else without serial. In those modes, Teensy emulates a serial connection using HID protocol. It's not as fast, limited to approx 64 kbytes/sec speed. If this mode works, you can be pretty sure some other software on your PC is interfering.

    This question comes up from time to time, and non-serial usage almost always "solves" the issue. I can't recall anyone who's ever managed to definitively track down what other program(s) were causing the issue. If you do, please post a followup here. It could really help others who hit this problem.

  3. #3
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    It is working for the automatic upload, if I select another protocol. But the behavior of the Serial Monitor is unchanged (which hurts me most)...
    Last edited by socke; 12-06-2016 at 07:23 PM.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,842
    There is some active software on the computer controlling the COM6 on the computer preventing the IDE from 'owning' or attaching to that port. The OS isn't noted but here is what I can see on Windows 10

    I see these messages recently now when I have a known Serial monitor 'owning' the connection to one Teensy when I wanted the IDE to see and control the other Teensy.

    This port is being controlled by - in my case TYQT and the IDE reports (as expected) this when I try to connect SerMon to it:
    Error opening serial port 'COM17'. (Port busy)
    TYQT is monitoring COM17 on purpose to allow Teensy Access only to COM3 - where I have TYQT selected to NOT monitor COM3.

    When the IDE has COM3 open with SerMon and I attempt to UPLOAD I get this:
    Found serial '\\.\COM17', but unable to open for reboot request
    Found serial '\\.\COM3', but unable to open for reboot request
    Teensy did not respond to a USB-based request to automatically reboot.
    Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
    If I close IDE SerMon on COM3 Teensy can then UPLOAD to the target COM17 but still reports this:
    Found serial '\\.\COM17', but unable to open for reboot request
    >> These results from two active Teensy units on the computer - and Teensy.exe will necessarily see one 'first' and try to program that one - The above is to HIDE the 'first' Teensy 3.0 from Teensy.exe so it won't accidentally try to push code for the T_3.6 to it. To avoid the above in this situation the solution is to only do IDE VERIFY and then BUTTON PRESS the desired Teensy to program it.

  5. #5
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    I did some more investigations using a small tool called ComMonitor V 1.0.
    I found, that the virtual COM Port of the Teensy is getting locked immediately as it appears after plugging in the Teensy. But the strange thing is, that this happens only with the Teensy. I've never seen this with other COM adapters like FTDI and so on.

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,914
    I am assuming windows (which version?) as you talk about comm port and COM17.

    What I have done in the past when having some com port issues, is to go into windows and try to reclaim all of the comm ports I can. I have to look it up each time, but there is a way for the device manager to show devices even those that are not there, and then I go through and delete a majority of the comm ports. Then when I plug the Teensy in it goes through the process of assigning a new driver...

    Not sure if it would help here or not...

  7. #7
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    Nice idea, but it didn't work here in that case.
    And yes, it's Windows 10.
    I just think about a fresh, clean install. Maybe a Windows PE from USB stick...

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    Maybe Sysinternals PortMon could help you figure out which other program is grabbing and hogging the COM port?

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    Ok, here's another idea. I just tried this on Windows 10 and it seems to work.

    This uses Process Explorer. You can download it here (scroll to the bottom of the page):

    https://technet.microsoft.com/en-us/...sexplorer.aspx

    When you run it, a window will appear with tons of system info you don't need.

    Click the Find menu, and select the only option, which is Find Handle or DLL...

    In the dialog box, for Handle or DLL substring, type USBSER and click Search.

    Here's how it looks:

    Click image for larger version. 

Name:	capture.png 
Views:	260 
Size:	185.4 KB 
ID:	9080
    (click for full size)

    In this case, it found process #4668 named "javaw.exe" is using \Device\USBSER000, which is COM4 on my machine.

    This isn't perfect. In fact, it's pretty cryptic. It doesn't tell you "Arduino" or "Serial Monitor" is using the port. All you get is the process ID number and "javaw.exe", which is the Java virtual machine that actually executes the Arduino IDE.

    Hopefully whatever program on your PC is hogging the port will be apparent from the name. If not, at least you get the PID number. Maybe with that you can track it down with the Task Manager or other normal Windows system monitoring tools?

    The other cryptic detail is "\Device\USBSER000" rather than the familiar COM4 name. I believe the mapping from COM port numbers to these handle names can be found in the registry, under HKEY_LOCAL_MACHINE\Hardware\DeviceMap\SerialComm.

    This is really stretching the limits of my knowledge of Windows. If anyone reads this and knows what Windows APIs ProcessMonitor uses to do this search and find that process ID and name, please let me know?! In my dream world of plenty of programming hours for everything, I'd love to have teensy_reboot.exe do this search and actually tell you this info, instead of merely "unable to open for reboot request".

  10. #10
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    Hi Paul, thanks again for your reply!
    I also had the idea with PortMon before, but it seems to not work on my system for unknown reasons. I'm always getting a very meaningful error box after starting this tool:

    Name:  portmon.png
Views: 2140
Size:  3.2 KB

    Using the Process Explorer is also a very neat idea! But unfortunately so far it didn't help either: Not before and also after starting the Arduino IDE it can't find any reference to USBSER ...

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    Well, looks like yet another Windows mystery.

    Here's a version of teensy_reboot.exe which will print a little more info, from the WIN32 GetLastError function. Maybe it's something else we're not anticipating?

    To use this, extract the zip file and put teensy_reboot.exe into hardware/tools, replacing the copy that's already there. Then try to upload again, and let's see what it prints...
    Attached Files Attached Files

  12. #12
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    This is, what I got:

    Found serial '\\.\COM3', but unable to open for reboot request
    Windows Error Info: Zugriff verweigert


    more ideas... https://forum.pjrc.com/threads/40632...l=1#post126667
    Teensy did not respond to a USB-based request to automatically reboot.
    Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.


    The text Zugriff verweigert is German for access denied.
    So, this is unfortunately nothing new...

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    Ok, so looks like there some unusual Windows setup here where your user account lacks permission to access the COM port. This is the norm on Linux, which is the reason for the udev rule file.

    On Windows, the default is for access to be allowed to COM ports, even for non-admin users. I honestly have no idea how this setup could have happened, or what you actually do in Windows to manage permissions for COM ports.

    Maybe someone who knows Windows better will be able to comment? I'm really curious to hear, if anyone knows or has ideas?

  14. #14
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    I just made another test. Using the WinToUSB tool I've setup a Windows 10 environment runable from a USB stick. Then I installed Arduino and Teensyduino as usually. Everything is very sloooow, but it's working as it should!
    So I can confirm there is no hardware issue related to my PC. It must be Windows!
    Maybe I will reinstall Windows this weekend if there is no other solution...

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    Is this PC used by multiple people, perhaps with permissions set up to keep accounts separate? Any chance the USB device was installed when a different user was logged in? (really, I'm just guessing here.....)

    I know reinstalling will probably "fix" this, but I'm kinda sorta hoping the actual Windows access/permissions problem might get truly figured out. We get this sort of question from time to time, and until now I've always assumed it's some other software hogging the COM port, as Gnome NetworkManager on Linux sometimes does when trying to detect modems. But maybe some of those unresolved Windows issues have been this access rights issue?

    If you learn anything useful, please share here.

  16. #16
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,442
    Out of the fact that Windows should not be used in professional and development environments (my humble opinion as a developer and IT manager for more than 20 years) , you might first try to set up a second user profile with administrator rights in your current Windows installation. Then log off from your current session and log on as the new user. If everything works there, move the needed documents over from your ancient profile before simply deleting it.

  17. #17
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    No, this PC is used only be me - no other user accounts are there.
    But I will try it with a new account later...

  18. #18
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,176
    I just tried another quick test. Sadly, Windows also prints "Access is denied" when the COM port really is in use by another program. In this case, I used Coolterm as a test, since Arduino doesn't tell it to close the port when Upload is clicked.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	127 
Size:	357.7 KB 
ID:	9087

    So it seems the message isn't different between an actual access rights issue and the port being busy due to another program using it. Windows seems to give the same generic message, not offing more info about *why* access is denied.

    However, the lack of results from Process Explorer suggest the device isn't opened by another program.
    Last edited by PaulStoffregen; 12-09-2016 at 10:15 AM.

  19. #19
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    Just tried it with a fresh Adminstrator account - same bad result. Even if I would also like to known the reason, maybe my Windows installation is just scrap...
    Last edited by socke; 12-09-2016 at 10:32 AM.

  20. #20
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,442
    Do you have by chance any modem drivers installed (I remember some IBM notebooks came still with pre-installed analog modem drivers in 2014) ? I also met sometimes serial access problems in Windows with some sound card drivers coming with a telephony or fax utility which would install automatically and block the ports in the background...

  21. #21
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    No, it is a desktop PC, I also never attached a modem to it..

  22. #22
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,442
    A look onto Windows' device manager (Gerätemanger?) could be helpful, though, especially in checking if there are any real or virtual com ports shown.

  23. #23
    Junior Member
    Join Date
    Dec 2016
    Posts
    11
    Click image for larger version. 

Name:	pc.jpg 
Views:	132 
Size:	60.4 KB 
ID:	9088

    COM1 is a physical COM port on the mainboard, COM3 is Teensy, COM4 the same, but not connected. And before I deleted all unused serial devices.

  24. #24
    Junior Member
    Join Date
    Mar 2014
    Posts
    4
    I'm having this issue too with my Teensy 3.2, and it's pretty devastating. The last time I used my Teensy a couple months ago it worked fine. I tried updating Arduino and Teensyduino, with no luck. When I uninstalled the serial driver through Device Manager, the next No other programs are shown accessing the port in Process Explorer. I really don't want to reinstall Windows or stop using Teensies, what can I try?

    Edit: Oh I can't seem to switch the USB type to MIDI or anything else, because I can't upload a new sketch.

    Edit: Ah hah! Running Process Explorer as Administrator says that the port is being used by a Node.js server run by Autodesk Print Studio! Apparently it's a Service that starts automatically on startup? WTF Autodesk. Killing the process makes it work, but I haven't figured out how to disable it permanently yet.
    Last edited by ahalekelly; 11-05-2017 at 06:55 AM.

  25. #25
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,842
    Quote Originally Posted by ahalekelly View Post
    Edit: Ah hah! Running Process Explorer as Administrator says that the port is being used by a Node.js server run by Autodesk Print Studio! Apparently it's a Service that starts automatically on startup? WTF Autodesk. Killing the process makes it work, but I haven't figured out how to disable it permanently yet.
    Windows ver#? Does Task Manager have a 'Startup Tab' Showing Autodesk? If so set that to 'Disabled' and restart to see the effect.

Posting Permissions

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