SSH Tunnel error:

Just getting started with Toradex. I added Toradex Torizon C/C++ Support extension to Visual Studio with no problem. I download/update base and sdk containers. When I selecting View > Other Windows > Torizon devices from the menu bar in Visual Studio, I put in my information to log in, it takes a while but eventually the device resets. And has this error "SSH Tunnel error: Could not establish session to SSH gateway. This happens with both the serial and network connection. I can log in through Putty. With Putty serial open it looks like the reset is cause by the watchdog. I tried downloading and Using Visual Studio Code and the same thing happens.

Hi @laugher5,

Continuing our discussion from the other thread.

With Putty serial open it looks like
the reset is cause by the watchdog.

Could you copy and paste the message you’re seeing over serial that makes you suspect this.

Furthermore can you turn on the debug Window for our extension. This can be done by going to Visual Studio and, Tools > Options > Torizon > Show backend console > True. Once that has been set and applied, restart Visual Studio. You may also need to open up task manager and stop the moses.exe process for this to take effect. After restarting there should now be a command prompt window that shows all the API calls made by our extension.

Once you have this window enabled can you go over the process of adding the device. If you encounter the error again can you copy and paste the whole log from the debug window to us. I just want to see if it’s a simple SSH error or if there’s maybe something else going on.

Best Regards,
Jeremias

Second from the debug log:
Serving on http://kubernetes.docker.internal:5000
INFO:root:REST -> /api/applications/load
INFO:root:REST -> /api/version/docker
INFO:root:REST <- /api/version/docker - 200
INFO:root:REST <- /api/applications/load - 200
INFO:root:REST -> /api/platforms
INFO:root:REST <- /api/platforms - 200
INFO:root:REST -> /api/applications/81952c62-5bb5-4c24-a9fd-80f79359b05b/sdk/run
INFO:root:REST <- /api/applications/81952c62-5bb5-4c24-a9fd-80f79359b05b/sdk/run - 200
INFO:root:REST -> /api/eulas
INFO:root:REST <- /api/eulas - 200
INFO:root:REST -> /api/version/docker
INFO:root:REST <- /api/version/docker - 200
INFO:root:REST -> /api/devices
INFO:root:REST <- /api/devices - 200
INFO:root:REST -> /api/devices/network_detect
INFO:root:DETECT - Trying to detect device apalis-imx6-10657251.
WARNING:root:DETECT - Login successful.
INFO:root:DETECT - Toradex device id 10657251
INFO:root:DETECT - apalis-imx6 detected :: Model 0035
processed file: C:\Users\mclaughlinm\.moses\devices\10657251\id_rsa
Successfully processed 1 files; Failed processing 0 files
processed file: C:\Users\mclaughlinm\.moses\devices\10657251\id_rsa
Successfully processed 1 files; Failed processing 0 files
processed file: C:\Users\mclaughlinm\.moses\devices\10657251\id_rsa
Successfully processed 1 files; Failed processing 0 files
WARNING:root:Can't solve hostname apalis-imx6-10657251 saving address used for detection instead.
INFO:root:REST <- /api/devices/network_detect - 200
INFO:root:REST -> /api/devices/10657251
INFO:root:REST <- /api/devices/10657251 - 200
INFO:root:REST -> /api/devices/10657251/images
INFO:root:SSH - Creating tunnel to 10657251
2021-01-21 15:28:39,819| ERROR   | Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:sshtunnel.SSHTunnelForwarder:Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:root:Error: 539 SSH tunnel error. SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Exception: SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Could not establish session to SSH gateway
INFO:root:REST <- /api/devices/10657251/images - 539
INFO:root:REST -> /api/devices/10657251
INFO:root:REST <- /api/devices/10657251 - 200
INFO:root:REST -> /api/devices/10657251/images
INFO:root:SSH - Creating tunnel to 10657251
2021-01-21 15:28:47,315| ERROR   | Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:sshtunnel.SSHTunnelForwarder:Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:root:Error: 539 SSH tunnel error. SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Exception: SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Could not establish session to SSH gateway
INFO:root:REST <- /api/devices/10657251/images - 539
INFO:root:REST -> /api/devices/10657251
INFO:root:REST <- /api/devices/10657251 - 200
INFO:root:REST -> /api/devices/10657251/images
INFO:root:SSH - Creating tunnel to 10657251
2021-01-21 15:28:54,835| ERROR   | Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:sshtunnel.SSHTunnelForwarder:Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:root:Error: 539 SSH tunnel error. SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Exception: SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Could not establish session to SSH gateway
INFO:root:REST <- /api/devices/10657251/images - 539
INFO:root:REST -> /api/devices/10657251
INFO:root:REST <- /api/devices/10657251 - 200
INFO:root:REST -> /api/devices/10657251/images
INFO:root:SSH - Creating tunnel to 10657251
2021-01-21 15:29:02,323| ERROR   | Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:sshtunnel.SSHTunnelForwarder:Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:root:Error: 539 SSH tunnel error. SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Exception: SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Could not establish session to SSH gateway
INFO:root:REST <- /api/devices/10657251/images - 539
INFO:root:REST -> /api/devices/10657251
INFO:root:REST <- /api/devices/10657251 - 200
INFO:root:REST -> /api/devices/10657251/images
INFO:root:SSH - Creating tunnel to 10657251
2021-01-21 15:29:09,932| ERROR   | Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:sshtunnel.SSHTunnelForwarder:Could not resolve IP address for apalis-imx6-10657251, aborting!
ERROR:root:Error: 539 SSH tunnel error. SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Exception: SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Could not establish session to SSH gateway
INFO:root:REST <- /api/devices/10657251/images - 539

FIrst on the serial terminal when starting from scratch:
Torizoncore Upstream 5.1.0+build.1 apalis-imx6-10657251 ttymxc0

apalis-imx6-10657251 login: torizon
Password:
apalis-imx6-10657251:~$
Industrial temperature grade DDR3 timings.
Trying to boot from MMC1

U-Boot 2020.07-5.1.0+git.f34eb0c0ac97 (Jan 01 1970 - 00:00:00 +0000)

CPU:   Freescale i.MX6D rev1.6 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 32C
Reset cause: POR
DRAM:  1 GiB
PMIC:  device id: 0x10, revision id: 0x21, programmed
MMC:   FSL_SDHC: 1, FSL_SDHC: 2, FSL_SDHC: 0
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Apalis iMX6 Dual 1GB IT V1.1B, Serial# 10657251
Net:   eth0: ethernet@2188000
Hit any key to stop autoboot:  0
MMC: no card present
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
1007 bytes read in 11 ms (88.9 KiB/s)
## Executing script at 17000000
3835 bytes read in 22 ms (169.9 KiB/s)
69456 bytes read in 30 ms (2.2 MiB/s)
141 bytes read in 24 ms (4.9 KiB/s)
Applying Overlay: apalis-imx6_parallel-rgb_overlay.dtbo
766 bytes read in 31 ms (23.4 KiB/s)
Applying Overlay: display-edt7_overlay.dtbo
803 bytes read in 31 ms (24.4 KiB/s)
Applying Overlay: apalis-imx6_stmpe-ts_overlay.dtbo
402 bytes read in 29 ms (12.7 KiB/s)
Applying Overlay: apalis-imx6_hdmi_overlay.dtbo
398 bytes read in 29 ms (12.7 KiB/s)
8430080 bytes read in 250 ms (32.2 MiB/s)
8045022 bytes read in 241 ms (31.8 MiB/s)
## Flattened Device Tree blob at 12100000
   Booting using the fdt blob at 0x12100000
   Loading Ramdisk to 2f853000, end 2ffff1de ... OK
   Loading Device Tree to 2f81f000, end 2f852fff ... OK

Starting kernel ...

[    2.945169] rtc-ds1307 0-0068: hctosys: unable to read the hardware clock
Starting version 244.3+

Torizoncore Upstream 5.1.0+build.1 apalis-imx6-10657251 ttymxc0

apalis-imx6-10657251 login: [  138.698559] watchdog: watchdog0: watchdog did not stop!
[  139.145196] imx2-wdt 20bc000.wdog: Device shutdown: Expect reboot!
[  139.151487] reboot: Restarting system

I

ndustrial temperature grade DDR3 timings.
Trying to boot from MMC1


U-Boot 2020.07-5.1.0+git.f34eb0c0ac97 (Jan 01 1970 - 00:00:00 +0000)

CPU:   Freescale i.MX6D rev1.6 at 792MHz
CPU:   Industrial temperature grade (-40C to 105C) at 34C
Reset cause: WDOG
DRAM:  1 GiB
PMIC:  device id: 0x10, revision id: 0x21, programmed
MMC:   FSL_SDHC: 1, FSL_SDHC: 2, FSL_SDHC: 0
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Apalis iMX6 Dual 1GB IT V1.1B, Serial# 10657251
Net:   eth0: ethernet@2188000
Hit any key to stop autoboot:  0
MMC: no card present
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
1007 bytes read in 11 ms (88.9 KiB/s)
## Executing script at 17000000
3835 bytes read in 22 ms (169.9 KiB/s)
69456 bytes read in 30 ms (2.2 MiB/s)
141 bytes read in 25 ms (4.9 KiB/s)
Applying Overlay: apalis-imx6_parallel-rgb_overlay.dtbo
766 bytes read in 31 ms (23.4 KiB/s)
Applying Overlay: display-edt7_overlay.dtbo
803 bytes read in 31 ms (24.4 KiB/s)
Applying Overlay: apalis-imx6_stmpe-ts_overlay.dtbo
402 bytes read in 30 ms (12.7 KiB/s)
Applying Overlay: apalis-imx6_hdmi_overlay.dtbo
398 bytes read in 30 ms (12.7 KiB/s)
8430080 bytes read in 250 ms (32.2 MiB/s)
8045022 bytes read in 241 ms (31.8 MiB/s)
## Flattened Device Tree blob at 12100000
   Booting using the fdt blob at 0x12100000
   Loading Ramdisk to 2f853000, end 2ffff1de ... OK
   Loading Device Tree to 2f81f000, end 2f852fff ... OK

Starting kernel ...

[    3.467217] rtc-ds1307 0-0068: hctosys: unable to read the hardware clock
Starting version 244.3+

Based on your logs it seems like a connection error as you thought. Also if I’m interpreting these logs correctly it seems you registered the device with hostname: apalis-imx6-10657251, correct?

Can you try instead to register with the device’s IP address instead? We have noticed using the hostname is problematic on some systems/networks. Though usually using the explicit IP address should be fine. Alternatively you can also try appending .local onto the hostname like this: apalis-imx6-10657251.local. Try either of these options and let me know if that helps or produces a different result.

Best Regards,
Jeremias

So the .local did not work. And I am not sure what my ip address is. So in the serial console I type ifconfig with this response
ifconfig
br-2aa161812c5d: flags=4163 mtu 1500 metric 1
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
inet6 fe80::42:c0ff:fe3a:7cbc prefixlen 64 scopeid 0x20
ether 02:42:c0:3a:7c:bc txqueuelen 0 (Ethernet)
RX packets 219 bytes 14940 (14.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 65 bytes 7405 (7.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

docker0: flags=4099 mtu 1500 metric 1
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:be:28:c2:4c txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ethernet0: flags=4163 mtu 1500 metric 1
ether 00:14:2d:a2:9d:e3 txqueuelen 1000 (Ethernet)
RX packets 273 bytes 28956 (28.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 92 bytes 16479 (16.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 65536 metric 1
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 80 bytes 6128 (5.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 80 bytes 6128 (5.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

vethd0db58b: flags=4163 mtu 1500 metric 1
inet6 fe80::a869:8fff:fee2:2e57 prefixlen 64 scopeid 0x20
ether aa:69:8f:e2:2e:57 txqueuelen 0 (Ethernet)
RX packets 693 bytes 5133931 (4.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 391 bytes 34519 (33.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

vethd2de550: flags=4163 mtu 1500 metric 1
inet6 fe80::a829:71ff:fe29:ef70 prefixlen 64 scopeid 0x20
ether aa:29:71:29:ef:70 txqueuelen 0 (Ethernet)
RX packets 539 bytes 42617 (41.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 754 bytes 5140414 (4.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Tried 172.18.0.1, didnt work. How do I determine my ip address?

If in serial console I enter nmcli device the ethernet0 says connnecting, then eventually disconnected. On my PC I attcheck an ethernet cable from my pc to the apalis IMX6, then in my networks connections, I made the wifi properities shareable to ethernet0. Am I missing something here?

Well I think I found your issue. Your ethernet0 interface has no IP address!

You say you have the device’s ethernet connected to your laptop. Well I’m unsure of what other configuration are required but it seems an IP address isn’t being served to the device. Which would explain the various connection issues.

Just as a check can you connect the device to your network via router or something similar?

Best Regards,
Jeremias