Setting up SSH access to OT-2

Hi All,
I want to access to my OT-2 via SSH. I followed every steps from the website support page but when I tried to upload the “public key” I got this error:

Invoke-WebRequest : 500 Internal Server Error Server got itself in trouble
At line:1 char:70
+ ... rtTo-Json | Invoke-WebRequest -Method Post -ContentType 'application/ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Does anyone have experience of doing this before?

1 Like

Hey @wefowit528 This error can happen if you connect to your OT-2 via Wi-Fi, instead of via a cable. For security, we only accept new SSH keys when there’s a direct wired connection between the computer and the OT-2 (a “link-local” connection), not a wireless connection. This is meant to prove that the person trying to add the SSH key has physical access to the OT-2.
Here’s the Github: Connecting to Opentrons using Windows 10/MAC gives "Invoke-Webreuqest: : {"error": "bad-interface", "message": "The endpoint http://127.0.0.1:34000/server/ssh_keys can only be used from local connections"}" · Issue #7533 · Opentrons/opentrons · GitHub

1 Like

Hi all,
I am controlling OT-2 via Python script through SSH. But I am experiencing a very long delay time. The OT-2 only moves about 3 minutes later after I run my code. In my code, I build SSH connection first, and upload protocols and a few json files to OT-2, and run the protocol finally.

Anyone has any idea why there is a long time control delay or has a better way to control the OT-2?

Any advice is appreciated!

Is there a reason you chose the SSH over the native opentrons app?
Just interested, since I have always used the app to run my python scripts, but am willing to try different things, if they are better :wink:

Hey Eric, Our ssh features are not heavily supported. Code execution time can depend on how many steps the protocol is. The more processing the code has to do, the longer it takes to execute. The connection can also take some time to initialize (time until you see the opentrons logo in the terminal).

I would recommend the user switch to our HTTP API. This is fully supported since our Run Apps are user interfaces that use the HTTP API. It also has much more documentation than ssh.