> ## Documentation Index
> Fetch the complete documentation index at: https://bytebeam.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Raspberry Pi

> Learn how to set up a Raspberry Pi with this step-by-step document. Find out which components you need and how to install the rpi-imager software to select the operating system for your Pi. Get instructions on flashing the image to the SD card, setting up partition schema.

# Selecting the OS

This section explains how to do an initial setup, for an off-the-shelf Raspberry Pi. To get started, the following things are needed.

1. Raspberry Pi Board (In this example we use Raspberry Pi Model 3B+).
2. An SD Card (of size 64GB)
3. An adapter for power supply (with at least 15W of power)&#x20;
4. ByteBeam RPI image

ByteBeam RPI image can be downloaded from [this](https://drive.google.com/file/d/1fdH88IS-wuUvqT6SPsIt7Vmy3tzezECW/view?usp=sharing) link.

Install the RPI-imager software by following the instructions in [this](https://www.raspberrypi.com/software/) link.&#x20;

Once the installation is done, connect the SD card to the Linux machine and launch the RPI-imager software. To do so, simply type in rpi-imager on the terminal.

```shell theme={null}
sudo rpi-imager
```

<img src="https://mintcdn.com/bytebeamio/vsyovcELww170reF/assets/gE9xtwaJ4QIdQaHhXqqXL_1startrpiimager.png?fit=max&auto=format&n=vsyovcELww170reF&q=85&s=cbcb526054bbf254af74cae009a00a08" alt="" width="1855" height="890" data-path="assets/gE9xtwaJ4QIdQaHhXqqXL_1startrpiimager.png" />

Then click on Choose OS. A new window will open up, that has the list of all available Operating Systems for the Raspberry Pi.

<img src="https://mintcdn.com/bytebeamio/K35qLcH5nuNVBNLm/assets/GYZvzhBglFhURQTX3ASqj_2chooseosnew.png?fit=max&auto=format&n=K35qLcH5nuNVBNLm&q=85&s=f09d55cd68c6c5fa688bfb340b96358f" alt="" width="680" height="420" data-path="assets/GYZvzhBglFhURQTX3ASqj_2chooseosnew.png" />

Select the Custom Image option.

<img src="https://mintcdn.com/bytebeamio/1h3XTf0vWTDRsKc2/assets/CVpMKqxbJ4uoIa71Rc3uZ_custom.png?fit=max&auto=format&n=1h3XTf0vWTDRsKc2&q=85&s=d6d2a93bff844260aec5c708eacccfe2" alt="" width="1452" height="745" data-path="assets/CVpMKqxbJ4uoIa71Rc3uZ_custom.png" />

Select the downloaded ByteBeam RPI image.

<img src="https://mintcdn.com/bytebeamio/qFHdi6YCHCT3kYFV/assets/Zzjg0cYWVdBRpLZ0kwqa2_custom2.png?fit=max&auto=format&n=qFHdi6YCHCT3kYFV&q=85&s=aaa238e7f5a95572e719d9e1e15fe056" alt="" width="971" height="410" data-path="assets/Zzjg0cYWVdBRpLZ0kwqa2_custom2.png" />

# Flashing the image to the SD Card

Using RPI-imager, it’s possible to enable SSH, set a username and password for the Pi, and also input the WiFi credentials. Click on the settings icon on the rpi-imager GUI.

<img src="https://mintcdn.com/bytebeamio/1h3XTf0vWTDRsKc2/assets/BE-Tdx46ZZzFQKTsK1vUE_5settingsicon.png?fit=max&auto=format&n=1h3XTf0vWTDRsKc2&q=85&s=41fdc2a44115b55f9dfd97e4d4366393" alt="" width="1844" height="1032" data-path="assets/BE-Tdx46ZZzFQKTsK1vUE_5settingsicon.png" />

Setup the necessary configurations.

<img src="https://mintcdn.com/bytebeamio/qFHdi6YCHCT3kYFV/assets/_DZYdgStl8WnGSUPe4ujk_rpiimager7.png?fit=max&auto=format&n=qFHdi6YCHCT3kYFV&q=85&s=3c15c82f46ae496d380cef8d67256a18" alt="" width="561" height="990" data-path="assets/_DZYdgStl8WnGSUPe4ujk_rpiimager7.png" />

Save the configuration and click on Write, for the image to be flashed on the SD Card.

# Partition Schema&#x20;

The SD Card is now setup to contain 4 partitions.

1. Partition 1 - Boot partition (/dev/mmcblk0p1)
2. Partition 2 - Root partition 1  (/dev/mmcblk0p2)
3. Partition 3 - Root partition 2 (/dev/mmcblk0p3)
4. Partition 4 - Download partition (/dev/mmcblk0p4)

<img src="https://mintcdn.com/bytebeamio/ZdhGbGJHpHWsN9k0/assets/9JNAg0SDuj-FxYwa-xZsJ_6partitioninfo.png?fit=max&auto=format&n=ZdhGbGJHpHWsN9k0&q=85&s=8c25e61bb0bf260a02029f2506e7b83f" alt="" width="793" height="208" data-path="assets/9JNAg0SDuj-FxYwa-xZsJ_6partitioninfo.png" />

At any given point in time either "Partition 2" or "Partition 3" will be the active rootfs partition, and the other partition is referred to as the inactive partition. The download partition is where application data is stored. During kernel & rootfs updates, the contents of inactive partitions are replaced with the new rootfs.

Once the flashing is complete, insert the SD card into the Pi and power on the Pi. If everything is alright, the Pi can be accessed either through SSH or via UART. Refer to [this](https://emteria.com/kb/connect-uart-rpi) link on how to connect the Pi to the system via UART.

# SDK Setup

Once the Pi is up run the below one-time setup script. This script installs Bytebeam's Linux agent [uplink](https://github.com/bytebeamio/uplink) as well as scripts required for over-the-air updates

***

```shell theme={null}
sudo curl  --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/bytebeamio/uplink/main/scripts/one_time_setup.sh | sudo bash
```
