In Part 1, we taught prepared an SD Card, and use Raspi-Config. In Part 2, you will cover about SSH, WiFi, VNC, and how to change your hostname. When you add a WiFi dongle, available on Amazon for under $5, you remove the need to have your Pi in the vicinity of a ethernet jack.
Wheezy Has a very nice, simple, and convenient GUI to help you set-up Wi-Fi, if you have a USB Wifi dongle plugged in. They are very inexpensive, and a list of all working adapters can be found at http://elinux.org/.
Simply enter X, by typing startx and you will enter the LXDE, The Light Weight Desktop Environment. On your Desktop there will be an icon labeled “WiFi Config”
First Scan for wireless networks, then select the one you want to connect to by double clicking on it, enter the Passcode in the PSK field, and click add. You can now close the scan window, and the GUI will automatically connect to the selected network. Now, every time you boot up your Pi, it will automatically attempt to connect to the known wireless networks on boot. You can Now unplug all the cables, except the power cable, as all the following commands will be terminal based.
If you choose to connect directly, ignore everything you just read, and plug in a CAT 5e cable into the Ethernet port into the Pi, and the other end into your router. There is no need to reboot, and the Pi immediately begin communicating with your network, and using DHCP, connect to the internet. You can Now unplug all the cables, except the power cable, as all the following commands will be terminal based.
Just like any computer, the pi is able to create users., and if you have multiple people using the pi, or just different apps, you may want to consider setting up different users.
Terminal ScreenShot of New User Dialogue
To create a new user, in the terminal enterYou will now be prompted to enter a password for the new user, insert their Full Name, and other optional information. To allow this user to use the ‘sudo’ command run the following command.
And that is it, you have created a new user with sudo permissions. Now you can logout using the ‘logout’ command, and login as your new user if you desire.
The hostname is what the Pi uses for localhost, and also is its “name” that other computers will identify the Pi with. It is necessary to change this if you have multiple Pi’s or if you don’t like the default name ‘raspberrypi”
Full Screen Text Editors
There are a variety of Full Screen Text Editors like pico, nano, and vi. They are very helpful when one wants to edit files from a ssh or a terminal. My favorites are pico and Nano, because they are relatively simple and utilize color coding when it knows the correct schema.
Changing the Hostname
One needs to change two text files, located in: /etc/hostname and /etc/hosts.
First, Change the first file to your new desired host name by using the command below.Now, check that the change was successful and correct.After you have verified the correct name change, now change the Hostname in this new again, it will be towards the bottom, and change only the area where “raspberrypi” is, don’t remove any of the other information. Use the command bellow.
127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.1.1 raspberrypi
127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.1.1 discovery
Again, check that everything went the way it was suppose to using the command found below.
After you have confirmed that both files were changed correctly, restart the device.
A quick word about Package Managers: They are applications, that usually come per-installed on your device, Wheezy has
apt installed. These apps allow us to install other packages which further expand the possibilities of your device.
sudo apt-get <package> goes and installs
‘sudo apt-get update` updates apt-get’s table of mirrors and online directories
‘sudo apt-get upgrade` updates any installed packages that are out-of-date, just like a software update on your PC
In your terminal enter:
To run tightvncserver just enter ‘tightvncserver’ into a terminal window. You will be prompted to enter a pass-word, you will need this when trying to connect to the VNC server.
Now use your favorite VNC software, and that is it, you now have a working VNC server.
the VNC server runs on port 5901
VNC in Action