Raspberry Pi Remote Access - 3 Methods

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today in the workshop we're exploring Raspberry Pi remote access you'll see how to remotely access your Raspberry Pi using SSH VNC and Raspberry Pi connect we'll also learn about tcpip the networking protocols used by the Raspberry Pi so get rid of the mouse keyboard and screen and welcome to the workshop [Music] [Applause] well hello and welcome to the workshop or I should say welcome back to the workshop it's been a while since I created a video and if you'd like to know the reason for that you can check out the short clip that I posted last week about the situation outside of the workshop and because I've been outside of the workshop this seemed like an appropriate video to get back at things with because today's video is about remote access specifically remote access using the raspberry Pi now the Raspberry Pi microcomputer has been around for about 11 years and in those 11 years it's become a favorite among makers and hobbyists and students and people have built thousands of different projects with it and not all of those projects require a mouse keyboard and screen there are many Raspberry Pi Projects that run Standalone things that run in your network to keep commercials off your web browser or a fan that is controlled in your attic with a temperature sensor in those cases it's really kind of a drag to have to add a keyboard mouse and Screen just to occasionally update the P to reboot it and so remote access is a great thing to use now I'm going to show you two different types of remote access remote access that just gives you a terminal screen which in many cases is all you need to start a Python program or to reboot or update the pi and also remote access that can give you the full goey experience with a mouse and a keyboard and everything that you need just as if you were sitting at the P itself and we're going to look at three different products to do that all of them from Raspberry Pi itself but before we get into those products I think it would be a good idea to learn a little bit about how a Raspberry Pi works on a local area network because that's the way that we're going to be doing remote access so let's take a quick look at networking and remote access with the Raspberry Pi today we'll be examining three remote access methods for the Raspberry Pi SSH VNC and Raspberry Pi connect all of these methods work upon tcpip these are the two protocols that the internet and your local area network are based upon TCP is transmission control protocol and it's responsible for delivery and reliability of the packets on a network IP is the Internet Protocol and it's responsible for the routing and addressing of those packets you can think of tcpi I as a flight on an airplane where TCP are your stewards who make sure that everybody is comfortable on the plane and IP or the pilots making sure the plane gets to where it is going let's take a look at a packet traveling from one workstation to another on the originating workstation TCP is responsible for packaging the data whereas IP is responsible for addressing it when the packet reaches the router TCP is responsibility for checking the reliability of the data whereas IP performs the routing on the destination TCP is responsible for the delivery of the packet whereas IP is responsible for the addressing making sure the packet went to its actual destination there are two forms of tcpip IP version 4 and IP version 6 IP version 4 is the most popular version of tcpip it's a 32-bit protocol however it is now running out of address IP version 6 improves the performance and security it's a 128bit protocol however the entire infrastructure does not yet support it but this is changing very rapidly to connect to a TCP IP network a Raspberry Pi or any other workstation requires three parameters a unique IP address the Gateway which is the destination for non-local traffic and a subnet mask to define the local area network let's see how this works we can take a look at our IP address and our subnet mask this will make more sense if we convert it to Binary when converted to Binary you can see how the subnet mask is applied to the IP address to determine what part of the address is the network address and what part is the host or local client address the subnet mask defines the boundaries of this local IP network it's also applied to the destination IP address if the destination is in the local network then packets are sent directly to it if it's not in the local network then packets are sent to the gateway address here's an example of this configuration in this configuration we have a router we have two local machines and a web server on the internet to send the packet from one workstation to the other the subnet mask is applied is determined that this is the local network and therefore there's no need to even go through the router when the destination is on the internet however the subnet mask will show that you need to use the Gateway in this case the router the packet will go through the router and be passed out to the web server on the internet when you have WiFi you'll have a different subnet for the Wi-Fi so you'll actually have two different local area networks it's also possible that your configuration might have additional local area network such as a guest Network or an iot Network these will all be different different subnets in order to transfer data between subnets your router will make use of an internal routing table this defines the routes between the subnets if you add additional equipment you might need to add static routes for those external networks otherwise they'll be unreachable from your local area network you might be wondering about those 1 192.168 addresses these are defined as private IP Networks this selection of addresses will never appear on the public Internet it's What's called the class c network with eight bits for the host and 24 bits for the network your rotor has two addresses the one on the local area network and an address on the public internet you can use port forwarding which is sometimes called the virtual server to Route external traffic to a private network if you want to use this with the remote access methods we're working with today you'll need to open up Port 22 for SSH or Port 5900 for VNC Raspberry Pi connect does not apply here your router will have a number of different configuration screens for setting up static networks and routes in addition your router can display the DHCP Client List which lists the IP address of all the devices on your network very useful when you're performing these experiments so get to know how to use your router configuration panel and let's go and configure some Raspberry Pi remote access now here's a small sampling of Raspberry Pi micro Compu boards that you could use for these experiments these are some of the more popular ones but there are certainly other boards as well such as the Raspberry Pi 400 which is an all-in-one computer system based upon the Raspberry Pi 4 now uh starting here we've got a Raspberry Pi 0w and this only connects to the network using WiFi whereas these other three boards can use Wi-Fi or ethernet and this is a pi 3 A pi4 and A pi5 I've also got the active cooler for the Raspberry Pi 5 over here you're going to need some form of cooling on this board because it does run quite warm even when it is idoling now if you're going to be buying a brand new Raspberry Pi I would recommend buying the Raspberry Pi 5 as it has some Advanced Hardware features and supports all the functionality of the newest Raspberry Pi operating system called bookworm but they've just updated Bookworm to run with all of the Raspberry Pi boards and so really any of these boards would be a good selection for your experiments with remote access and the Raspberry Pi now for the first two remote access methods that we'll be using today you'll need to know the IP address of your Raspberry Pi bear in mind that if you have WiFi and local area network connection you'll have two IP addresses and you can very easily determine that just by hovering over the network icon over here and you will get this uh display I hope you can see that it's got both my wireless network connection and my ethernet network connection IP address is displayed now another way you can do that is from the command line at the terminal so if you go into the terminal and do a host name command with a/i parameter you will get the two IP addresses however it doesn't distinguish which one is which I happen to know that the11 120 is the one on my local area network whereas a 39181 is on my Wi-Fi network but if you didn't know that you'd probably be better off just by hovering but any rate write those addresses down CU you're going to need it for the first two access methods now the first method of remote access that we're going to look at today is called SSH or secure shell SSH remote access will give you access to the terminal within the Raspberry Pi you won't get the complete goey but in many cases is this is all you need if you want to start a Python program if you want to do some updates if you want to reboot the pi a terminal is all that you require now SSH will require a client on your side and in many cases the client is already on your computer because the client is just another terminal so let's go and see how easy it is to set up and use SSH with the Raspberry Pi SSH or secure shell is a method of remotely accessing a terminal session on a Raspberry Pi SSH establishes a secure Channel using TCP Port 22 so this is the port that you'll need to open if you're configuring a router the pass SSH it employs public key cryptography to keep your data safe SSH is a tunneling protocol and a tunneling protocol keeps the data hidden and can also Traverse networks that normal TCP protocols cannot in order to use S SSH you'll require a terminal application using SSH on the Raspberry Pi is pretty simple you just enable SSH on the pie and then use a terminal if you're using Linux you could use the standard Linux terminal Mac users can also use the built-in terminal Microsoft does provide a Windows terminal that you can use with SSH it's not installed in Windows by default but it's a free download from the Microsoft store another free download and very popular terminal is putty which runs under windows and can also run under Linux using wine Now setting up SS is very simple you can do it just from your Raspberry Pi configuration screen which you'll get to by hitting the raspberry at the top here and then go into preferences and then go into Raspberry Pi configuration under the configuration screen go into the interfaces Tab and you will see a number of different options here and SSH is the first one just go and enable that click okay and it's done it's as simple as that and now we're ready to use SSH on the Raspberry Pi now another method of enabling ssh in the Raspberry Pi is to do it using the raspberry pi imager tool when you are first creating an image to boot from so you'll go through the normal options of choosing your device I'm going to choose a pi five choose the operating system and I'm always going to pick the most recent one which is bookor in this case and choose the storage device and here's my storage device now I'll click on next and I'll be offered the option to apply OS customization settings I'm going to go into edit settings now in the general settings you can set your host name you can set the username and password etc etc but what I want to show you is in Services you can enable SSH and if you do this it'll enable it with password authentication which is a standard feature so save that you might want to enable uh edit some of the things in the first page as well and then this will be a method of having SSH already enabled on a Raspberry Pi when you first boot it up now to use SSH from a remote computer you're going to need a terminal application and of course there are different terminal applications for different operating systems in this particular case I'm in Ubuntu Linux and I'm using the built-in terminal I've opened up the terminal and I've typed in SSH and then my username which in my case is drone bot Workshop of course us will be different and then an ampersand sign and then the IP address of the Raspberry Pi and so I'm going to hit enter and I am going to get this message about the authenticity of the host and this has to do with a security key you're only going to need to answer this once and it says are you sure you want to continue connecting and I'm going to type in yes and it's going to ask me for my password and I'm there and now if I do a command like LS to display file names I can see that I'm actually on the Raspberry Pi right now inside my session and so this is very simple and it's a very simple method of gaining remote access to a Raspberry Pi if all that you need is command line access if you need something more than command line access however we can look at another remote access method now in some cases terminal access to the pi isn't sufficient you need get the entire gooey screen and the next access method will give you exactly that VNC your virtual network computing allows you to get remote access to a complete terminal screen now you're going to need a VNC client on your end and there are different clients available for Windows for Linux and for mac and so you'll need to install that on your computer to use VNC otherwise setting up VNC on the pi is pretty well as easy as setting up SSH was so let's go and take a look at how we we set up and use VNC on the Raspberry Pi VNC or virtual network computing is a method of establishing a remote desktop connection with the Raspberry Pi VNC employs RFB protocol and uses TCB Port 5900 RFB or remote frame buffer protocol is a method of sending fullframe video over TCP while VNC itself does not provide security the Raspberry Pi implementation adds a security certificate VNC establishes a connection with a guey and accepts a mouse and keyboard input in order to use VNC you'll require a VNC client setting up VNC on the Raspberry Pi is pretty easy you just enable the VNC and on the remote end you can use a client such as tiger VNC or real VNC to enable VNC you'll do exactly the same thing you did with SSH open the Rasberry Pi configuration screen you'll notice an option for BNC here you can click on that and say okay and now we have VNC enabled on our Raspberry Pi now in order to use VNC you're going to need a VNC client on your computer and there are a number of different VNC clients available I'm using a free open- source client called tiger VNC and it's the one that Raspberry Pi recommends that you use it's available for a number of different operating systems and I'm using it right now under Microsoft Windows now when you start tiger BNC you'll get a dialogue box and in the box you'll need to put in the IP address of your VNC server so that's the IP address of the Raspberry Pi you'll also want to go into options and in Options under input do what I've done over here click show do one no cursor that'll make the display a lot better on the pie now I'm going to connect to the remote server and when I connect I get a username and password box now the first time you do this you'll likely get a couple of boxes about a security certificate just accept a certificate and you won't get it again this is your username and password on the raspberry piie and we'll say okay to that and we are on our Raspberry Pi screen as you can see this is the desktop on our PI and we can pretty well do anything here that we could do on the Raspberry Pi desktop so if you need a full desktop goey on a machine on your network VNC is a great way to go just set it up get a VNC client and you're on your way now the third and final remote access product that we are going to look at is also from Raspberry Pi and is currently in beta and it's a very active beta in fact I've refilmed this a total of three different times because every time I think I have the feature set of this down they keep changing it and adding new features and things that I told you in the video that you couldn't do you can actually do right now so there's a good chance that I'm going to tell you about some limitations in this product today that don't exist by the time you look at the video but I give up I have to make the video and this is actually a pretty amazing product it's called Raspberry Pi connect and Raspberry Pi connect is available in two different versions The full-fledged connect which will give you a remote desktop just like VNC and a smaller connect light which will give you just a terminal session just like SSH did the beauty of Raspberry Pi connect is you don't need to know anything about your network or about your IP address Raspberry Pi connect Works in conjunction with a Raspberry Pi server and you will need a Raspberry Pi account which you can get for free and so get yourself a Raspberry Pi account and let me show you how you can use Raspberry Pi connect Raspberry Pi connect is a remote access solution that comes in two different flavors connect and connect light with Raspberry Pi connect you can connect to a Raspberry Pi anywhere in the world without knowing its IP address rasbury Pi connect is based upon a pi connect server currently there is only one of these servers and that's in London England to use Raspberry Pi connect you enable Pi connect on your Raspberry Pi and then register your Pi with the Raspberry Pi connect server on the remote client you use your web browser to go to the connect dashboard and you select the dashboard from the server Raspberry Pi connect will try to establish a local connection on your local area network to the Raspberry Pi but if that's not possible it'll use the pi server as a relay the product is available in two different flavors Pi connect and P connect light P connect provides the full desktop guey experience and requires a web browser as a client P connect light only provides a terminal and it's also used with a web browser so let's go and set up Raspberry Pi connect if you're using the latest release of Bookworm then the installation of Raspberry Pi connect is very simple again you'll go into your Raspberry Pi configuration screen and you may just find that connect is already enabled if you haven't got it enabled you can of course just throw the switch and hit the okay button in order to enable Raspberry Pi connect now if you're using an earlier version of book quirm you can install connect at the command line and I have instructions for that on the article of the company's video on the dronebot workshop.com website now in order to complete the installation of Raspberry Pi connect you're going to have to connect it to the Raspberry Pi server and red Lister or the board and you can do this using the icon at the top of the guey that is for Raspberry Pi connect so just click on this and do sign in and it'll open the web browser now I'm already signed in so so I've got my ID here otherwise you'll have your login credentials to present and you're going to have to name the device that we're adding so let's just call this we'll create the device and sign in and it says it's successful so now this device has been added to my Raspberry Pi list and if you look at the devices on connect I now have this so I can go to another computer and connect to this Raspberry Pi so I'm on my computer and I'm on the Raspberry Pi connect screen and I can see the remote raspberry P I have and it says it has both screen sharing and remote shell so if I do connect via I have two choices screen sharing and remote Shell let's see what screen sharing looks like now this will take a moment to make a connection it goes out to the Raspberry Pi server in London and establishes the connection and there we go and we've got my Raspberry Pi and I can pretty well do whatever I want with it as if I was right at the desktop and all I'm using is a web browser so this is really convenient you could do this from your tablet you could do this from your computer probably even from your phone let's close this one and look at the remote shell and we do connect via and we'll do remote shell once again we've got to go out to the pi server and make the connection this can sometimes take a while and there we go we're on the remote shell and we can work on it just as if we were on the Raspberry Pi so Raspberry Pi connect is a really great way to do a remote connection to a Raspberry Pi you don't need to know your IP address it can work from inside your network it can work from outside your network it's simply a really great product and I urge you to experiment with it if you've got remote Raspberry Pi connection needs now as I said Raspberry Pi connect is a product that is still in consistent flux and they keep adding new features and removing limitations from it and so I would suggest that you check out the Raspberry Pi connect website for the official documentation as to what it can do right now there have been rumors that Raspberry Pi connect may be a product that you will need to pay for in the future because of the fact that it connects to a remote server right now there's only one remote server in London but they may change that and they may need to charge a cost to defay the cost of adding the servers that is just a rumor right now another rumor is that they're going to add a file transfer capability to it although you could do that right now using FTP or SFTP so again I would urge you to check the official Raspberry Pi documentation now you'll find a link to that documentation and a number of other useful resources on the article that accompanies this video on the dronebot workshop.com website and there's a link to that article right below the video while you're on the article if you haven't yet please consider signing up for my newsletter it's not a salesletter it's just my way of letting you know what goes on here in the workshop and lately what's been going on outside of the workshop also if you're in a signing up mood the dronebot workshop forums is a great place to go and you want to talk to like-minded individuals about your electronics projects it is free to sign up for the Forum as well and another thing that is of course free is to subscribe to the YouTube channel I love getting new subscribers and would love to make you the next one and all you need to do is click on that red subscribe button and if you also click the Bell notifications you will get notified every time I make a new video assuming of course that you've enabled not ifications for YouTube on your web browser and so until the next time we get together which I hope will be very soon please take good care of yourself please stay safe out there and I'll see you soon here in the dronebot workshop goodbye for now [Music]
Info
Channel: DroneBot Workshop
Views: 11,541
Rating: undefined out of 5
Keywords: Raspberry Pi Connect, Raspberry Pi Remote Access, ssh tutorial, ssh, VNC, tigervnc, raspberry pi, dronebot workshop, remote access
Id: l4VDWhKsFgs
Channel Id: undefined
Length: 25min 12sec (1512 seconds)
Published: Sun Jul 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.