____________________________________________ New Install Instructions on Raspberry Pi ____________________________________________ # by WA8KIM / kim@kim125.com / EchoLink: WA8KIM-R / WiRES-X: Rm#21149 / Last updated 08/24/2015. # http://www.wa8kim.com/rpi.html # Thanks to MANY uncredited contributers. # Best viewed in Notepad with Word Wrap OFF/UNCHECKED and in full screen Download the latest version of this file at: http://www.wa8kim.com/files/(RPi)%20Install%20-%20New%20RPi%20Setup.txt A good starting point is the RPi's main website at: http://www.raspberrypi.org/downloads/ 1. Download Raspberry Pi Raspian (Wheezy / Debian) http://www.raspberrypi.org/downloads 2. Download Win32DiskImager utility http://sourceforge.net/projects/win32diskimager/ 3. Use Win32DiskImage to write the Raspian-Wheezy.img file onto an SD/microSD card 4. Place SD card into RPi and power it up. It should bring up a config menu. 5. Change the following settings: (if the setting menu does not appear, type 'sudo raspi-config') - 1. Expand Filesystem: makes the entire SD card available. - 2. Change User Password: The default password is raspberry - 4. Internat'l Options: Change Locale and Timezone as needed - 8. Advanced options: - A2 Hostname: Change the RPi's network name - A3 Memory Split: If you are NOT going to use the graphical GUI, reduce the amount of graphical memory to 16 - A0 Update; update the config utility - Press [Tab] down to 'Finish' and YES to reboot. (If the system didn't reboot, type 'sudo reboot' to reboot) 6. (OPTIONAL) Begin using PuTTY on your Windows PC to control the RPi so that you can cut & paste commands: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Hostname is your RPi's IP address. (Your RPi will display it's IP on the screen or type 'ifconfig' on your RPi) Use SSH port 22 The default login is: pi The default password is: raspberry (or use the new password you created) 7. Download and install the latest Raspian updates: sudo apt-get update sudo apt-get upgrade (May take 30-60 minutes!) 8. Download and install RPi firmware updates: sudo apt-get install git-core ca-certificates 9. Download the rpi-updater script: sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update 10. Make it executable sudo chmod +x /usr/bin/rpi-update 11. Run it: sudo rpi-update 12. To start the x11 GUI (Windows-like desktop: Will only work if the RPi is connected to a monitor) startx ___________________________ The following are OPTIONAL: ___________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ WiFi Setup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Displays all your Wifi settings/addresses sudo iwlist wlan0 scan (Write down your ssid) # /etc/wpa_supplicant/wpa_supplicant.conf is where the RPi stores all Wifi login info # Add the content between the '-----------'s below to the end of the file sudo nano /etc/wpa_supplicant/wpa_supplicant.conf --------------------------------------------------- network={ ssid="your_wifi_name" psk="your_password" } --------------------------------------------------- To Disable WiFi: sudo ifdown wlan0 To Enable WiFi: sudo ifup wlan0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ To Skip Login (Automatically Login To User 'Pi') ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sudo nano /etc/inittab --------------------------------------------------- Comment out the following line: (Placing a # in front of any text "comments" it out: meaning the RPi will ignore everything following it on that line) #1:2345:respawn:/sbin/getty 115200 tty1 and add the following line instead: 1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1 --------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ To Create A Static IP Address ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # First, determine your current IP address info and write it down # Log in to your Raspberry Pi and type the following: ifconfig # Write down the , , & info for your desires internet card. (eth0 is the Cat-5 LAN, wlan0 is your Wifi) # is your IP address # is yoru broadcast IP, which is usually just your IP address with a .255 for the number # is your netmask # Your gateway will be displayed using the following command route -n # Modify the /etc/network/interfaces file as below, substituting with your IP addresses sudo nano /etc/network/interfaces --------------------------------------------------- #iface eth0 inet dhcp iface eth0 inet static address 192.168.1.39 netmask 255.255.255.0 gateway 192.168.1.1 --------------------------------------------------- # The following sets the static DNS server (192.168.1.1 is your router, the 8.8.8.8 is Google's free DNS server) sudo nano /etc/resolv.conf --------------------------------------------------- nameserver 192.168.1.1 nameserver 8.8.8.8 --------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ To Autorun A Program ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # /etc/rc.local is RPi's version of MSDOS's autoexec.bat # Anything placed within the /etc/rc.local will be run when the RPi is turned on / rebooted. sudo nano /etc/rc.local # Add the program you want to load prior to the 'exit 0' command # For example: --------------------------------------------------- echo Starting EchoLink Proxy Server . . . cd /home/pi && java -jar EchoLinkProxy.jar echo Starting VNC Server . . . sudo tightvncserver :0 -geometry 1024x768 -depth 16 exit 0 --------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ Change SSH Port ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sudo nano /etc/ssh/sshd_config # Change the port in the following line: Port 22 # Restart the SSH server or reboot for changes to take effect. sudo service ssh restart # Don't forget to change the port number in your router's port forwarding! _______________________________________________________________________________________ Common Debian / Linux commands: _______________________________________________________________________________________ sudo Administrator privilages sudo -s Administrator privilages for entire session sudo raspi-config Access the main config screen / menu man [filename] Displays the manual. man man displays helpful RPi manual nano Like notepad vi Text Editor alsamixer Sound / Volume Mixer sudo alsactl store Save settings sudo svxlink To start SVXLink pwd Displays current directory (Print Work DirectorY) ls Directory list ls -l DIR with details less [filename] Displys file (text) one screen at a time cd Change directory mkdir Create directory mkdir -p /dir1/dir2/dir3/etc. Create multiple directories rmdir Remove empty directory rm Deleted file rm -r Delete file or directory recursively cp [source] [destination] Copy file or directory cp -r Copy file or directory recursively mv Move file chmod Change permission of file u=user g=group o=other_users r=read w=write x=execute chgrp Change group permission cat [file] ex: *.txt Displays contents of file(s) cat /proc/cpuinfo Displays processor usages (like task manager) cat /proc/meminfo Displays memory usage cat /proc/partitions Displays partition info cat /proc/version Displays RPi OS Version vcgencmd measure_temp CPU temp vcgencmd free -o -h Free system memory vcgencmd get_mem arm && vcgencmd get_mem gpu Shows CPU and GPU memory lsusb Lists all USB devices startx Runs the GUI interface sudo shutdown –h now Shut down sudo shutdown –r now Reboot sudo reboot Reboot dd Copy disk [dd if=/dev/sdd of=backup.img] would copy SD card df Displays disk space available df -h Displays disk space available in "human' format unzip Unzip file tar -cvzf *filename.tar.gz* *directory/* Create a compressed file tar -xvzf *filename.tar.gz* Extract compressed file | ex: cat /boot/kernal.img | aplay Pipe command output from one command to another > ex: ls > listing.txt Redirection tree Shows directory tree & Runs command in background wget Download file from web search find [filename] Searches for file ping Ping nmap Network exploration and scanning tool. Run just 'nmap' for help ifconfig Displays network configuration for the interfaces on the current system ifconfig eth0 or lo Displays configs for eth0 or lo devices su [user] Change user su Change user to root passwd [user] Change the password of [user] sudo shutdown -h now Shut Down System sudo halt Shut Down System sudo shutdown Shut Down System grep SearchWord */* Searching for a string in 1 or more files [command] --help Displays help file for command tail Last few lines of a file head First few lines of a file top Display CPU and Memory usage (like task manager) ps -aux | less Displays all process and their ID number kill [95689] Kills process # [CTRL-C] Kill current running program [CTRL-D] Exits the shell [CTRL-A] Move cursor to beginning of line [CTRL-E] Move cursor to end of line iptables -L See what rules are already configured EN_UART-LCD Enables 3.2in Touch screen DIS_UART-LCD Disables 3.2in Touch screen sftp Secure FTP scp Secure copy over network sudo date --set="Sun Nov 18 1:55:16 EDT 2012" ls /dev/tty* Displays all serial ports sudo netstat -ltnup Shows what programs are listening on what ports netstat -an | grep tcp See what programs are using tcp ports netstat -an | grep udp See what programs are using udp ports ln -s /home/pi/file shortcutname Create a shortcut /usr/local/bin Folder to place shortcuts (.sh files) rwx (user) rwx (grp) rwx (everyone) 2 pi (usr name) pi (group name) 4096 (size) Oct 24 21:29 filename u user chmod commands g group chmod u+rwx,g+rwx,o+rwx file.txt o others not in group chmod G+wx file.txt a all/everyone r read permission chmod u+rw,g+rw,o+rw w write permission x execute permission + add permission - remove permission sudo nano /etc/network/interfaces Change IP address sudo nano /etc/resolv.conf Change DNS Server sudo nano /etc/rc.local AutoExece.bat file sudo nano /etc/firewall-openvpn-rules.sh Firewall config file Change Host Name: sudo nano /etc/hosts Change 127.0.0.1 to Your_Name sudo nano /etc/hostname Change to Your_Name sudo /etc/init.d/hostname.sh sudo reboot ------------------------------------------------------------------------------------------- -------------------- REVISION HISTORY -------------------- 2015-08-24 Updated Download Link 2015-03-03 File Created