VS Code and set default

When I use different SOM with VS Code, each with different IP and I click on “Set Default” to work with one, VS code often is blocked on
Checking host ip sanity …
and nothing is impossible to set the new SOM, sometimes I unlock by entering with ssh, sometimes deactivating network interface, sometimes closing VS Code, but is not repetitive, I can’t
understand what is the problem, I lost hours trying to connect, then without a reason it connects.

When this happen I have complete access to the SOM with SSH.

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, it seems like you are experiencing issues with setting a new System on Module (SoM) as the default device in Visual Studio Code using the Torizon IDE Extension. The problem appears to be related to the “Checking host IP sanity” step, which can cause VS Code to become unresponsive.

Here are a few troubleshooting steps you can try based on the context:

  1. Network Configuration: Ensure that your network configuration allows for proper communication between your development machine and the SoM. This includes checking that the necessary ports are open and accessible.

  2. Manual Device Addition: If the device is not being detected automatically, try manually adding the device by clicking the “+” icon and inputting the device’s IP address.

  3. Check Internal Logs: Use the VS Code command palette to open the Developer Tools and check the Console tab for any error messages or logs that might provide more insight into the issue.

  4. SSH Access: Since you mentioned that sometimes entering with SSH helps, ensure that SSH is properly configured and that there are no intermittent network issues affecting SSH connectivity.

  5. Default Device Configuration: Make sure that the settings.json file is correctly configured for the default device. This file is used by the extension to perform various tasks, and any misconfiguration could lead to issues.

  6. Docker Context: Verify that the Docker context is correctly set to the default device by checking the DOCKER_HOST environment variable in the Docker’s view within VS Code.

If these steps do not resolve the issue, it might be necessary to further investigate the specific network and system configurations or consult additional resources or support from Toradex.

Please, also check if these links can help you solve your problem:

VS Code Toradex Torizon Support Extension & Network Connectivity.

Dear @fabrizio.camagna,

Thank you for contacting us.
I have tried to reproduce the issue you explained with two modules on my desk. I installed the Torizon OS with easy pairing from the toradex easy installer. Both modules and the host PC are in the same network (in my case 10.0.0.XXX). Following that I added one device manually in the Torizon extension under the plus symbol at Network Devices. Then I set the device as default, which was successful. Finally I again added my second device manually in the same way and was able to successfully switch that device as default.

This means I was not able to reproduce what you are describing. Am I doing something other than you are?

Best regards,
Collin

I’m using VS Code, Docker Desktop, Windows and WSL2, my network is 192.168.1.0/24, each SOM have a static IP, all have same login name and password,

this is my settings.json, I tried also to change torizon_ip manually sometimes this has solved the issue.
{
“torizon_login”: “torizon”,
“torizon_ip”: “192.168.1.227”,
“host_ip”: “192.168.1.208”,
“torizon_workspace”: “${workspaceFolder}”,
“torizon_debug_port1”: “”,
“torizon_debug_ssh_port”: “2230”,
“torizon_debug_port2”: “”,
“terminal.integrated.defaultProfile.linux”: “bash”,
“torizon_debug_port3”: “”,
“torizon_gpu”: “”,
“torizon_arch”: “armv7l”,
“wait_sync”: “1”,
“torizon_run_as”: “torizon”,
“torizon_app_root”: “/home/torizon/app”,
“tcb.packageName”: “SeRT”,
“tcb.version”: “3.8.1”,
“C_Cpp.errorSquiggles”: “disabled”,
“files.associations”: {
“iostream”: “cpp”,
“new”: “cpp”,
“sertbacnetconfig.h”: “c”,
“random”: “cpp”,
“*.tcc”: “cpp”,
“numeric”: “cpp”,
“ostream”: “cpp”,
“sstream”: “cpp”
},
“tcb.clientId”: “”,
“torizon_ssh_port”: “22”,
“C_Cpp.default.compilerPath”: “/usr/bin/gcc”,
“torizon_psswd”: “mypassword”,
“docker.environment”: {
“DOCKER_HOST”: “tcp://192.168.1.227:2375”,
“DEBUG_SSH_PORT”: “2222”,
“DEBUG_PORT1”: “2222”,
“DEBUG_PORT2”: “2223”,
“DEBUG_PORT3”: “2224”
}
}

Dear @fabrizio.camagna,

I have a hunch what might be the issue here. When a connection attempt fails, could you maybe try establishing an ssh connecting via the WSL terminal within VS Code? For that you should use identical IP, password and user as you did while trying to define your target. I think there might be a possibility, that there is a keygen issue. Should this be the case you will see something like this in your terminal:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:<SHA>
Please contact your system administrator.
Add correct host key in <PATH>/known_hosts to get rid of this message.
Offending RSA key in <PATH>/known_hosts:54
  remove with:
  ssh-keygen -f '<PATH>/known_hosts' -R '<IP>'
Host key for <IP> has changed and you have requested strict checking.
Host key verification failed.
scp: Connection closed

With the recommended command being executed you might be able to connect to your device.

Best regards,
Collin

Dear @fabrizio.camagna,

Has your issue been resolved in the meantime?

Best regards,
Collin