Skip to content

Commit

Permalink
DOCS-1494: Add Raspberry Pi 5 (#2303)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessamyT authored Dec 8, 2023
1 parent 036b85b commit 84275d8
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 16 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ sitemap:

<div id="board-carousel" class="carousel max-page">
<ul tabindex="0">
<li id="c1_slide0">
<a href="get-started/installation/prepare/rpi-setup/">
{{<imgproc src="get-started/installation/thumbnails/raspberry-pi-5-8gb.png" resize="148x120" declaredimensions=true alt="Raspberry Pi 5">}}
<p>Raspberry Pi 5</p>
</a>
</li>
<li id="c1_slide1">
<a href="get-started/installation/prepare/rpi-setup/">
{{<imgproc src="get-started/installation/thumbnails/raspberry-pi-4-b-2gb.png" resize="148x120" declaredimensions=true alt="Raspberry Pi">}}
{{<imgproc src="get-started/installation/thumbnails/raspberry-pi-4-b-2gb.png" resize="148x120" declaredimensions=true alt="Raspberry Pi 4b">}}
<p>Raspberry Pi 4</p>
</a>
</li>
Expand Down Expand Up @@ -83,7 +89,7 @@ sitemap:
<li id="c1_slide11">
<a href="get-started/installation/prepare/rpi-setup/">
{{<imgproc src="get-started/installation/thumbnails/raspberry-pi-zero-2w.png" alt="Raspberry Pi" resize="148x120" declaredimensions=true >}}
<p>Raspberry Pi Zero 2W</p>
<p>Raspberry Pi Zero 2 W</p>
</a>
</li>
<li id="c1_slide12">
Expand All @@ -106,6 +112,7 @@ sitemap:
</li>
</ul>
<ol style="visibility: hidden" aria-hidden="true">
<li><a href="#c1_slide0">Raspberry Pi 5</a></li>
<li><a href="#c1_slide1">Raspberry Pi 4</a></li>
<li><a href="#c1_slide2">NVIDIA Jetson Orin Nano</a></li>
<li><a href="#c1_slide3">Intel UP4000</a></li>
Expand All @@ -116,7 +123,7 @@ sitemap:
<li><a href="#c1_slide8">NVIDIA Jetson AGX Orin</a></li>
<li><a href="#c1_slide9">NVIDIA Jetson Xavier NX</a></li>
<li><a href="#c1_slide10">Raspberry Pi 3</a></li>
<li><a href="#c1_slide11">Raspberry Pi Zero 2W</a></li>
<li><a href="#c1_slide11">Raspberry Pi Zero 2 W</a></li>
<li><a href="#c1_slide12">BeagleBone AI-64</a></li>
<li><a href="#c1_slide13">Numato GPIO Modules</a></li>
<li><a href="#c1_slide14">PCA9686 I<sup>2</sup>C Interface</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/board/beaglebone.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aliases:
# SMEs: Gautham, Rand
---

{{% alert title="REQUIREMENTS" color="caution" %}}
{{% alert title="REQUIREMENTS" color="note" %}}

Follow the [setup guide](/get-started/installation/prepare/beaglebone-setup/) to prepare your BeagleBone for running `viam-server` before configuring a `beaglebone` board.

Expand Down
2 changes: 1 addition & 1 deletion docs/components/board/jetson.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aliases:
# SMEs: Gautham, Rand
---

{{% alert title="REQUIREMENTS" color="caution" %}}
{{% alert title="REQUIREMENTS" color="note" %}}

Follow one of our Jetson [setup guides](/get-started/installation/) to prepare your board for running `viam-server` before configuring a `jetson` board.

Expand Down
14 changes: 8 additions & 6 deletions docs/components/board/pi.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
---
title: "Configure a pi board"
title: "Configure a Raspberry Pi 4, 3, or Zero 2 W board"
linkTitle: "pi"
weight: 20
type: "docs"
description: "Configure a pi board."
description: "Configure a Raspberry Pi 4, 3, or Zero 2 W board."
images: ["/icons/components/board.svg"]
tags: ["board", "components"]
aliases:
- "/components/board/pi/"
# SMEs: Gautham, Rand
---

{{% alert title="REQUIREMENTS" color="caution" %}}
{{% alert title="REQUIREMENTS" color="note" %}}

Follow the [setup guide](/get-started/installation/prepare/rpi-setup/) to prepare your Pi for running `viam-server` before configuring a `pi` board.

{{% /alert %}}

Configure a `pi` board to integrate a [Raspberry Pi 4](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/), [Raspberry Pi 3](https://www.raspberrypi.com/products/raspberry-pi-3-model-b/) or [Raspberry Pi Zero 2 W](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/) into your robot:
Configure a `pi` board to integrate a [Raspberry Pi 4](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/), [Raspberry Pi 3](https://www.raspberrypi.com/products/raspberry-pi-3-model-b/), or [Raspberry Pi Zero 2 W](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/) into your robot.

{{< tabs name="Configure an pi Board" >}}
To configure a Raspberry Pi 5, see [Configure a Raspberry Pi 5 board](/components/board/pi5/).

{{< tabs name="Configure a pi Board" >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your robot's page in [the Viam app](https://app.viam.com).
Expand All @@ -39,10 +41,10 @@ Then remove and fill in the attributes as applicable to your board, according to
{
"analogs": [
{
"chip_select": "<chip-select-pin-number-on-board>",
"name": "<your-analog-reader-name>",
"pin": "<pin-number-on-adc>",
"spi_bus": "<your-spi-bus-name>",
"chip_select": "<chip-select-pin-number-on-board>",
"average_over_ms": <int>,
"samples_per_sec": <int>
}
Expand Down
140 changes: 140 additions & 0 deletions docs/components/board/pi5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
title: "Configure a Raspberry Pi 5 board"
linkTitle: "pi5"
weight: 20
type: "docs"
description: "Configure a Raspberry Pi 5 board."
images: ["/icons/components/board.svg"]
tags: ["board", "components"]
# SMEs: Bucket, Alan
---

{{% alert title="REQUIREMENTS" color="note" %}}

Follow the [setup guide](/get-started/installation/prepare/rpi-setup/) to prepare your Pi for running `viam-server` before configuring a `pi5` board.

{{% /alert %}}

Configure a `pi5` board to integrate a [Raspberry Pi 5](https://www.raspberrypi.com/products/raspberry-pi-5/) into your robot.

To configure a Raspberry Pi 4 or earlier, see [Configure a Raspberry Pi 4, 3, or Zero 2 W board](/components/board/pi/).

### Enable hardware PWM

_(Optional)_ If you want to use hardware PWM on {{< glossary_tooltip term_id="pin-number" text="pins" >}} 12 and 35, edit <file>/boot/config.txt</file> on your Pi, adding the following line:

```sh {class="line-numbers linkable-line-numbers"}
dtoverlay=pwm-2chan
```

Then reboot the Pi for the change to take effect.

If you do not enable hardware PWM, these pins will have no function.

### Configuration

{{< tabs name="Configure a pi5 Board" >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your robot's page in [the Viam app](https://app.viam.com).
Click on the **Components** subtab and click **Create component**.
Select the `board` type, then select the `pi5` model.
Enter a name for your board and click **Create**.

![An example board configuration in the app builder UI. The name (local), type (board) and model (pi5) are shown. No other attributes are configured.](/tutorials/scuttlebot/board-empty-json.png)

Copy and paste the following attribute template into your board's **Attributes** box.
Then remove and fill in the attributes as applicable to your board, according to the table below.

{{< tabs >}}
{{% tab name="Attributes template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"analogs": [
{
"name": "<your-analog-reader-name>",
"pin": "<pin-number-on-adc>",
"spi_bus": "<your-spi-bus-number>",
"chip_select": "<chip-select-pin-number-on-board>",
"average_over_ms": <int>,
"samples_per_sec": <int>
}
],
"digital_interrupts": [
{
"name": "<your-digital-interrupt-name>",
"pin": "<pin-number>"
}
]
}
```

{{% /tab %}}
{{% tab name="Attributes example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"digital_interrupts": [
{
"name": "your-interrupt-1",
"pin": "15"
},
{
"name": "your-interrupt-2",
"pin": "16"
}
]
}
```

{{% /tab %}}
{{< /tabs >}}

{{% /tab %}}
{{% tab name="JSON Template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{
"name": "<your-pi-board-name>",
"model": "pi5",
"type": "board",
"namespace": "rdk",
"attributes": {
"analogs": [
<...See table below...>
],
"digital_interrupts": [
<...See table below...>
]
},
"depends_on": []
}
]
}
```

{{% /tab %}}
{{< /tabs >}}

The following attributes are available for `pi5` boards:

<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `analogs` | object | Optional | Attributes of any pins that can be used as analog-to-digital converter (ADC) inputs. See [configuration info](#analogs). |
| `digital_interrupts` | object | Optional | Any digital interrupts's {{< glossary_tooltip term_id="pin-number" text="pin number" >}} and name. See [configuration info](#digital_interrupts). |

## Attribute Configuration

Configuring these attributes on your board allows you to integrate [analog-to-digital converters](#analogs) and [digital interrupts](#digital_interrupts) into your robot.

### `analogs`

{{< readfile "/static/include/components/board/board-analogs.md" >}}

### `digital_interrupts`

{{< readfile "/static/include/components/board/board-digital-interrupts.md" >}}
10 changes: 5 additions & 5 deletions static/include/components/board/board-analogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Then, integrate `analogs` into the `attributes` of your board by adding the foll
// "attributes": { ... ,
"analogs": [
{
"chip_select": "<chip-select-pin-number-on-board>",
"name": "<your-analog-reader-name>",
"pin": "<pin-number-on-adc>",
"spi_bus": "<your-spi-bus-name>",
"chip_select": "<chip-select-pin-number-on-board>",
"average_over_ms": <int>,
"samples_per_sec": <int>
}
Expand All @@ -37,16 +37,16 @@ Then, integrate `analogs` into the `attributes` of your board by adding the foll
"attributes": {
"analogs": [
{
"chip_select": "24",
"name": "current",
"pin": "1",
"spi_bus": "main"
"spi_bus": "main",
"chip_select": "24"
},
{
"chip_select": "24",
"name": "pressure",
"pin": "0",
"spi_bus": "main"
"spi_bus": "main",
"chip_select": "24"
}
],
"spis": [
Expand Down

0 comments on commit 84275d8

Please sign in to comment.