Opentrons / opentrons-integration-tools

Guides and code snippets for integrating external devices with Opentrons
Apache License 2.0
22 stars 6 forks source link

bug: atomic_command - can not "loadLabware" with custom labware to empty run #11

Open FlorMaye opened 1 year ago

FlorMaye commented 1 year ago

I'm using the http api and the atomic commands Loading a custom labware with the atomic "loadLabware" command seems not to work. My custom labware "custom_1_tuberack_50ul" is uploaded to the OT2 with the Opentrons app, it has the namespace "custom_beta".

The command dict looks like following:

command_dict = { "data": { "commandType": "loadLabware", "params": { "location": {"slotName": "4"}, "loadName": "custom_1_tuberack_50ul", "namespace": "custom_beta", "version": 1 }, "intent": "setup" } }

Error response over requests: {'data': {'id': '5cbc1660-a7ba-4bfa-9e05-d8dc5c5dded4', 'createdAt': '2023-06-19T14:54:37.747224+00:00', 'commandType': 'loadLabware', 'key': '5cbc1660-a7ba-4bfa-9e05-d8dc5c5dded4', 'status': 'failed', 'params': {'location': {'slotName': '6'}, 'loadName': 'custom_1_tuberack_50ul', 'namespace': 'custom_beta', 'version': 1}, 'error': {'id': '98a440c6-25bc-494f-ae3a-d0459af68baf', 'errorType': 'UnexpectedProtocolError', 'createdAt': '2023-06-19T14:54:37.761653+00:00', 'detail': 'Labware "custom_1_tuberack_50ul" not found with version 1 in namespace "custom_beta".'}, 'startedAt': '2023-06-19T14:54:37.749101+00:00', 'completedAt': '2023-06-19T14:54:37.761653+00:00', 'intent': 'setup'}}

DangerLin commented 1 year ago

Hi @FlorMaye, I have a similar situation. It seems that in the HTTP API, you need to redefine your custom labware in the code. You can see Add a labware definition to a run to add your custom labware via HTTP. Here is my own example that defines a custom 96-well plate:

command_dict = {
    "data": 
        {
        "schemaVersion": 2,
        "version": 1,
        "namespace": "custom_beta",
        "metadata": {
          "displayName": "VWR 96 Well Plate 350 µL",
          "displayCategory": "wellPlate",
          "displayVolumeUnits": "µL"
        },
        "brand": {
          "brand": "VWR"
        },
        "parameters": {
          "format": "96Standard",
          "isTiprack": False,
          "loadName": "vwr_96_wellplate_350ul", 
          "isMagneticModuleCompatible": False
        },
        "ordering": [
          ["A1","B1","C1","D1","E1","F1","G1","H1"],
          ["A2","B2","C2","D2","E2","F2","G2","H2"],
          ["A3","B3","C3","D3","E3","F3","G3","H3"],
          ["A4","B4","C4","D4","E4","F4","G4","H4"],
          ["A5","B5","C5","D5","E5","F5","G5","H5"],
          ["A6","B6","C6","D6","E6","F6","G6","H6"],
          ["A7","B7","C7","D7","E7","F7","G7","H7"],
          ["A8","B8","C8","D8","E8","F8","G8","H8"],
          ["A9","B9","C9","D9","E9","F9","G9","H9"],
          ["A10","B10","C10","D10","E10","F10","G10","H10"],
          ["A11","B11","C11","D11","E11","F11","G11","H11"],
          ["A12","B12","C12","D12","E12","F12","G12","H12"]
        ],
        "cornerOffsetFromSlot": {
          "x": 0,
          "y": 0,
          "z": 0
        },
        "dimensions": {
          "yDimension":85,
          "zDimension": 14.1,
          "xDimension": 127
        },
        "wells": {
          "A1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":73.58,"z":3.95},
          "B1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":64.68,"z":3.95},
          "C1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":55.78,"z":3.95},
          "D1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":46.88,"z":3.95},
          "E1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":37.98,"z":3.95},
          "F1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":29.08,"z":3.95},
          "G1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":20.18,"z":3.95},
          "H1":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":14,"y":11.28,"z":3.95},
          "A2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":73.58,"z":3.95},
          "B2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":64.68,"z":3.95},
          "C2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":55.78,"z":3.95},
          "D2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":46.88,"z":3.95},
          "E2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":37.98,"z":3.95},
          "F2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":29.08,"z":3.95},
          "G2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":20.18,"z":3.95},
          "H2":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":22.9,"y":11.28,"z":3.95},
          "A3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":73.58,"z":3.95},
          "B3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":64.68,"z":3.95},
          "C3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":55.78,"z":3.95},
          "D3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":46.88,"z":3.95},
          "E3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":37.98,"z":3.95},
          "F3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":29.08,"z":3.95},
          "G3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":20.18,"z":3.95},
          "H3":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":31.8,"y":11.28,"z":3.95},
          "A4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":73.58,"z":3.95},
          "B4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":64.68,"z":3.95},
          "C4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":55.78,"z":3.95},
          "D4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":46.88,"z":3.95},
          "E4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":37.98,"z":3.95},
          "F4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":29.08,"z":3.95},
          "G4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":20.18,"z":3.95},
          "H4":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":40.7,"y":11.28,"z":3.95},
          "A5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":73.58,"z":3.95},
          "B5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":64.68,"z":3.95},
          "C5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":55.78,"z":3.95},
          "D5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":46.88,"z":3.95},
          "E5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":37.98,"z":3.95},
          "F5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":29.08,"z":3.95},
          "G5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":20.18,"z":3.95},
          "H5":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":49.6,"y":11.28,"z":3.95},
          "A6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":73.58,"z":3.95},
          "B6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":64.68,"z":3.95},
          "C6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":55.78,"z":3.95},
          "D6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":46.88,"z":3.95},
          "E6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":37.98,"z":3.95},
          "F6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":29.08,"z":3.95},
          "G6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":20.18,"z":3.95},
          "H6":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":58.5,"y":11.28,"z":3.95},
          "A7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":73.58,"z":3.95},
          "B7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":64.68,"z":3.95},
          "C7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":55.78,"z":3.95},
          "D7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":46.88,"z":3.95},
          "E7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":37.98,"z":3.95},
          "F7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":29.08,"z":3.95},
          "G7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":20.18,"z":3.95},
          "H7":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":67.4,"y":11.28,"z":3.95},
          "A8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":73.58,"z":3.95},
          "B8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":64.68,"z":3.95},
          "C8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":55.78,"z":3.95},
          "D8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":46.88,"z":3.95},
          "E8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":37.98,"z":3.95},
          "F8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":29.08,"z":3.95},
          "G8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":20.18,"z":3.95},
          "H8":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":76.3,"y":11.28,"z":3.95},
          "A9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":73.58,"z":3.95},
          "B9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":64.68,"z":3.95},
          "C9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":55.78,"z":3.95},
          "D9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":46.88,"z":3.95},
          "E9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":37.98,"z":3.95},
          "F9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":29.08,"z":3.95},
          "G9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":20.18,"z":3.95},
          "H9":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":85.2,"y":11.28,"z":3.95},
          "A10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":73.58,"z":3.95},
          "B10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":64.68,"z":3.95},
          "C10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":55.78,"z":3.95}, 
          "D10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":46.88,"z":3.95},
          "E10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":37.98,"z":3.95},
          "F10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":29.08,"z":3.95},
          "G10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":20.18,"z":3.95},
          "H10":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":94.1,"y":11.28,"z":3.95},
          "A11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":73.58,"z":3.95},
          "B11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":64.68,"z":3.95},
          "C11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":55.78,"z":3.95},
          "D11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":46.88,"z":3.95},
          "E11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":37.98,"z":3.95},
          "F11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":29.08,"z":3.95},
          "G11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":20.18,"z":3.95},
          "H11":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":103,"y":11.28,"z":3.95},
          "A12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":73.58,"z":3.95},
          "B12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":64.68,"z":3.95},
          "C12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":55.78,"z":3.95},
          "D12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":46.88,"z":3.95},
          "E12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":37.98,"z":3.95},
          "F12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":29.08,"z":3.95},
          "G12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":20.18,"z":3.95},
          "H12":{"depth":10.15,"totalLiquidVolume":350,"shape":"circular","diameter":6.7,"x":111.9,"y":11.28,"z":3.95}
        },
        "groups": [
          {
            "wells": [
              "A1","B1","C1","D1","E1","F1","G1","H1",
              "A2","B2","C2","D2","E2","F2","G2","H2",
              "A3","B3","C3","D3","E3","F3","G3","H3",
              "A4","B4","C4","D4","E4","F4","G4","H4",
              "A5","B5","C5","D5","E5","F5","G5","H5",
              "A6","B6","C6","D6","E6","F6","G6","H6",
              "A7","B7","C7","D7","E7","F7","G7","H7",
              "A8","B8","C8","D8","E8","F8","G8","H8",
              "A9","B9","C9","D9","E9","F9","G9","H9",
              "A10","B10","C10","D10","E10","F10","G10","H10",
              "A11","B11","C11","D11","E11","F11","G11","H11",
              "A12","B12","C12","D12","E12","F12","G12","H12"
            ],
            "metadata": {
              "displayName": "VWR 96 Well Plate 350 µL",
              "displayCategory": "wellPlate",
              "wellBottomShape": "u"
            },
            "brand": {
              "brand": "VWR"
            }
          }
        ]
      }
}
command_payload = json.dumps(command_dict)

r = requests.post(
    url=actions_url,
    headers=HEADERS,
    data=command_payload
    )

The corresponding parameters of your labware can be found in the JSON file that was generated in the labware creator.