PROGRAMMING RASPBERRY PI USING BROWSER WITH VS CODE

Earlier there were so many ways to access Raspberry Pi remotely which everybody is familiar with. SSH allows us to access the terminal whereas VNC and sftp allow us to access the files too. Transferring files from one Pi to another device was also possible via sftp connection. But as we all know every coin has its other side also which sometimes limits the user. SSH is very secure from both ends but people are not so friendly with the terminal and on the other side VNC is very user friendly but it is not secure that much. 

Now we have another way to access the Raspberry Pi that is a web-based editor which helps to program the Raspberry Pi; accessible from another device on your network.

Let’s take a look at the steps to program Raspberry Pi remotely, using a browser with the VS Code. 


Step 1: Download and install code-server

To download and install the code-server enter the command below in the terminal. 

 curl -fsSL https://code-server.dev/install.sh | sh


Step 2: Autostart code-server on boot

run the server as a service in the background by the command below

systemctl --user enable --now code-server 


Step 3: Change the bind-address.

To change the bind address open the config file Geany editor

geany /home/pi/.config/code-server/config.yaml

 and make the address as

 0.0.0.0:8080


Step 4: Change the Raspberry Pi’s password and reboot the device.

Press CTRL + X, Y and then Enter to save and exit. Note down the IP address of the device shown in the networking icon in the right top corner and then reboot the device.


Step 5: Open the browser

Open the browser on the PC and enter the IP address of the Pi followed by the last four digits of the bind-address. For example:

192.168.0.6:8080

Step 6: Log in using the password “raspberry.”

Step 7: Select the programming language.

Under Tools and languages click on Python to install support for Python 3.


Now you are ready to use the browser-based editor.

There are a lot more exciting things inside it like tools to work with source control,  User can Pause, rewind, restart, or stop as the code performs each task. Learn more by exploring it.

 

Also Check our Blog on RASPBERRY PI 4 NEW BETA FIRMWARE

Leave a comment

All comments are moderated before being published