Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reliably track robot identity across renames #10689

Closed
SyntaxColoring opened this issue Jun 8, 2022 · 4 comments
Closed

Reliably track robot identity across renames #10689

SyntaxColoring opened this issue Jun 8, 2022 · 4 comments
Labels
6.0-feedback Feedback for the 6.0 release app Affects the `app` project discovery-client robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).

Comments

@SyntaxColoring
Copy link
Contributor

SyntaxColoring commented Jun 8, 2022

Overview

The robot discovery system currently listens for robots on the network and keeps track of them by their IP addresses and human-readable names.

This is problematic because both of those things are transient. IP addresses can change as DHCP leases expire, and users can rename robots.

So, for example, the Opentrons App has no reliable way to distinguish between:

  • A robot's name changing from A to B.
  • The A robot going offline, and then a different B robot appearing for the first time.

Which can cause the UI to present things in a confusing way.

In certain cases, the Opentrons App might be able to handle this heuristically. For example, if it is the thing that triggered the rename from A to B in the first place, it can know that the "new" robot called A is really the same thing as the B robot that just disappeared. But this can't hold up in the general case because robots can change their names under command from other clients, or even on their own (to automatically deconflict with other devices on the network). And it would be prone to timing-related fragility.

So, the Opentrons App needs a way of tracking robot identity that's independent from names and IP addresses.

Acceptance criteria

  • The Opentrons App (or the discovery client?) can distinguish between a robot's name changing from A to B versus the A robot going offline and then a different B robot appearing for the first time.
    • For example, it should not leave behind a duplicate entry in the Devices list for the old robot.
    • This should hold even when the robot's name changed on its own, without explicit action from the user.
  • The Opentrons App can (or the discovery client?) can distinguish between two physically different robots that happen to have the same name.

Implementation options

We can have the Opentrons App and discovery client use some new form of robot ID. Options:

  • The robot's serial number, which is already accessible over HTTP.
  • The mDNS host (<hostname>.local). With the way the robot software is currently set up, <hostname> is the robot's serial number, when everything is working correctly. So this should be functionally equivalent to that.
  • Some new opaque identifier string—call it machineId for the sake of discussion—that we would expose over HTTP.
    • We have several good options for this on the robot side, including MAC addresses or the systemd machine-id.
@SyntaxColoring SyntaxColoring added app Affects the `app` project feature-request A request for a new feature or a change that isn't a bug. May require further triage or scoping. robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). discovery-client labels Jun 8, 2022
@SyntaxColoring SyntaxColoring removed the feature-request A request for a new feature or a change that isn't a bug. May require further triage or scoping. label Jun 10, 2022
@mcous
Copy link
Contributor

mcous commented Jun 10, 2022

I like machine-id for this. A problem is that we want a local dev server to be relatively transparently available in the app, but that seems relatively solvable to fake with the dev server (e.g. by dropping something in ~/.opentrons)

@SyntaxColoring
Copy link
Contributor Author

Another question is exactly how we should expose this ID.

  • Reading it by HTTP polls. I think we need this in order to support the case where mDNS isn't involved in robot discovery at all, and the discovery client is just polling a static list of IP addresses.
  • Reading it as part of receiving an mDNS advertisement. I'm not sure exactly how necessary this is, but it could help keep track of a robot's identity when the robot's robot-server and update-server are unreachable. mDNS and Avahi do let us tack a small amount of arbitrary data onto the robot's advertisements (as a TXT record), but I'm not sure if our client-side mDNS library supports parsing it out.

@mcous
Copy link
Contributor

mcous commented Jun 10, 2022

Ideally, we'd have this bit of information present in all three sources. Less ideally, I think it's workable if it's missing from mDNS

@SyntaxColoring
Copy link
Contributor Author

Migrated to RSS-489.

@SyntaxColoring SyntaxColoring closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.0-feedback Feedback for the 6.0 release app Affects the `app` project discovery-client robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).
Projects
None yet
Development

No branches or pull requests

3 participants