Search code examples
python-3.5raspberry-pi3chilkat

Failed to establish initial TCP/IP connection (Chilkat-Python)


I'm trying to send a file from raspberry pi to my Windows pc using python-chilkat module. However it is returning this kind of error:

ChilkatLog: Connect_Ssh: DllDate: Dec 21 2018 ChilkatVersion: 9.5.0.76 UnlockPrefix: 30-day trial Architecture: Little Endian; 32-bit Language: armhf linux Python 3.* VerboseLogging: 0 connectInner:
hostname: 192.168.1.4 port: 22 sshConnect: connectSocket: connect_ipv6_or_ipv4: getsockopt indicates an error. socketErrno: 111 socketError: Connection refused --connect_ipv6_or_ipv4 connect_ipv6_or_ipv4: getsockopt indicates an error. socketErrno: 111 socketError: Connection refused --connect_ipv6_or_ipv4 connect_ipv6_or_ipv4: getsockopt indicates an error. socketErrno: 111 socketError: Connection refused --connect_ipv6_or_ipv4 connect_ipv6_or_ipv4: getsockopt indicates an error. socketErrno: 111 socketError: Connection refused --connect_ipv6_or_ipv4 --connectSocket Failed to establish initial TCP/IP connection hostname: 192.168.1.4 port: 22 --sshConnect --connectInner Failed. --Connect_Ssh --ChilkatLog

Can someone explain to me why Im getting these error?


Solution

  • See this online example which experiments with different failure cases to see what errors are returned: https://www.example-code.com/chilkat2-python/socket_connect_fail.asp

    In some of the test cases, you'll see "connection rejected" which is the same as "connection refused". In other cases you'll get a timeout. The cases that result in "connection rejected" are the most likely causes for the failure.

    PS> I understand that the example I'm pointing to is for a simple TCP socket connection, but SSH begins with a simple TCP connection, and that is what is failing.