Visual Studio Code: SSH error 539

Hi
I have a problem loading an image into iMX6dl.

After starting VSC, before opening a project, iMX is detected correctly.

iMX OK

After opening and compiling a project, VSC cannot connect to iMX.

imx_err


Environment:
tor_ext
vsc

I am open for suggestions.
Best regards.

Greetings @maciej,

This is indeed odd. As you said it appears an initial connection is possible but then suddenly the connection fails. This doesn’t seem to be a known issue as far as I’m aware.

Can you reliably reproduce this issue? What happens if you remove the device from the list and re-add it does it still occur?

Could you also try the following suggestions:

  • What happens if you add the device after opening/creating the project? By the way what kind of project are you working with?
  • I noticed you’re using the stable release of the extension. Could you try the early access version. This version has a number of fixes that may address the issue you’re seeing.

If none of the above helps could you provide a step by step of everything you’re doing leading up to the error.

Best Regards,
Jeremias

Hi Jeremias

What happens if you remove the device from the list and re-add it does it still occur?
Removing and re-adding a device does not change anything

What happens if you add the device after opening/creating the project?
Attempting to add a device after opening the project fails:
[07-29 05:28:55.308] Error (534) - OS error: [Errno None] Unable to connect to port 22 on 10.0.0.149

[07-29 05:28:55.308] OS error.
[07-29 05:30:52.676] Error (536) - Serial port error: [Errno 2] could not open port COM3: [Errno 2] No such file or directory: ‘COM3’
[07-29 05:30:52.676] Serial port error.
It seems that adding a device after opening a project is not working.

Could you try the early access version.
Both versions of the extension behave identically.

…could you provide a step by step of everything you’re doing leading up to the error.

  1. I open “empty” VSCode and add iMX6 - it works.
  2. I am opening a new project (Makefile-based Project), exactly as described in High performance, low power Embedded Computing Systems | Toradex Developer Center code - it also works.
  3. Compilation ends with an error:

Best Regards
Maciej

I was unable to reproduce this on my side. So I don’t think this is an issue with the extension itself.

My first guess is that usually some firewall/network restrictions that are interfering with the connection. However it’s odd since you are able to connect to the device, initially at least.

Can you SSH to the device normally from that development PC with no issues?

If yes then it may be the case that perhaps some security/firewall on the system is blocking communications that come from the extension itself. The backend for the extension is called moses. Could you make sure this isn’t being blocked in anyways on your machine.

I’ll also bring this up with our IDE team perhaps they have further ideas.

Best Regards,
Jeremias

After further thought I think I know why the discrepancy between the initial connection and the later connections.

With C/C++ based projects it all runs inside a development container that uses WSL 2 on Windows machines. You might have a firewall/configuration issues that is preventing the SSH connection from WSL 2. This may be why you’re only seeing the issue after project creation, since the initial SSH is handled by Windows instead of WSL 2.

Please check your network configuration regarding WSL 2 and make sure you can communicate to the target device from there.

Best Regards,
Jeremias

Thank you for your help.
I will check the configuration you wrote about.
Regards Maciej

Another thing I discovered is that possibly the device is being resolved by DNS outside the container but not inside.

One way to help this would be when you’re adding the device via IP is to either add “.local” if you’re adding via hostname or add via direct IP.

Best Regards,
Jeremias