Pumpkin Board Setup Guide

To use a Mediatek Genio 500 Pumpkin single-board computer with Viam:

  1. Install viam-server on your machine.
  2. Create a board definitions file, specifying the mapping between your board’s GPIO pins and connected hardware.
  3. Configure a customlinux board on your machine, specifying the path to the definitions file in the board configuration.

Install viam-server

viam-server is the open-source software that drives your hardware and connects your device to the cloud. Install viam-server on the computer or single-board computer (SBC) that is directly connected to your hardware (for example sensors, cameras, or motors):

  1. Make sure your computer or SBC is powered on and connected to the internet.

  2. Create a Viam account on app.viam.com. You can configure and manage devices and data collection in the web UI.

  3. Create a new machine using the Add machine button in the top right corner of the LOCATIONS tab in the app. A machine represents your device.

  4. On your machine’s page, click View setup instructions.

  5. Select Linux / Aarch64.

  6. Select your installation method:

    • viam-agent (recommended): installs viam-agent, which will automatically install (and update) viam-server and provide additional functionality such as provisioning and operating system update configuration.
    • manual: installs only viam-server on your machine.
  7. Follow the instructions on the page to install viam-server and connect it to the cloud with your machine’s unique credentials.

  8. After you install viam-server, a secure connection is automatically established between your machine and Viam. When you update your machine’s configuration, viam-server automatically gets the updates.

    You are ready to configure supported hardware on your machine.

Create a board definitions file

The board definitions file describes the location of each GPIO pin on the board so that viam-server can access the pins correctly.

On your Pumpkin board, create a JSON file in the /home/root directory named board.json, and provide the mappings between your GPIO pins and connected hardware. Use the template and example below to populate the JSON file with a single key, "pins", whose value is a list of objects that each represent a pin on the board.

{
  "pins": [
    {
      "name": "3",
      "device_name": "gpiochip0",
      "line_number": 81,
      "pwm_id": -1
    },
    {
      "name": "5",
      "device_name": "gpiochip0",
      "line_number": 84,
      "pwm_id": -1
    },
    {
      "name": "7",
      "device_name": "gpiochip0",
      "line_number": 150,
      "pwm_id": -1
    },
    {
      "name": "11",
      "device_name": "gpiochip0",
      "line_number": 173,
      "pwm_id": -1
    },
    {
      "name": "13",
      "device_name": "gpiochip0",
      "line_number": 152,
      "pwm_id": -1
    },
    {
      "name": "15",
      "device_name": "gpiochip0",
      "line_number": 94,
      "pwm_id": -1
    },
    {
      "name": "19",
      "device_name": "gpiochip0",
      "line_number": 163,
      "pwm_id": -1
    },
    {
      "name": "21",
      "device_name": "gpiochip0",
      "line_number": 161,
      "pwm_id": -1
    },
    {
      "name": "23",
      "device_name": "gpiochip0",
      "line_number": 164,
      "pwm_id": -1
    },
    {
      "name": "27",
      "device_name": "gpiochip0",
      "line_number": 82,
      "pwm_id": -1
    },
    {
      "name": "29",
      "device_name": "gpiochip0",
      "line_number": 98,
      "pwm_id": -1
    },
    {
      "name": "31",
      "device_name": "gpiochip0",
      "line_number": 12,
      "pwm_id": -1
    },
    {
      "name": "33",
      "device_name": "gpiochip0",
      "line_number": 101,
      "pwm_id": -1
    },
    {
      "name": "35",
      "device_name": "gpiochip0",
      "line_number": 171,
      "pwm_id": -1
    },
    {
      "name": "37",
      "device_name": "gpiochip0",
      "line_number": 169,
      "pwm_id": -1
    },
    {
      "name": "8",
      "device_name": "gpiochip0",
      "line_number": 115,
      "pwm_id": -1
    },
    {
      "name": "10",
      "device_name": "gpiochip0",
      "line_number": 121,
      "pwm_id": -1
    },
    {
      "name": "12",
      "device_name": "gpiochip0",
      "line_number": 170,
      "pwm_id": -1
    },
    {
      "name": "16",
      "device_name": "gpiochip0",
      "line_number": 165,
      "pwm_id": -1
    },
    {
      "name": "18",
      "device_name": "gpiochip0",
      "line_number": 1,
      "pwm_id": -1
    },
    {
      "name": "22",
      "device_name": "gpiochip0",
      "line_number": 2,
      "pwm_id": -1
    },
    {
      "name": "24",
      "device_name": "gpiochip0",
      "line_number": 162,
      "pwm_id": -1
    },
    {
      "name": "26",
      "device_name": "gpiochip0",
      "line_number": 0,
      "pwm_id": -1
    },
    {
      "name": "28",
      "device_name": "gpiochip0",
      "line_number": 83,
      "pwm_id": -1
    },
    {
      "name": "32",
      "device_name": "gpiochip0",
      "line_number": 97,
      "pwm_id": -1
    },
    {
      "name": "36",
      "device_name": "gpiochip0",
      "line_number": 151,
      "pwm_id": -1
    },
    {
      "name": "38",
      "device_name": "gpiochip0",
      "line_number": 174,
      "pwm_id": -1
    },
    {
      "name": "40",
      "device_name": "gpiochip0",
      "line_number": 172,
      "pwm_id": -1
    }
  ]
}

Configure a customlinux board

Configure your board as a customlinux board to use your board definitions file:

Navigate to the CONFIGURE tab of your machine’s page. Click the + icon next to your machine part in the left-hand menu and select Component or service. Select the board type, then select the customlinux model. Enter a name or use the suggested name for your customlinux board and click Create.

Example configuration for a pumpkin board using customlinux

Copy and paste the following json object into your board’s attributes field.

{
  "board_defs_file_path": "/home/root/board.json"
}
{
  "components": [
    {
      "name": "myCustomBoard",
      "model": "customlinux",
      "api": "rdk:component:board",
      "attributes": {
        "board_defs_file_path": "/home/root/board.json"
      },
      "depends_on": []
    }
  ]
}

Try an example

Once you’ve installed viam-server and your machine has come online, if your machine has a webcam, you can try an example project:

  1. Click the + icon next to your machine part in the left-hand menu and select Insert Fragment.

    Add the DeskSafariGame fragment by the Robot Land organization and click Insert Fragment. This adds a number of resources to your machine:

    • a camera component which connects to the webcam
    • machine learning resources to run a model and apply it to the camera stream
    • control logic that implements a game
  2. Save your config and review the available resources on the CONFIGURE tab.

  3. Log into this Viam application with your Viam credentials and select your machine. The application provides a UI for playing the game

  4. Select a camera and press the Start Game button. The goal of the game is to find and show specific objects to the camera.

If you’d like to learn how to create this game, see the Desk Safari tutorial.

Should the game not work, return to your machine in the Viam web UI and check the LOGS tab for errors.

Next steps

Need assistance?

You can also ask questions in the Community Discord and we will be happy to help.