Saturday, 26 October 2013

Use SSH to control Raspberry Pi

OK, let's think how to control your Raspberry Pi using your computer. Therefore, you do not need to connect keyboards and mice to your Raspberry Pi, you only need to control it using your laptop. I use my mac to control it, if you use Windows, the method is little different.

So the first thing is opening your Raspberry Pi and then open LXTerminal to input the following command:
$ifconfig
The following information will be shown as Figure 1, this information is related to the network of your Raspberry Pi. For SSH, the IP address is important. 

Figure 1: Display IP address in Raspberry Pi 

OK, now I know my IP address in Raspberry Pi, and then open your mac Terminal to input the following command.
$ ssh pi@Raspberry-Pi-Address

Notice: pi is the user default user name for your Raspberry Pi, if you have changed your user name, please replace it. And replace the Raspberry-Pi-Address to your IP address in Raspberry Pi as shown in Figure 2.


Figure 2: SSH interface 

OK, you can control your Raspberry Pi with using your laptop now, for example, control GPIO pins as shown in Figure 3:

Figure 3: Input command to control GPIO

OK, we can control it successfully, the result are shown in following figures:
Figure 4: LED is turned on

Figure 5: LED is turned off

OK, we have controlled Raspberry Pi successfully so far, and next I will shown how to control Raspberry Pi through remote desk.


No comments:

Post a Comment