Ceci est une ancienne révision du document !
Remote Connect to RPi Greetings again fellow Sentient Lifeforms. Things here at landing pad 2997 on Terra haven't calmed down at all since last month. If anything, things are even busier. But I’m not going to let that keep me from sharing information with you. You might say that the RPi isn’t a Microcontroller, it’s a Single Board Computer (SBC). That’s true, but in the spirit of ‘Micro’ it is a MicroProcessor, so it sort of fits. You may have never had to connect to your RPi from another computer. You probably have a monitor connected to it and have never had to use it in any other way. But what happens if your monitor for the RPi dies? I currently have three RPi 4Bs on my home network. One I have for my home media center (running Kodi) and one that I’ve configured as a “baby” NAS (Network Attached Storage). The other is there to test various projects (PAGE, Python and other things). The RPi that is my “baby” NAS, basically runs as a headless server. There is no monitor attached to it. Usually I use ssh to do anything that needs to be done, like update the OS and so on. Without the ssh connection, I wouldn’t be able to get into it without taking it down and moving it to a close monitor, do what I need to do and then move it back to its “normal” location. I’ve always been able to use RealVNC to attach to the desktop remotely which is something that I occasionally want to do – to easily view what’s going on. And it works well.
Well, I got an email from the RealVNC company that basically said: “In just a few days’ time, on 17th June 2024, we are making changes to your Home subscription that will affect you. Retiring our Home plan Almost a year ago, we revamped our subscription options by launching a wider range of tiered plans designed to better cater to more users. In line with these changes, and to maintain a cohesive set of subscription options, we are now retiring our Home plan.” This is a major disappointment for me, since RealVNC just works without a whole lot of fussing and cussing. There are a few other VNC packages out there, but none of them quite as easy as RealVNC to set up and run. Now, the Raspberry Pi group has provided a solution called rpi-connect. This is available only in the latest version of Raspberry Pi OS (Bookworm) which uses Wayland window manager. When I first started writing this article, rpi-connect worked only on the RPi 5, RPi 4 and RPi 400, but they have now released a solution for all RPi devices like the RPi Zero-W and the older RPi 3 boards. Please note that, for the older devices, you need to use rpi-connect-lite which will allow you to use only the remote shell – and not the Shared screen mode. But, hey, it’s an easy way to get into your device.
First Steps First, as I said, you need to install the latest version of Raspberry Pi OS. Since you are completely upgrading the OS, you will want to back up any files that you need to keep. I’m sure you know how to do this. You should also consider using a new SD card; that way you can have access to your previous OS image. Whether you use your old SD card, or a new card, you will need to write the new image to the card. The easiest way to do this is to use the Raspberry Pi Imager. If you don’t have it, you can find it at https://www.raspberrypi.com/software/. Choose your target device in the box on the left (remember, this will work on only RPi 5, RPi4 and RPi 400). Then choose the version you want in the center box. Be sure that you select the 64-bit version of Debian Bookworm. Finally, choose the device your SD card is mounted on. You might be asked if you want to “apply OS customisation settings”. These are things like your wireless access point, username and password, the name of the RPi device on the network, username and password for login to the Pi, and so on. You can also enable SSH from this screen.
Eventually, you will be asked if you are ready to write the data to the SD card. When you say Yes, the latest version of the requested OS will be downloaded from the Internet and then written to the SD card. Once that’s done, move the SD Card to your RPi and then power it on. Next Steps Of course, you have your RPi connected to a monitor at this point. Once your RPi is up and running, as you should normally do, is to update the OS image so all your packages are the latest and greatest. Open a terminal and and enter: $ sudo apt update $ sudo apt upgrade Once you’ve done that, you need to install the connect software. $ sudo apt install rpi-connect If you are using an older RPi (pre-4b or Zero-W), you will need to install the “lite” version by using $ sudo apt install rpi-connect-lite Once the install is finished, you will need to reboot your RPi.
Using Connect Once your RPi has had a chance to reboot, rpi-connect SHOULD automatically start up and be waiting for you to connect through the browser of your choice on pretty much any machine on your local network. However, the first time, you will need to sign in on your Raspberry Pi. In the upper right corner of your screen, you should see the rpi-connect circle icon. Since you haven’t signed in yet, it will be grayed out. Click on it to get the ‘Sign in’ button and follow the prompts. Be sure to remember the username, password and device ID you created. (These days, I need to write it all down, at least until I can create a shortcut.) Now, on your desktop or laptop that you will be using to connect, open a browser (could be Firefox, Google Chrome, Vivaldi, or even Brave) and go to https://connect.raspberrypi.com/devices. You should see a screen similar to this… Sign in and select the device id of the RPi device. When you get connected, you will see a screen that looks something like this…
On the left side of the screen, you will see the device that you are connected to and the type of connections that device will support. If your RPi device is either a 4B or 5 or 400, then you should see both “Screen sharing” and “Remote Shell”. If you have an older device and you installed and set up the rpi-connect-lite program, then you will see only the “Remote shell” indicators. Now, click on the right side button that says “Connect via”. That will give you a dropdown that will allow you to connect to your RPi device. Assuming you are connecting via the “Screen sharing” option, a new browser window will pop up and, in a moment, it will show something like this… Shortly after that, you should see the desktop of the RPi device. At this point you are able to control the RPi device in a VNC-type window. The other option, “Remote shell”, is just like an ssh session. To close the session, simply type “exit” in the terminal screen.
Downsides The biggest downside at this point is the lack of file transfer during the sessions. I am certain that this is very high on the RPi group’s list of things to do. The buttons on the right side of the Screen Sharing window will copy and paste only TEXT. If you want to try this, be sure to upgrade your OS to the latest Bookworm. The only other thing you need to remember is that if you are using a RPi device earlier than a RPi 4, you will need to install rpi-connect-lite rather than rpi-connect. You can find a comprehensive step-by-step set of instructions at https://www.raspberrypi.com/documentation/services/connect.html Until next time, as always; stay safe, healthy, positive and creative!