# Introduction & Requirements

Hardware and add-ons

This is an attempt to document the best options for a stable and reliable installation of H2R-Graphics Server on Raspberry Pi. The full use-case described here would be for stand-alone and automated Raspberry Pi running without keyboard or mouse installed in a rack or fly-case with both HDMI output directly connected to a video switcher. (I use a BMD ATEM mini-extreme ISO).&#x20;

## Requirements

-Raspberry Pi5\
-[Proper power supply for your PI](https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#powering-raspberry-pi-5) (not any brick will do!)\
-[Fan for your Pi5](https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#cooling-raspberry-pi-5). (Unlike the Pi4, the Pi5 wont perform well fanless)\
-Keyboard, mouse and monitor of initial setup\
-[Raspi-Imager software ](https://www.raspberrypi.com/software/)\
-Micro-SD card reader\
-Reliable micro-SD Card (can you get less than 32G these days?)\
\
I believe the micro-SD card is probably the greatest point of failure. It will fail over time if you have continuous use of your Pi. Good quality cards will give you more mileage.

### Alternatives

#### M.2 SSD

As of January 2024 expansion cards for the Pi-5 that support M.2 memory are coming on the market and a positive alternative to using SD card who can be a point of failure. As more become available I plan to update my setup to use M.2 SSD as opposed to an SD card to improve reliability

#### Raspberry Pi 4B

The Pi4 is probably "good enough" to run the H2R-Graphics Server for light duty. If you plan to use it with 2 outputs and/or videos, probably not a good choice. In early test it did perform well.\
As of January 2024 this tutorial only covers the Raspberry Pi5. Instructions to make this work are very similar but if you are not familiar with the Pi OS it could be challenging because of the many differences between the Pi4 and Pi5.

#### PoE

There are available add-ons to power the Pi over PoE that I believe would improve the overall workflow if your kit already has a PoE switch


# Initial Setup - Raspberry Pi 5

Launch the Pi-Imager and select Raspberry Pi 5 as your Device

![](/files/xUliZIGQOFUjvRuC94cz)

Now select the Operating System. The latest OS (Bookworm which is Debian 12) is the only supported OS for the Pi 5. You cannot install a legacy OS (Bullseye or Buster) on a Pi 5

![](/files/pWmx4aFci7hWsvOTGdGC)

I recommend the default 64 bit OS. You need to have an OS with a Desktop environment for H2R-Graphics to work.&#x20;

> The OS version you choose (32-bit or 64-bit)  will determine which version of H2R-Graphics you need. \
> For the Pi-5 running 64-bit OS you need the H2R software for Raspberry Pi 64-bit.


# 32 bits or 64 bits - ?

An attempt to address some confusion. It starts with the OS..

{% hint style="info" %}
The short answer is to install Bookworm 64 bit on your Pi 4 or Pi 5 and run the H2R Graphics 64 bits. Check and update your Pi OS regularly for performance improvements.
{% endhint %}

## Bullseye or Bookworm?

The introduction of the Raspberry Pi 5 in late 2023 brough a number of changes to the implementation of Raspian OS that impacts the installation and running of H2R Graphics.

The Pi 5 requires the latest release for Raspian OS Bookworm which is based on Debian 12 and wont run previous OS such as Bullseye (or Buster if you're still in 2020).

The Pi 4 support all recent modern OS including Buster, Bullseye and Bookworm.

Common sense would say to always run on the latest OS and early testing indicate that both Pi 4 and Pi 5 running H2R Graphics can run on top of Bookworm.

## X11 or Wayland

There is a caveat running Bookworm which introduces a newer windows manager called Wayland which replaces the long running X11. While my understanding is limited, I have observed that the implementation is still on-going as of early 2024 so I expect that updates might address all the issues introduced by Wayland:

* Wayland does not support RealVNC so if you remote connect to your Pi, you need to migrate to a different VNC client
* Autostart scripts are different on Wayland than on X11
* Unclutter utility to hide the mouse cursor does not work on Wayland&#x20;
* Despite my efforts I cannot get two instances of Chromium to open full screen on each of the HDMI output for fully automated H2R Graphics autostart. Window position and/or output does not appear to work&#x20;

There is a system-option to use X11 instead of Wayland for legacy support that can be access using the raspi-config utility (under advanced)

## 32 bit or 64 bit?

Bullseye and Bookworm offer a 32 bit or 64 bit download. The Pi 4 and the Pi 5 will run the 64 bit variant and is usually the default choice. Common sense would dictate to run 64 bit where you can and early tests shows that H2R-Graphics 64 bit version will run on Pi 4 and Pi 5 (when running a 64 bit OS). The opposite is also true. The H2R-Graphics 32 bit version runs on Pi 4 and Pi 5 if running a 32 bit OS.

So then why run the 32 bit?

As of early 2024, there are different issues with Bookworm and Wayland depending if you are running 32 or 64 bit. Graphics hardware acceleration and better chromium response varies.

I suspect most of the issues to be addressed over the coming months.

&#x20;


# Install H2R Graphics

This process applies for any hardware and Raspian OS

## Using SSH or via local Terminal

The prefered method is accessing the Pi remotely using an SSH client such as [Putty](https://putty.org/). This eliminate the need for a keyboard, mouse and monitor to be connected to the Pi. If you are unfamiliar you can learn more on the [raspberripi.com website.](https://www.raspberrypi.com/documentation/computers/remote-access.html#remote-access)

{% hint style="info" %}
The same procedure can be done in a terminal window on the Pi if you have a keyboard-mouse and monitor connected
{% endhint %}

### Update OS

Once you are connected over SSH (or open a terminal), you first need to load and install the latest updates with the following command

```
sudo app-get update && sudo app-get upgrade
```

You will be prompted to process with the install and you need to press 'y' followed by 'enter'. This may take a while.

### Download H2R Graphics

Next we need to download the H2R Graphics AppFile to the Raspberry Pi in a new folder called H2R.

If you are using 64 bit OS&#x20;

```
wget -P ~/H2R https://github.com/iamjohnbarker/h2r-graphics-releases/releases/download/v2.18.2/H2R-Graphics-2.18.2-arm64.AppImage
```

If you are using 32 bit OS

```
wget -P ~/H2R https://github.com/iamjohnbarker/h2r-graphics-releases/releases/download/v2.18.2/H2R-Graphics-2.18.2-armv7l.AppImage
```

<figure><img src="/files/7di7MbcLl35XYrEsSHN2" alt=""><figcaption><p>SSH session : Successful download of H2R Graphics to the Raspberry Pi</p></figcaption></figure>

### Install H2R Graphics

Next we will move to the H2R directory, adjust permissions, unpack the AppFile and rename the root directory

```
cd ~/H2R
chmod a+x H2R-Graphics-2.18.2-arm64.AppImage
./H2R-Graphics-2.18.2-arm64.AppImage --appimage-extract
mv squashfs-root root
```

<figure><img src="/files/TQ5zxji1xIJ0Fol3cIc7" alt=""><figcaption></figcaption></figure>

### Create a desktop shortcut

If you need a desktop icon to use to launch H2R graphics, we'll need to create a .desktop file for this purpose.

```
nano ~/Desktop/H2R.desktop
```

this will open a text editor for file H2R.desktop

copy and paste the content below into the editor

```
[Desktop Entry]
Name=H2R Graphics
Icon=/home/pi/H2R/root/usr/share/icons/hicolor/0x0/apps/h2r-graphics-electron.png
Exec=/home/pi/H2R/root/./AppRun
Type=Application
Encoding=UTF-8
Terminal=false

```

{% hint style="info" %}
to exit the editor and save your file you hit Ctrl+X to exit, Y to confirm changes, Enter to complete&#x20;
{% endhint %}

<div align="left"><figure><img src="/files/ymvptaCsJ3J3WTHc4Tua" alt=""><figcaption><p>Desktop Icon for H2R Graphics.</p></figcaption></figure></div>

At this point you can double-click the icon to launch the application!


# H2R Graphics Settings

I lost a lot of time looking for a solution that was already built into H2R

{% hint style="info" %}
You can change the default background color of your output window
{% endhint %}

{% hint style="info" %}
There is an option to hide the cursor in H2R.&#x20;
{% endhint %}

You might miss important and useful options under settings:

<figure><img src="/files/NIiX1rKcwxZXarqz3anW" alt="" width="349"><figcaption><p>System settings can be accessed via the main application window</p></figcaption></figure>

If like me you use Luma and not Chroma, you probably want your default output background to be black. It can be set under Settings/Output.

Same for hiding the cursor, simply select hide and H2R will hide the cursor. Something that is  very difficult to achieve if you are running Wayland (as of Feb 2024).

<figure><img src="/files/qV3Og77TPIsZQ3xO9t0d" alt="" width="351"><figcaption><p>Output Settings</p></figcaption></figure>

{% hint style="info" %}
This section is only here for reference if you are trying to hide the cursor for another application other than H2R Graphics
{% endhint %}

As of January 2024, if you are running [Wayland](/32-bits-or-64-bits#x11-or-wayland)  it is still very much work-in-progress if you need to hide the mouse cursor.  With X11, the previous windows manager, simple add-ons such as unclutter could easily achieve this task.

> The following steps are very much experimental but did work on Pi 5 running bookworm 64 bit

The solution presented here is based on this post:&#x20;

{% embed url="<https://raspberrypi.stackexchange.com/questions/145382/remove-hide-mouse-cursor-when-idle-on-rasbperry-pi-os-bookworm>" %}
Source of inspiration..
{% endembed %}


# Autostart H2R Graphic

Automate H2R Graphics on Raspberry Pi

You can start H2R Graphics as well as opening browser windows automatically each time the Raspberry Pi is booted but is dependant on which windows manager you are using.[ If not sure read this](/32-bits-or-64-bits#x11-or-wayland)

## If you are running Wayland&#x20;

If you installed the default OS on your Pi 4 and Pi 5 and not enabled X11, then you are running on Wayland.

### Autostart H2R Graphics Server

We need to edit the wayfire.ini file and add a section&#x20;

```
nano ~/.config/wayfire.ini
```

Now scroll all the way to the last line and add the following:

```
[autostart]
1 = $HOME/H2R/root/./AppRun
```

Once again exit the editor and save by pressing, Crtl + X, then Y, then Enter.

### Autostart Chromium-browser window

H2R will atttempt to re-open the browser window on start. This might work for you but if you need more control then it is better to launch the chromium-browser as part of the auto-start process.&#x20;

In this case the wayfire.ini file should look like this:

{% code overflow="wrap" %}

```
[autostart]
1 = $HOME/H2R/root/./AppRun
2 = sleep 10; chromium-browser "http://127.0.0.1:4001/output/ABCD/?bg=black" --start-maximized --start-fullscreen --incognito
```

{% endcode %}

the portion of code between "" need to match your application. This example open the output 1 on project ABCD with black background. (The sleep 10 is necessary to ensure H2R start before the browser and is not in the foreground)

## If you are running X11

If you are running a legacy OS (Bullseye) or have changed the default window manager via the raspi-config tool from Wayland to X11, then you are at the right place.

Instructions are on the way..


