fbpixel
Tags:

The Raspberry Pi is a very powerful tool offering many functionalities. One of them is the remote connection which makes it a favorite tool for connected objects or IoT. To configure the Raspberry on its first use, it is practical to have a screen with an HDMI port, a keyboard and a mouse as for a computer. It quickly becomes heavy for a connected object. We will see here how to get rid of these accessories when using the Pi.

Prérequis: Installation de Raspbian

Equipment

  • Screen
  • HDMI cable
  • Keyboard
  • Raspberry PI 3
  • Micro SD card
  • Mouse
  • Micro USB charger B

Commands to know

  • Install sudo apt-get install software
  • OS update sudo apt-get udpate then sudo apt-get upgrade
  • Restart the Raspberry Pi sudo reboot
  • Turn off the Raspberry Pi sudo shutdown
  • Open the configuration menu Raspberry Pi sudo raspi-config
  • Find the IP address of the Raspberry Pi ifconfig

Remote connection by SSH

Configuration of the Raspberry Pi

Once the OS is installed, go to the Raspberry Pi desktop. Open the terminal raspi-icon-terminal Remote connection to Raspberry Pi at the top left of the screen (or Ctrl + Alt + t).

Then enter the command:

sudo raspi-config

In the menu, select “5 – Interfacing Options”

raspiconfig-interface Remote connection to Raspberry Pi

Then “SSH”, select “Yes” to allow SSH connection.

raspiconfig-ssh Remote connection to Raspberry Pi

To find out the IP address of your Raspberry Pi, enter the command, ifconfig (here IP : 192.168.1.9)

raspi-ifconfig Remote connection to Raspberry Pi

Installation of PuTTY software

On your PC, install the PuTTY software which is an SSH client and will allow you to connect remotely to your Raspberry.

putty-app Remote connection to Raspberry Pi

Once the software is installed, open it. Just enter the IP address of the card and click on “Open”.

putty-configuration Remote connection to Raspberry Pi

Specify the login and password when requested (By default, login: pi, password: raspberry).

raspberrypi3-putty Remote connection to Raspberry Pi

You now have access to the terminal of your Raspberry Pi and you can enter the command lines there as if you were on the Raspberry Pi.

Remote connection via VNC (Virtual Network Computing)

Raspberry Pi configuration

In the terminal, enter the command sudo raspi-config

In the menu, select “5 – Interfacing Options”

raspiconfig-interface Remote connection to Raspberry Pi

Then “VNC”, select “Yes” to allow connection via the VNC server.

raspiconfig-vnc Remote connection to Raspberry Pi

The VNC icon then appears in the task bar at the top right. Click it to open the VNC server and find the IP address, connection status, and security information.

raspi-vncserver Remote connection to Raspberry Pi

Installing the VNC Viewer software

On your PC, download and install the VNC Viewer software.

Once the software is installed, open it. You just need to enter the IP address of the Raspberry Pi and validate. Enter the login and password to connect to the Raspberry Pi.

vnc-viewer-connexion Remote connection to Raspberry Pi

To be able to restart the Raspberry without monitor, enter the command

sudo nano /boot/config.txt

Uncomment the line

hdmi_force_hotplug=1

You can also adjust the size of the virtual monitor by adding the following lines. Choose a size suitable for your screen.

framebuffer_width=1920
framebuffer_height=1080

Restart the Raspberry by typing sudo reboot and disconnecting the HDMI port.

raspberry-vncviewer Remote connection to Raspberry Pi

You now have access to the Raspberry’s desktop and can use it while forgetting about the screen and the keyboard.

File transfer

An interesting tool in VNC is file transfer which allows you to recover or load files on the Raspberry Pi without having to go back and forth between the PC and the Raspberry with the SD card or a USB key.

  • To transfer a file from the PC to the Raspberry, click on the VNC icon in the PC window at the top left. Select “Transfer files …”

vncviewer-filetransfer Remote connection to Raspberry Pi

Then select the desired file(s).

  • To transfer files from Raspberry to PC, open the VNC server window by clicking on the VNC icon on the Raspberry task bar at the top right. Then click on the menu icon at the top right and select “File transfer …”

vncserver-filetransfer Remote connection to Raspberry Pi

If you have a problem configuring your Raspberry Pi or if you think that information is missing in this tutorial, leave me a comment or send me a message.

Sources

PuTTY

VNC Viewer