Skip to content

ssl backend for thermo / applied biosystems ATC automated thermal cycler - #762

Merged
rickwierenga merged 4 commits into
PyLabRobot:tftc-sslfrom
ben-ray:ray/ssl-atc
Nov 22, 2025
Merged

ssl backend for thermo / applied biosystems ATC automated thermal cycler#762
rickwierenga merged 4 commits into
PyLabRobot:tftc-sslfrom
ben-ray:ray/ssl-atc

Conversation

@ben-ray

@ben-ray ben-ray commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

My 384 ATC never was able to connect by IP alone in the .exe software, but could connect by SSL. This adds SSL connection as an option to PLR by inputting a hostname into thermal cycler setup, like so:

backend = ATCBackend(
    ip=my_instrument_ip,
    port=7443, # yours might be different
    hostname="my_instrument_serial_number",
)

atc = Thermocycler(
    name="atc384",
    backend=backend,
    size_x=0, size_y=0, size_z=0,
    child_location=Coordinate(0,0,0)
)

await atc.setup()

if self.bid != "31":
raise NotImplementedError("Lid control is only available for BID 31 (ATC)")
res = await self.send_command({"cmd": "lidclose"}, response_timeout=20, read_once=False)
res = await self.send_command({"cmd": "lidclose"}, response_timeout=20, read_once=True)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least when using SSL, this command will timeout if I use read_once = False, but with read_once = True, the command completes when the instrument is physically finished with the movement

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fixed in #761, but read_once should be fine here. what do you think @xbtu2 ?

if self.bid != "31":
raise NotImplementedError("Lid control is only available for BID 31 (ATC)")
res = await self.send_command({"cmd": "lidopen"}, response_timeout=20, read_once=False)
res = await self.send_command({"cmd": "lidopen"}, response_timeout=25, read_once=True)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it takes more than 20 seconds to open lid (~22 for me), hence increasing timeout to 25

@xbtu2

xbtu2 commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

my pr for the same function was submitted minutes ago lol


if hostname is not None: # ssl connect
self.is_ssl = True
self.device_shared_secret = b"53rv1c3" + hostname.encode("ascii")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the instrument uses a different shared secret for ssl compared to non-ssl, so I remove the shared-secret option from the backend so the connection always uses the correct shared secret for ssl vs non-ssl

@rickwierenga
rickwierenga changed the base branch from main to tftc-ssl November 22, 2025 20:16
@rickwierenga
rickwierenga merged commit a8f3b60 into PyLabRobot:tftc-ssl Nov 22, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants