Issues with Arduino connecting to Teensy Loader

Status
Not open for further replies.
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?
 
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....
 
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.
 
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.
 
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​
 
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....
 
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.

screen.jpg
(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"
 
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.
 
Same Unable to Find Teensy Loader Issue

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.

View attachment 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
 
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.
 
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.
Screen Shot 2020-07-25 at 1.03.35 PM.jpg
 
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?
 
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.
 
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.

sc1.png
 
Screen Shot 2020-07-25 at 3.08.48 PM.png
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.
 
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.
 
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.
 
Status
Not open for further replies.
Back
Top