How to: Setup & Install Raspberry Pi Connect

How to Setup & Install 'Raspberry Pi Connect'

Introduction

Raspberry Pi Connect provides secure access to your Raspberry Pi from anywhere in the world.

hero

To use Connect, install the Connect software on your Raspberry Pi. Then visit connect.raspberrypi.com to access your Raspberry Pi via screen sharing in a browser window. You can use the desktop as if you had plugged a monitor into your Raspberry Pi.

Connect uses a secure, encrypted connection. By default, Connect communicates directly between your Raspberry Pi and your browser. However, when Connect can’t establish a direct connection between your Raspberry Pi and your browser, we use a relay server in London. In such cases, Raspberry Pi only retains the metadata required to operate Connect.

Install

Connect requires a Raspberry Pi running a 64-bit distribution of Raspberry Pi OS Bookworm that uses the Wayland window server. The required OS version requires a Raspberry Pi 5, Raspberry Pi 4, or Raspberry Pi 400.

NOTE
Connect is not compatible with Raspberry Pi OS Lite or systems that use the X window server.

To begin installation, open a Terminal window. Run the following command to update your system and packages:

$ sudo apt update
$ sudo apt upgrade

Install Connect

Run the following command on your Raspberry Pi to install Connect:

$ sudo apt install rpi-connect

After installation, reboot your Raspberry Pi to start the Connect service:

$ sudo reboot

Connect will automatically start the next time you log in to your Raspberry Pi.

Start Connect

NOTE
By default, Connect automatically starts at login. You don’t need to manually start Connect unless you remove it from your login items.

To start the service manually from the command line, run the following command:

$ systemctl --user start rpi-connect

Use Connect

Now that you’ve installed Connect on your Raspberry Pi, you must associate your Raspberry Pi with your Raspberry Pi ID to use Connect.

If you do not have a Raspberry Pi ID, create one.

To link your Raspberry Pi with your Raspberry Pi ID, use Connect to generate a verification URL. Visit the URL and sign into your Raspberry Pi ID to add your Raspberry Pi to your account.

You can generate the verification URL using the Connect icon on the Raspberry Pi Desktop or with the rpi-connect CLI.

via the Raspberry Pi Desktop

Once the rpi-connect service starts running, the Connect icon appears in the system tray.

just installed

Click on the Connect icon and choose "Sign in" from the drop-down menu. This opens a verification URL you can use to link your Raspberry Pi to your Raspberry Pi ID.

sign in

via the command line

Use the following command to generate a link that will connect your Raspberry Pi with your Raspberry Pi ID:

$ rpi-connect signin

This command should output something like the following:

Complete sign in by visiting https://connect.raspberrypi.com/verify/XXXX-XXXX

Visit the URL on any device to link your Raspberry Pi with your Raspberry Pi ID.

Finish linking your Raspberry Pi in Connect

Visit the verification URL generated in the previous step.

Sign in to Connect using your Raspberry Pi ID.

login with id

After authenticating, assign a name to your Raspberry Pi. Choose a name that will help you identify your device. Click the Create device and sign in button to continue.

create device

You can now screen share from your Raspberry Pi. The Connect system tray icon will turn blue to indicate that your Raspberry Pi has been linked to the Connect service. You should receive an email notification indicating that a new device has signed into Connect.

sign in email
WARNING
If you receive an email that says a device that you do not recognise has signed into Connect, change your Raspberry Pi ID password immediately. Remove the device from Connect to permanently disassociate it from your account. Consider enabling two-factor authentication to keep your account secure.
linked with

Click the Connect system tray icon to open the Connect menu. This menu shows your current sign in status, an option to sign out, and an option to enable or disable screen sharing.

NOTE
You can also use the terminal command rpi-connect signout to remove your Raspberry Pi from Connect.

Connect signs communication with your device serial number. Moving your SD card between devices will sign you out of Connect.

Connect to your Raspberry Pi

Now that your Raspberry Pi is listed in the Connect web portal, you can share your Raspberry Pi’s screen anywhere using only a browser.

Visit connect.raspberrypi.com on any computer.

Connect redirects you to the Raspberry Pi ID service to sign in. After signing in, Connect displays a list of linked devices. Devices available for screen sharing show a grey Screen sharing label below the name of the device.

list of devices

Click the Connect button to the right of the device you would like to screen share. This opens a browser window that displays the desktop of your Raspberry Pi.

connecting

You can now use your Raspberry Pi as you would locally. For more information about the connection, hover your mouse over the padlock icon immediately to the right of the Disconnect button.

session start
TIP
Use the Copy from remote and Paste to remote buttons above your desktop to copy between your local and remote clipboards.

Once connected, a green dot appears next to the Screen sharing label in the Connect portal. This indicates an active screen sharing session. Hover to see the current number of screen sharing sessions.

connect service connected

The Connect icon in the system tray turns purple and displays a closed circle when a screen sharing session is in progress.

pi desktop connected

Disconnect from your Raspberry Pi

To close a screen sharing session, click the Disconnect button above your desktop.

session end

Disable screen sharing

To turn off screen sharing, click the Connect system tray icon and unselect Allow screen sharing. The lower part of the Connect system tray icon will turn grey. You remain signed into Connect, but your screen cannot be shared.

no sharing

In the Connect portal, the Connect button and the Screen sharing label next to that Raspberry Pi will disappear.

no connect button ui

To re-enable screen sharing, click the Connect system tray icon and select Allow screen sharing.

IMPORTANT
Connect automatically enables screen sharing after a reboot. To permanently disable screen sharing, sign out of Connect.

Manage your Raspberry Pis

Connect lists all of the Raspberry Pis linked with your Raspberry Pi ID. Each device has a Connect button to open a screen sharing session, if screen sharing is enabled on that device. Each device has a list of labels under the device name to indicate available services.

list of devices

Click on the device name to open the device details page. This screen provides low-level information about your device. You can also edit the device name or remove the device from Connect.

device details

Deleting a device from Connect automatically signs you out of Connect on the device. The Connect system tray icon turns grey and the menu only provides a Sign in option.

Update Connect

To update to the latest version of Connect, run the following command:

$ sudo apt update
$ sudo apt install --only-upgrade rpi-connect

Reboot your device to put your update into effect:

$ sudo reboot

Uninstall Connect

Run the following command to remove Connect software from a Raspberry Pi:

$ sudo apt remove --purge rpi-connect

After uninstalling, the Raspberry Pi’s serial number remains linked with your Raspberry Pi ID. The device still appears in the Connect portal, but can’t be used for screen sharing. If you install Connect again, even with a different SD card, on the same Raspberry Pi, it will reuse the existing device name in the Connect portal.

To sever the link between a Raspberry Pi and a Raspberry Pi ID, remove the Raspberry Pi from the list of devices in the Connect portal.

Troubleshooting

Known issues

  • Connect only supports sharing a single, primary display of your Raspberry Pi. When a Raspberry Pi is connected to multiple HDMI screens, Connect sometimes shares the contents of the secondary screen. You can work around this by right-clicking the desktop and changing the location of the taskbar in Desktop Preferences…​.

  • Connect does not support on-screen keyboards. For full functionality, use a physical keyboard.

  • Connect requires a browser that implements ECMAScript 2020 (ES11) as it makes use of features unavailable in older browsers.

  • Browsers intercept certain keys and key combinations. As a result, you can’t type these keys into your Connect window. Connect provides a toolbar to simulate some of the most popular intercepted keys.

Enable enhanced logging

You can enable debug logging for both rpi-connect and its dedicated WayVNC server for a detailed account of local operations on your Raspberry Pi.

Enable enhanced logging in rpi-connect

Open the rpi-connect configuration file for editing with the following command:

$ systemctl --user edit rpi-connect

Enter the following lines of configuration between the comments:

ExecStart=
ExecStart=/usr/bin/rpi-connect-env /usr/bin/rpi-connectd -socket=%t/rpi-connect-wayvnc.sock -v
NOTE
You need both lines that begin with ExecStart=.

Finally, restart the service with the following command:

$ systemctl --user restart rpi-connect

Enable enhanced logging in the dedicated wayvnc server

Open the configuration file for the dedicated WayVNC server associated with Connect:

$ systemctl --user edit rpi-connect-wayvnc

Enter the following lines of configuration between the comments:

ExecStart=
ExecStart=/usr/bin/rpi-connect-env /usr/bin/wayvnc --config /etc/rpi-connect/wayvnc.config --render-cursor --unix-socket --socket=%t/rpi-connect-wayvnc-ctl.sock -Ldebug %t/rpi-connect-wayvnc.sock
NOTE
You need both lines that begin with ExecStart=.

Finally, restart the service with the following command:

$ systemctl --user restart rpi-connect-wayvnc

View Connect logs

To view logs for the Connect service and its dedicated WayVNC server, run the following command:

$ journalctl --user --follow --unit rpi-connect --unit rpi-connect-wayvnc

Post a Comment

0 Comments