Raspberry Pi Remote Development Based On vscode Tutorial
Introduction
If you want to edit code on your Raspberry Pi, it often involves starting the graphical interface on the Raspberry Pi through an additional display or remote desktop connection. However, additional monitors come with costs, and remote desktop connections are often too sluggish to facilitate efficient work. Is there a more affordable and convenient development method?
The answer is yes – you can leverage the capabilities of VSCode's SSH remote development extension for a quick and budget-friendly solution.
Tutorial
First, make sure your Raspberry Pi has an SSH server installed.
If not, please install the ssh service by executing the following statement from the command line in the Raspberry Pi.
sudo apt install openssh-server
First, open vscode on your computer and click on the expand button in the left column.
Search for remote and select remote-ssh, remote explorer to download and install.
A new remote option will be added to the sidebar after the installation is complete, choose to click on it.
Next, with SSH in Remote Explorer, click on the + sign on the right.
Next, enter your Raspberry Pi's IP address in the upper center field and press enter. (Make sure your computer and Raspberry Pi are connected to the same network and wifi).
Select the first one and press enter again.
Then an inconspicuous pop-up box will appear in the bottom right corner of vscode, click connect on the right.
Then type your Raspberry Pi username in the center of the vscode and press enter. Wait for a while and if nothing happens, the connection is successful!
On the left sidebar click first on Manager and then on Add Working Directory.
Enter the path to the folder in your Raspberry Pi where you need to write the program and press enter.
Finally, select the trusted folder in the pop-up window to start remote development.