HELP!!! Teensy & Arduino Conflict on a Mac

Status
Not open for further replies.

AndreaCarmen

New member
Hi everyone,
I am totally new to the teensy. I just bought one and couldn't make it read the Arduino code.
I just called technical support and they suggested I present my problem here, to people with Macintosh experience.
They are the ones who said the problem seems to be in the communication between Arduino and the Teensy Loader.

My operating system is High Sierra 10.13.4

So, the teensy board works. Arduino works, but when I try to verify the code in Arduino, it doesn't do it.
I am attaching here the screenshot of the error it gives me.
I am also attaching the "verbose log" that I get.

PLEASE HELP!!! I'd really appreciate it.
Thank you very much!!!

Andrea
 

Attachments

  • teensylogFROMANDREA.txt
    883 bytes · Views: 154
  • Screen Shot 2019-11-06 at 4.22.16 PM.jpg
    Screen Shot 2019-11-06 at 4.22.16 PM.jpg
    115.9 KB · Views: 157
We talked on the phone.

I can see the problem in the verbose info log. It's this line:

Code:
16:19:09.744 (loader): Unable to listen for remote control

But why Teensy Loader can't listen for Arduino to send it commands it quite a mystery.

Could you try opening Applications > Utilities > Terminal, and then in the terminal type "ifconfig lo0". This will print info about the localhost networking configuration on your Mac.

When I try it here, I get this:

Code:
MacBook-Air:~ paul$ ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        nd6 options=201<PERFORMNUD,DAD>

I must confess, I'm not a Mac expert. But I would really like to understand why Teensy Loader isn't able to listen for Arduino to control it. If we could get a real understanding, maybe in future versions that rather unhelpful error message could be improved to give useful advice?
 
FWIW, that line in the verbose info log is supposed to look like this:

Code:
07:17:50.226 (loader): Listening for remote control on port 3149

If the "ifconfig lo0" results don't show anything useful, maybe someone more familiar with MacOS or BSD Unix will know a way to use commands like "netstat" to dig further?
 
I can try to reproduce this here, but first I assume you checked to see that this isn't an issue with the firewall configuration?
 
Can't reproduce here with Teensy loader 1.47 on High Sierra 10.13.6 with firewall on or off.

Paul: is there any way to get the error result that prints that message?
 
Paul: is there any way to get the error result that prints that message?

Teensy Loader is (mostly) built on top of the wxWidgets GUI library. This error ultimately comes from wxSocketServer. Here's the source code. Hopefully nothing too surprising.

Code:
void MyFrame::start_ipc_server(void)
{
        unsigned short port[3]={3149,25981,6837 /*,4782,5293,13752*/};
        wxIPV4address addr;
        int i;

        for (i=0; i<3; i++) {
                addr.LocalHost();
                addr.Service(port[i]);
                ipc_server = new wxSocketServer(addr, wxSOCKET_WAITALL | wxSOCKET_REUSEADDR);
                if (ipc_server->IsOk()) {
                        printf("Listening for remote control on port %d", port[i]);
                        ipc_server->SetEventHandler(*this, ID_SERVER);
                        ipc_server->SetNotify(wxSOCKET_CONNECTION_FLAG);
                        ipc_server->Notify(true);
                        return;
                }
        }
        printf("Unable to listen for remote control");
}

Internally, I believe wxSocketServer is a pretty thin abstraction around the usual BSD socket functions. So it's (probably) just creating a socket file descriptor and calling bind() and listen(). But we don't get a pass/fail from the IsOK() function.

This problem is so rare that pretty much no work has been done to get better info when IsOK() returns false for all 3 port numbers. Long ago, we used to get occasional reports from Windows users with the Zone Alarm firewall software. But eventually Zone Alarm fixed their software so it didn't interfere with localhost communication. The only other case I can recall was a Linux user who had messed up his localhost settings (using something other than 127.0.0.1) by aggressively editing too much stuff.

Without more info from @AndreaCarmen, like the output from "ifconfig lo0", I just don't see any way to figure out what went wrong. :(
 
it worked!!

Good morning!
Sorry it took so long to finally try it.
I did it yesterday and it worked immediately! :)
Thanks so much for the help!
Best,

Andrea





We talked on the phone.

I can see the problem in the verbose info log. It's this line:

Code:
16:19:09.744 (loader): Unable to listen for remote control

But why Teensy Loader can't listen for Arduino to send it commands it quite a mystery.

Could you try opening Applications > Utilities > Terminal, and then in the terminal type "ifconfig lo0". This will print info about the localhost networking configuration on your Mac.

When I try it here, I get this:

Code:
MacBook-Air:~ paul$ ifconfig lo0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        nd6 options=201<PERFORMNUD,DAD>

I must confess, I'm not a Mac expert. But I would really like to understand why Teensy Loader isn't able to listen for Arduino to control it. If we could get a real understanding, maybe in future versions that rather unhelpful error message could be improved to give useful advice?
 
it doesn't work again...

Sorry for the confusing posts and the delay in addressing this.

So, just yesterday I had time to look into this again.
To make sure I was doing things right, I uploaded everything in my old laptop and everything worked well.
So, then I tried it in the new one (macOS 10.13.4) and it worked perfectly.
However this morning I am finding again the same problem...

This is what I get in "Terminal"

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>


I reiterate that I am not familiar at all with all this.
My firewall is off.
Thanks for the help!!
Andrea
 
Do you have any third-party virus, networking or firewall software installed on your computer?
 
Last edited:
The command in the Terminal only prints info. It doesn't (or certainly should not) change or affect anything.

Since the problem is happening sometimes but not others, there's a good chance it's being caused by some other software you have running. But what, I have no idea. I would really like to know, so please if you do figure it out or gain any useful info, please remember to post a followup message here. Maybe when this is finally resolved we can learn what really happened and prevent it in the future, or at least improve the error message with helpful info?

I reiterate that I am not familiar at all with all this.

Macintosh and BSD Unix (the underpinning of MacOS) aren't exactly my specialty.

I believe there's a "netstat" command you can run in Terminal that prints a *lot* of info about the networking setup on your computer. Maybe try that and copy the results to a message here? Or maybe try "netstat -i lo0", which should cause it to only print info about the localhost networking between programming running on your Mac, if the normal "netstat" prints far too much info.

Again, running "netstat" isn't supposed to fix or change anything. It simple prints info. Maybe something in that info will stand out as the cause or at least some more clues about the problem?
 
it's possible that lsof -i might provide clues or dtruss (like linux strace)

as others noted, it sounds like some sort of firewall is preventing "local" TCP connections
 
it works again...

Sorry again for the delay. I just didn't have the time to sit down.
Anyway, I finally tried again today and it works!
The only thing that I had opened before was Chrome.
I tried it today with and without Chrome running and it works both ways. I can't reproduce the problem anymore.
So, all is good for now....
Hopefully, it will continue.
Thank you very much for your response & my apologies again because it took me so long to look into it.
Best!
A.




The command in the Terminal only prints info. It doesn't (or certainly should not) change or affect anything.

Since the problem is happening sometimes but not others, there's a good chance it's being caused by some other software you have running. But what, I have no idea. I would really like to know, so please if you do figure it out or gain any useful info, please remember to post a followup message here. Maybe when this is finally resolved we can learn what really happened and prevent it in the future, or at least improve the error message with helpful info?



Macintosh and BSD Unix (the underpinning of MacOS) aren't exactly my specialty.

I believe there's a "netstat" command you can run in Terminal that prints a *lot* of info about the networking setup on your computer. Maybe try that and copy the results to a message here? Or maybe try "netstat -i lo0", which should cause it to only print info about the localhost networking between programming running on your Mac, if the normal "netstat" prints far too much info.

Again, running "netstat" isn't supposed to fix or change anything. It simple prints info. Maybe something in that info will stand out as the cause or at least some more clues about the problem?
 
Status
Not open for further replies.
Back
Top