Skip to content

COM ports not showing if connected to network #8866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lemmingDev opened this issue May 10, 2019 · 17 comments
Closed

COM ports not showing if connected to network #8866

lemmingDev opened this issue May 10, 2019 · 17 comments
Assignees

Comments

@lemmingDev
Copy link

lemmingDev commented May 10, 2019

If I'm not connected to a network when opening the Arduino IDE, all COM ports are displayed under Tools / Ports correctly.

If I'm connected to a network, the ports menu is greyed out.
This behaviour occurs when I'm at work (a public highschool in Australia) which has pretty strict firewall and proxy settings that block a lot of things.

It happens on school desktops, along with my work laptop and student's personal laptops.

There must be something in the Arduino IDE that tries to call home on startup that my work is blocking that is causing this behaviour.

We shouldn't have to disconnect from the network to have the IDE work correctly. We need to access resources, mark rolls etc. I also can't have students ripping LAN cables out the back of desktop PCs every time the want to use the IDE.

Please allow COM ports to be listed even though computer has limited network connectivity.

This behaviour is present on 1.8.9 installed and portable Windows versions. Even on a much older 1.6.x version.

@facchinm
Copy link
Member

Hi @lemmingDev ,
the discovery of serial ports should be totally unrelated with network ports. Can you provide a screencast of what is going on? Thanks!

@facchinm facchinm added the Waiting for feedback More information must be provided before we can proceed label May 13, 2019
@PaulStoffregen
Copy link
Contributor

PaulStoffregen commented May 13, 2019

Maybe related to getBoardWithMatchingVidPidFromCloud() ?? Just a blind guess really...

@facchinm
Copy link
Member

Unless the proxy/firewall leaves the connection pending that function should always return, in a way or another.

@lemmingDev
Copy link
Author

@facchimm

Screencast? Do you mean a video of what's going on?

Thanks for the reply

@per1234
Copy link
Collaborator

per1234 commented May 15, 2019

Do you mean a video of what's going on?

@lemmingDev that's correct. I'm using a free, open source, lightweight program called LICEcap for this purpose.

@lemmingDev
Copy link
Author

lemmingDev commented May 20, 2019

Sorry - moving house and haven't had time to screencast. Not much to see anyway. When connected to network at school, Ports menu option is greyed out when opening Arduino. When I am disconnected from network and open Arduino, ports menu is polulating the ports fine. Problem only happens at school.

Technicians at school say its probably a firewall issue.

What URLs does the IDE try to reach when opening?

@facchinm
Copy link
Member

It tries to reach:
http://api-builder.arduino.cc/builder/v1/boards/0xAAAA/0xBBBB (with AAAA and BBBB replaced by the USB VID and PID your board exposes).

That URL in a normal (non firewalled) environment should return 404 on a "board not found" and a json in case the board is known.

If the connection hangs in your environment it could be the root cause of the greyed out board list.
Please note that the REST endpoint is called only if the board is not recognized (like ESP8266, which all share the same USB-to-serial converter)

@lemmingDev
Copy link
Author

lemmingDev commented May 22, 2019

Thanks. Will ask technicians to allow that URL.

The problem also presents itself when no board is attached though. Does it still try to reach that URL passing the VID and PID of the currently selected board?

@lemmingDev
Copy link
Author

Wireshark capture indicates 52.139.250.253 getting blocked.

Looks like it belongs to Microsoft Azure

Waiting on regional technicians to continue looking into it.

Would be great if it was fixed on the Arduino end though so others don't have the problem

@facchinm facchinm added this to the Release 1.8.10 milestone May 31, 2019
@endorama
Copy link
Contributor

Hello @lemmingDev, I'm part of the operations team at Arduino.

The IP address you indicate is a server that does not belong to us.

In order to help us debugging this issue would be possible for you to provide a pcap of a session where this problem arise with the Arduino IDE?
As you may imagine is difficult to reproduce the network setup causing the issue, so a detailed Wireshark session could help us.

If possible stop any other network activity during the capture. Send the file to support@arduino.cc referencing "arduino/Arduino issue 8866".

Thank you!

@lemmingDev
Copy link
Author

@endorama

Thanks for looking into this

Email with capture sent

@endorama
Copy link
Contributor

endorama commented Jun 4, 2019

After further investigation, this seems mainly a fault not directly related to the IDE.

The IP address aforementioned is a IP address related to Windows Push Notification Service. Our guess is it gets blocked by network limitation on Microsoft telemetry. The IDE was probably downloaded through Microsoft Store (I'm still waiting confirmation on this). This is a network issue on the client side we are not able to "fix". (We may be able to reproduce the issue but I'll continue the discovery and troubleshooting via private channel with @lemmingDev)

Could we try improving the Arduino IDE side of this issue, by ensuring that all network requests are terminated after a timeout? @facchinm would this be feasible?

My understanding of this confirms what @facchinm said in the previous comment, this is likely a network issue and not a bug. I see a possible bug in how we handle "never ending" network requests, but will require further investigation.

@endorama endorama removed the Waiting for feedback More information must be provided before we can proceed label Jun 25, 2019
@endorama
Copy link
Contributor

I can confirm the issue here was the local network topology preventing access to the required endpoint http://api-builder.arduino.cc/, resulting in pending connections.

I would close this as has been resolved, but I'd like to open a follow up improvement ticket to handle this errors more nicely.
@facchinm how effort would you think is required ? Is feasible with the current IDE network stack?

@facchinm
Copy link
Member

Threading the request and canceling the thread on timeout should work, I'll try to setup a PR in the next few days

@facchinm facchinm self-assigned this Jun 25, 2019
@lemmingDev
Copy link
Author

Fantastic!

Let me know when it's ready to test

@lemmingDev
Copy link
Author

lemmingDev commented Jul 15, 2019

Hi - Just spoke to regional IT support for my work.

They say it may be a good idea for Arduino developers to make calls to http://api-builder.arduino.cc/ and any other URLs proxy aware. They think this would allow the connection/response and fix the problem.

@lemmingDev
Copy link
Author

FYI - for anyone who may be experiencing the same issues, I added an entry in my hosts file to redirect
api-builder.arduino.cc/
to 127.0.0.1 and it makes the ports get listed fine.
Not the neatest solution, but will work while the developers hopefully work on making those calls proxy aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants