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

Thread: Issues with Arduino connecting to Teensy Loader

  1. #1
    Junior Member
    Join Date
    Jan 2019
    Posts
    5

    Issues with Arduino connecting to Teensy Loader

    I recently got a teensy for a project. When I go to install any program, I get the following error:

    Unable find Teensy Loader. (p) Is the Teensy Loader application running?
    quitexit status 1
    Error compiling for board Teensy 3.5.

    The Teensy Loader application is running because Arduino opened it, but it still refuses to acknowledge that it exists.
    I am running Teensy Loader v1.45 and Arduino 1.8.8 on macOS Mojave.

    I have seen posts with this message on Linux, but have yet to find any solutions for macOS. Any idea what it could be?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    This error means localhost communication between Arduino and Teensy Loader isn't working. It has nothing to do with USB or any hardware. It's purely software on your Mac.

    Why, I'm not sure. We sometimes used to see this on Windows when people had certain versions of the Zonealarm firewall. It would needlessly block localhost communication between programs running on the same machine.

    Is there any chance your Mac has extra security measures or special "sandbox" settings?

    I can tell you 1 other Mac user reported this same problem with Mojave a couple months ago. We never did figure out why. He apparently reinstalled MacOS and everything else and it worked, so no knowledge or insight gained about the problem.

    I can also tell you it works perfect on my Macbook Air with Mojave 10.14.2. Many people use Teensy on MacOS. This problem is rare, but not unheard of. I'm really hoping to learn what causes it....

  3. #3
    Junior Member
    Join Date
    Jan 2019
    Posts
    5
    There are no additional security measures. I have even tried turning off macOS's firewall and uploading, and still it won't work. I'm running a beta version of 10.14.3, so maybe that's it. I'll try updating and report back.

    Another thing to note is it did work for one program a few days ago onto a different teensy. I'll also look into if there are other Mojave-related localhost issues that are known.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    Can you try with Verify instead of Upload.

    When you click Verify in Arduino, your code gets compiled and as a final step, it tells Teensy Loader the location of the freshly compiled code. But not uploading is attempted.

    Teensy Loader has an "Verbose Info" window. It's hidden in the Help menu (a place nobody ever looks...) This window will tell you lots of info, including what Teensy Loader is hearing from the various utilities Arduino runs.

  5. #5
    Junior Member
    Join Date
    Jan 2019
    Posts
    5
    Here's the info from that window. I had no idea it existed:

    16:01:39.972 (loader): Teensy Loader 1.45, begin program
    16:01:40.005 (loader): Unable to listen for remote control
    16:01:40.005 (loader): initialized, showing main window
    16:01:40.259 (loader): HID/macos: no devices found
    16:01:45.939 (loader): Verbose Info event

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    Wow, "Unable to listen for remote control" means we couldn't listen to a port for 127.0.0.1. Not good.

    I see Mojave 10.14.3 released today. I'm updating my Macbook Air now....

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    Upgraded to 10.14.3. Reinstalled Arduino 1.8.8 and Teensyduino 1.45 from fresh downloads. Everything seems to work fine. Here's a screenshot.

    Click image for larger version. 

Name:	screen.jpg 
Views:	51 
Size:	161.1 KB 
ID:	15706
    (click for full size)

    The 3rd line in the Verbose Information window is what you're supposed to see, "Listening for remote control on port 3149"

  8. #8
    Junior Member
    Join Date
    Jan 2019
    Posts
    5
    The update fixed it! Must have been some issue with the beta version of macOS. Thank you for all your help! And now I know about the verbose information window.

  9. #9
    Junior Member
    Join Date
    Jul 2020
    Posts
    6

    Same Unable to Find Teensy Loader Issue

    Quote Originally Posted by PaulStoffregen View Post
    Upgraded to 10.14.3. Reinstalled Arduino 1.8.8 and Teensyduino 1.45 from fresh downloads. Everything seems to work fine. Here's a screenshot.

    Click image for larger version. 

Name:	screen.jpg 
Views:	51 
Size:	161.1 KB 
ID:	15706
    (click for full size)

    The 3rd line in the Verbose Information window is what you're supposed to see, "Listening for remote control on port 3149"
    Hi Paul, I have been trying to fix this same issue since before covid began. I was running Mac OS 10.13. One day I could program Teensys, the next, I could not and have not been able to ever since. I have looked at every post on the forum regarding the issue and haven't found a solution yet. I have tried upgrading to Mojave 10.14. That did not solve the issue. I've tried using the Teensyduinio App and the Installer. I've tried the past five versions of Arduino. I've completely wiped everything Arduino related and stared fresh numerous times. All of it gives me the same Unable to find Teensy Loader error, despite the Teensy Loader opening when I click upload or compile. I even tired sniffing the UDP port with a Max patch, but did not see any useful info. I stumbled across this github issue (https://github.com/platformio/platform-teensy/issues/45). There's a very good chance that I installed VisualStudioCode right around the time the Teensy Loader stopped communicating with Arduino. I tried to delete VSCode to see if that would fix it, but it did not. However, I think installing it altered something on my computer that severed that communication line. Any help on this matter is greatly appreciated. Thank you for your time!

    Computer Specs: MacBook Pro 15-inch, mid 2015, Mojave 10.14.6

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    First, make sure you are using Arduino 1.8.9 or 1.8.13. Some versions, especially 1.8.11 and 1.8.12 had many bugs on MacOS (affecting all Arduino users, not just Teensy). Fortunately version 1.8.13 fixed those problems with Arduino, so I recommend getting 1.8.13 so you're not also struggling with those problems.

    You should also be aware Teensy Loader had a (now fixed) bug where the newer build for Catalina would not run on MacOS 10.13 (but did work on 10.12 and 10.14). That issue was fixed in Teensyduino 1.53. The older installer-based build which never works on Catalina, as far as I know, has always worked on 10.13.

    Regarding this:

    All of it gives me the same Unable to find Teensy Loader error, despite the Teensy Loader opening when I click upload or compile.
    Please understand the ability of the Teensy Loader window to appear has nothing to do with whether Teensy is actually connected to your Mac. It's just a program on your Mac, like any other. It's just like Chrome or Safari or any other web browser which is able to open even when you're not connected to the internet, but of course they can't actually communicate until you turn on wifi or plug into a network. Teensy Loader works the same way, so please understand the little Teensy Loader window appearing only means your Mac is able to run the program.

    Normally Arduino should be able to cause your Teensy to automatically go into programming mode. But you should also understand that this can fail if code running on Teensy somehow interferes with USB communication. Every Teensy has a pushbutton for exactly this reason, to give you a reliable way to get Teensy back into programming mode so you can load a new program, even if the old one caused your Teensy to no longer communicate. While you're troubleshooting, I highly recommend getting into the habit of pressing the button. Later when everything else is working using manual button presses is the time to worry about why things don't work automatically. (you can waste a *lot* of time going down that rabbit hole when the problem is actually an unrelated USB communication issue)

    After you've pressed and released the button on Teensy, if all your hardware is working properly, Teensy Loader should always detect your Teensy. For testing, I recommend turning off Auto mode in Teensy Loader, so it doesn't immediately reprogram your Teensy. That gives you time to see what's happening, and you can click the toolbar buttons to send your code and to reboot your Teensy (auto mode does these for you as fast as possible, the moment a Teensy is detected in programming mode).

    Focus first on whether Teensy Loader (not in Auto mode) detects your Teensy after you've pressed the button. While holding the button down, or when you unplug the cable, it should show nothing is connected. Just after the button press, it should display your Teensy model in the window. If that doesn't work, there's no point fiddling with Arduino and other software, as something isn't working between Teensy and your Mac.

    When that doesn't work, bad or charge-only USB cables are almost always the cause. Of course it can also fail if your Teensy is damaged. On Linux it can fail if you don't have the udev rules installed, but on Macintosh and Windows Teensy Loader should always be able to detect the device. Since its HID which is built into the OS, driver problems are very rare. USB charge-only cables are by far the most common problem when no communication is possible.

  11. #11
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Thanks for the quick response. I should have clarified that communication between the Teensy and the Teesnsy loader works fine. The only way I've been able to upload code to a teensy in the past 6 months is by compiling in Arduino, navigating to the temp folder where it compiles, grabbing the .hex file and uploading through the Teensy Loader directly. This method is slow and painful as the temp folder is always different. However, uploading code through the Arduino IDE has not worked since all this began. Teensy loader always has the previous hex file loaded and never gets the file of the most recently compiled sketch from Arduino. For instance, in this image, I tried to compile and upload Blink.ino, but the previous hex file I manually uploaded is shown in the Teensy Loader.
    Click image for larger version. 

Name:	Screen Shot 2020-07-25 at 1.03.35 PM.jpg 
Views:	2 
Size:	166.1 KB 
ID:	21129

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    Wow, that is unusual for MacOS. When you figure out what's wrong, I really want to know what caused this. It's come up once on Linux when someone had their loopback interface configured for a wrong IP number (not 127.0.0.1) and long ago we used to hear about the lame ZoneAlarm software mistaking localhost communication for network activity. But this is the first I've heard of localhost communication issues on MacOS.

    The communication is indeed TCP/IP to 127.0.0.1. Teensy Loader listens on TCP port 3149 by default, and falls back to port 25981 or 6837 if needed. The "teensy_post_compile" utility is run by Arduino to send the filename and folder to Teensy Loader. If you control-click on Arduino and "Show Package Contents" and then navigate to Contents/Java/hardware/tools you'll find that program. It can be run from command line if you want to experiment.

    Again, this is the first time I can recall a Mac having no localhost communication between Arduino (actually teensy_post_compile) and Teensy Loader. I really hope you can get to the bottom of what's wrong and let me know what caused this?

  13. #13
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Is it possible that some other application is using that port or blocking it somehow? As mentioned, I'm pretty sure I installed Visual Studio Code right around the time this started happening. Deleting that app didn't solve the issue, but is it possible it altered some setting on my OS during installation that affected that communication pipeline? I don't have any other applications running when I attempt this, so I don't know how to troubleshoot that without deleting everything one by one, which I'd rather not try.

    The only other clue I have is that this happened to me about a year ago. However I was able to solve the issue by completely wiping the Arduino15 folder that contains all the prefs and configs for Arduino. That solved it way back when, but that hasn't had any affect this time around. I thought maybe some of the other various board def files might have been interfering. However, now it doesn't work when I have nothing but the base IDE and Teensyduino installed, so that doesn't seem to be the cause.

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    I don't know why it's not working. But I do know you can use "ifconfig lo0" in a Terminal window to get info about the loopback interface.

    Here's what it looks like on my Macbook Air.

    Click image for larger version. 

Name:	sc1.png 
Views:	6 
Size:	139.9 KB 
ID:	21131

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    In Teensy Loader, also try Help > Verbose Info. It should look like this:

    Click image for larger version. 

Name:	sc2.png 
Views:	6 
Size:	313.3 KB 
ID:	21132

  16. #16
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Click image for larger version. 

Name:	Screen Shot 2020-07-25 at 3.08.48 PM.png 
Views:	5 
Size:	44.4 KB 
ID:	21133
    No variances there. Thanks for your help. This is a work computer, so maybe I can wrangle one of our IT folks to offer their input. I don't think there's any anit-virus software on here, but maybe there's something running in the background I can't see that they changed/updated remotely. I will certainly report back here if I ever uncover the root cause.

  17. #17
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Here's what the verbose output says:

    Click image for larger version. 

Name:	Screen Shot 2020-07-25 at 3.14.53 PM.png 
Views:	8 
Size:	84.2 KB 
ID:	21134

  18. #18
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    Look in Preferences > Security & Privacy > Firewall. Normally it's off by default. Maybe Firewall is turned on, and maybe has settings that interfere with localhost communication? (this seems like kind of a long shot guess, since that sort of firewall configuration would be unlikely... normally settings to block localhost aren't used)

    Teensy Loader doesn't use any internet access, so you can unplug & turn off wifi, then turn off firewall while disconnected.

  19. #19
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Firewall is off as expected.

  20. #20
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,488
    I'm afraid I'm out of guesses. I don't know MacOS (or BSD Unix) well enough to suggest anything else.

  21. #21
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,196
    Not a PJRC supported solution but ... Wonder if @koromix TyCommander would give a usable system - or fail also? Would be a way to find if it can work or not perhaps?

    I tend to use it on Windows and it allows clean way to SerMon (and upload) when multiple Teensy online.

    He posts a mac build that might be worth a try: github.com/Koromix/tytools/releases

    First try could just install it ( on windows it just dumps into a folder to run ) and see if it can identify the Teensy - and then give it a HEX path to upload. It also has a verbose tracking of some sort that might give feedback on connectivity. If the upload works it can be integrated to IDE to swap out TeensyLoader on build as the next step.

Posting Permissions

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