Hardware-Specific Adapter Setup#

  1. We will be copying some code from your specific hardware’s webpage. Find it in the list in Supported Equipment and leave it open in a browser tab.

  2. Open your adapter’s git repository in Visual Studio Code. Make sure you open it in the container.

  3. In the packages section, run the command listed on your specific hardware’s page in the pyproject.toml section.

  4. In your adapter repository, within the configs folder, you will find one or more subfolders–each corresponding to a different configuration context. Create a new folder in the configs folder named tutorial.

  5. Inside that folder, make sure to place the secrets.yaml you created in the guide for Set Up a Local Dev Container.

  6. Also inside that folder, copy the config.yaml exactly as listed on your specific hardware’s page and follow any instructions given for that specific hardware’s config.yaml customization.

  7. For the config.yaml, you also need to customize:
    1. The entire artificial section needs to be set to the correct instance. You can get the entire deployment config from your Artificial’s settings page by following these steps:
      1. Go to your instance in Artificial.

      2. Click on the Settings icon.

      3. Select the correct lab under the Labs section.

      4. Scroll down to the Deployment Config section and copy the entire artificial section there into your yaml file in place of the existing artificial section.

    2. In the asset_sync section, update the rid guid to the one matching your device. The rid can be obtained by:
      1. logging into your instance and selecting the correct Lab.

      2. Click on the equipment to select it and click on the Edit asset details icon on the far right.

      3. In the right pane, under Debug copy the instance ID (this is the rid) and copy it into the adapter’s config.yaml file.

    3. For more advanced use cases, consult Adapter Configuration.

  8. Next, replace the entire contents of the adapter/main/plugin.py file with those listed on your specific hardware’s page.

  9. Then, update the actors list in the adapter/main/__main__.py file with those listed on your specific hardware’s page.

  10. Set this as the active context by replacing the configs/context.yaml file with the one below.
    configs/context.yaml#
    activeContext: tutorial
    
  11. This should successfully set up the driver-specific portions of the adapter. You should continue following the guide that sent you here.