SSH & Boot2Qt not connecting on Windows
-
wrote on 9 Feb 2022, 10:30 last edited by
This post follows on from a previous saga....!
For no apparent reason our Toradex Apalis running boot2qt 5 stopped working and we couldn't access the device via SSH or deploy applications via Qt Creator (over USB). To get around this I upgraded and installed Qt 6.2.1 and then the SSH started working again! A week or so later, the same problem appeared and we cannot SSH into the device again...
I am guessing this means there is an issue with the hosts SSH configuration?
The Toradex Apalis shows as a QDebug device in the Windows device manager. And there are some RDNIS devices listed as connected to the PC but with IP disabled. e.g.
PS > Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=FALSE DHCPEnabled : True IPAddress : DefaultIPGateway : DNSDomain : ServiceName : usbrndis6 Description : Remote NDIS Compatible Device Index : 20 DHCPEnabled : True IPAddress : DefaultIPGateway : DNSDomain : ServiceName : usbrndis6 Description : Remote NDIS Compatible Device Index : 21
One of these could be the Apalis?? ^^^ That would mean the IP address hasn't been made?
I also tried connecting via SSH using PowerShell and Git Bash:
PowerShell
PS> ssh -vvv root@172.16.58.1 OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 debug3: Failed to open file:C:/Users/pen/.ssh/config error:2 debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2 debug2: resolve_canonicalize: hostname 172.16.58.1 is address debug2: ssh_connect_direct debug1: Connecting to 172.16.58.1 [172.16.58.1] port 22. debug3: finish_connect - ERROR: async io completed with error: 10060, io:000002163D580A50 debug1: connect to address 172.16.58.1 port 22: Connection timed out ssh: connect to host 172.16.58.1 port 22: Connection timed out
Git Bash:
MINGW64 ~$ ssh -vvv root@172.16.58.1 OpenSSH_8.5p1, OpenSSL 1.1.1j 16 Feb 2021 debug1: Reading configuration data /etc/ssh/ssh_config debug2: resolve_canonicalize: hostname 172.16.58.1 is address debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/c/Users/penme/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/c/Users/penme/.ssh/known_hosts2' debug3: ssh_connect_direct: entering debug1: Connecting to 172.16.58.1 [172.16.58.1] port 22. debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug1: connect to address 172.16.58.1 port 22: Connection timed out ssh: connect to host 172.16.58.1 port 22: Connection timed out
Qt Creator test:
Connecting to host... Checking kernel version... uname failed. Checking if specified ports are available... Error gathering ports: Remote process crashed: Remote process crashed. Device test failed.
I can see that the PowerShell SSH is missing some files, but the Git Bash doesn't appear to be.
Does anyone have any obvious suggestions for what the issue is, or any advice for debugging the SSH connection? Is this likely a Windows issue? Is there some configuration on the Apalis and boot2qt I need to fix?
Thanks for you help
-
wrote on 9 Feb 2022, 10:36 last edited by
Set
QT_LOGGING_RULES=qtc.ssh*=true
as environment variable before starting Qt Creator.In order to see the logging on Windows you need to have a logging viewer like DebugView, DebugViewPP, or start Qt Creator from Qt Creator itself by having a dummy project and exchange the executable with Qt Creator's executable.
-
Set
QT_LOGGING_RULES=qtc.ssh*=true
as environment variable before starting Qt Creator.In order to see the logging on Windows you need to have a logging viewer like DebugView, DebugViewPP, or start Qt Creator from Qt Creator itself by having a dummy project and exchange the executable with Qt Creator's executable.
wrote on 9 Feb 2022, 11:13 last edited by@cristian-adam Thanks for getting back to me.
I ran Qt Creator with the Debug view and got these logs when running the device test in Qt Creator:
[2988] qtc.ssh: starting remote process: "C:\\Program Files\\Git\\usr\\bin\\ssh.exe -q -o \"StrictHostKeyChecking=no\" -o \"User=root\" -o \"Port=22\" -o \"ConnectTimeout=10\" 172.16.58.1 \"uname -rsm\"" [2988] qtc.ssh: starting remote process: "C:\\Program Files\\Git\\usr\\bin\\ssh.exe -q -o \"StrictHostKeyChecking=no\" -o \"User=root\" -o \"Port=22\" -o \"ConnectTimeout=10\" 172.16.58.1 \"test -f /etc/profile && . /etc/profile ; test -f $HOME/.profile && . $HOME/.profile ; echo __qtc$$__qtc && exec sed -e 's/.*: [[:xdigit:]]*:\\([[:xdigit:]]\\{4\\}\\).*/\\1/g' /proc/net/tcp*\""
I guess these arent a huge amount of help, at least it confirms we are using the Git Bash SSH, not the PowerShell. Maybe that means there is an issue with configuration on the target device?
-
wrote on 25 Feb 2022, 12:35 last edited by
Can you look what the QDB has logged in %APPDATA%\qdb\qdb.log. QDB manages the network setup over USB, if the IP address it not assigned correctly, the log might reveal something.