In order to connect to the Raspberry Pi, it must be connected to the the network, either via Wifi or Ethernet. Wifi Should Already be Enabled on your device
To connect on a Windows machine you will need a 'ssh client' such as PuTTY. (Download here)
- Under hostname or ip input
[email protected]
, password israspberry
- Then connect, it may ask you to accept the keys. Go ahead and do so.
- While you're logged in, its good practice to change your password since its the default and very unsecure.
- in the terminal type
passwd
, it will ask for current pass, then ask for your new pass twice. (Be sure to remember this, and change it in the configuration for PuTTy) - Now we can start navigating files, for this
cd
akachange directory
will be used to navigate locations.
cd
requires another parameter to it to be on an use. For example for us to change to the local bin directory we would usecd /usr/local/bin
, then if we wanted to navigate back to the home directory, we could use a special character to get us there easiercd ~
.- Another important command when trying to figure out what directory we are in is
pwd
which "Prints the working directory"
- Initially when you are logged in it will take you to the home directory, typically
/home/$USERNAME
in this case it will be/home/pi
.
- Another word on directories, the characters
.
and..
are in reference tocurrent directory
andparent directory
respectively. In other words, to reference a file in the current directory you can use./file_in_cur_dir
and referencing a file in the parent directory../this_is_up_one_level
- Anther powerful tool in the CLI (command line interface) is
ls
, it is similar todir
in windows it will list all files in the current directory, or you can pass it a path and it will list files in the path.
ls -a
will list all files in current directory 'including files starting with.
', this is also syntactically the same asls -a .
ls /usr/local/bin
will list all files in the directory/usr/local/bin
excluding friles starting with.
- Now that we can navigate the file system and see what is in each file we can now start to make changes to files. There are several CLI text editors, some are easier than others. A few popular ones are
vim
andnano
. I will choose to usenano
in this introduction. Vim isn't all that friendly to beginners. (There's a reason the question how to exit vim? is one of the most viewed question on Stackoverflow. - Specifically for the project
lightshowpi
you will need to use the CLI to edit at least one file or two files to get things up and running. - Lets begin by editing the
defaults.cfg
file,
# We will start in the home directory, use the following commands
cd lightshowpi
cd config
sudo nano defaults.cfg
- From there a text editor window will open and you will see a lot of different text, but mainly what you'll be looking for the lines containing:
# Using 8 pins of GPIO on the pi:
gpio_pins = 0,1,2,3,4,5,6,7
- To close the editor without saving changes press
ctrl + x
then typen
and thenenter
- To save the changes press
ctrl + o
thenenter
, then closectrl + x
- If you are fine using these pins, then great nothing needed to change, just make sure you plug your GPIO wires into the correct pins and you're all set.
- You can find a pin out here.
- It lists
BCM $number
and(Wiring Pi $number)
, for all intents and purposes go by the(Wiring Pi $number)
as this project uses WiringPi. Those numbers will correspond to the numbersgpio_pins=
above.
- Once they are all hooked up properly you can start by testing out the hardware: You can check out some of the commands here.
- Another great place to ask questions or get ideas is the Google+ Community (https://plus.google.com/u/0/communities/101789596301454731630)
- With at least the basics covered as far as navigating and editing you can start taking a look at the getting started guide: http://lightshowpi.org/getting-started/
cd
- change directory e.g.cd ~
- navigates to home directoryls
- list files e.g.ls -a /home/pi/
- lists files in the home directory, including files start with.
pwd
- lists the file path of your current location in the file system. e.g.cd ~
thenpwd
will output/home/pi