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. Open the file Pipfile.

  4. In the packages section, add the lines listed on your specific hardware’s page in the Pipfile section.

  5. Run pipenv lock in the terminal window. Wait until the command has completed - this will take a few minutes and it will update the Pipfile.lock for you.

  6. Rebuild your container. In Visual Studio Code, press Ctrl-Shift-P to open the command palette. Type Rebuild Container Without Cache and select that command to run it.

  7. 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.

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

  9. 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.

  10. 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.

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

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