LangenGroup / RedPitayaSTCL

A scanning transfer cavity laser stabilization scheme based on the Red Pitaya STEMlab platform
GNU General Public License v3.0
10 stars 1 forks source link

ssh connect hangs if the device cannot be found #2

Closed andrewvh4 closed 1 year ago

andrewvh4 commented 1 year ago

ssh connect hangs if the device cannot be found:

https://github.com/LangenGroup/RedPitayaSTCL/blob/f5bec44b9492a81275b989f265fa5b672dc28a1e/communication.py#L192C1-L192C1

Steps to reproduce:

  1. Disconnect the host computer from the network containing the RPTs
  2. Add the following debug print statements around the aforementioned line
    print("Pre Connect")
    ssh.connect(hostname, port = 22, username='root', password = 'root')
    print("Post Connect")

I received the following terminal output

/home/andrew/miniconda3/envs/STCL/lib/python3.10/site-packages/paramiko/transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,
Pre Connect

The program then freezes.

LangenGroup commented 1 year ago

Added a timeout to fix this.