Update[22 Oct 2015]: Added some essential software(s) to have on your Raspberry Pi 2!
So, the coolest thing happened and I decided to finally buy the famous $35 computer last week. Yes! Raspberry Pi 2 – MODB – 1GB – Quad core it is. Raspberry Pi 2 was in my gadget’s bucket list from almost a year now. Amazon India was running some cool discount this week and I also had a Gift voucher resulting in the purchase. I got the latest Model B which is touted to be 6x faster than last generation.
After tinkering with this gorgeous SoC (System on chip) for last week, I feel I am qualified to write this review to ponder over why you should buy a Raspberry Pi 2 and what can you do with it. So, shall we begin?
Raspberry Pi? Is it yummy?
Well yes! But not the way you are thinking 😉
The Raspberry Pi 2 Model B is the second generation of Raspberry Pi family. It replaced the original Raspberry Pi 1 Model B+ in February 2015. Raspberry Pi has a very interesting history behind it. It was developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools. The idea behind a portable computer goes back to 2006. The original reason behind it’s development was the dipping computer literacy in UK or to quote in the Raspberry Pi Foundation words:
“The idea for Raspberry Pi grew out of concern about, the year-on-year decline in the numbers and skills levels of the A Level students applying to read Computer Science in each academic year.”
But as we all know, RPi’s popularity increased beyond the intended use-case over the years and it soon became the favourite gadget for DIY enthusiasts as RPi being a portable computer found it’s way in many personal projects. We will be looking on those but first, let’s visit the hardware department to see what is it actually that RPi 2 is packing 😉
So what’s in the box?
- Safety Guide & Quick Start Guide
- Raspberry Pi 2 SoC (System on chip)
- The box itself 😛
And done. This unboxing itself speaks volume of the purpose of RPi. It is not there to replace your Desktop or Laptop, It is just meant to be a pure DIY kit where you have the freedom to juice up your creativity and extend the functionality as you like. It will just provide you the barebone foundation. Hmm, since we are talking about the SoC, let us look up the hardware and see what all do you get soldered on this credit card size microcomputer.
- A 900MHz quad-core ARM Cortex-A7 CPU
- 1GB RAM
- 4 USB ports
- 40 GPIO pins
- Full HDMI port
- Ethernet port
- Combined 3.5mm audio jack and composite video
- Camera interface (CSI)
- Display interface (DSI)
- Micro SD card slot
- VideoCore IV 3D graphics core
All this for just $35!
Sounds nice! How to set it up?
RPi 2 boots up using a microSD card (yep, the same you use in your smartphone) and because it has an ARMv7 processor, it can boot up the full range of ARM GNU/Linux distributions, including Snappy Ubuntu Core, as well as Microsoft Windows 10 IoT core. The portable size gives independence to carry it anywhere and run it headless and control it off your phone (more on this later).
But first follow this awesome quick start guide to get your pi booting up. It will basically help you to Format the card, Write the OS’s image on it and get you boot it up. I won’t explain it here as it is very well explained in the link above.
I used Raspbian for the initial use and would suggest you to try the same one. It’s super easy to setup and use. It would feel trivial if you have used any OS (Windows/Mac/Linux) before. After writing the card with N00Bs image when you first boot up the RPi 2 and connect the USB keyboard & mouse and display via HDMI port and a 5V microUSB adapter for Power. Choose the partitions and the OS as suggested and wait for it to install. After the installation completes, it will reboot and you will be greeted by the Raspberry Pi configuration screen.
Tinker with the options and make sure to go to #8 Advanced Options screen. Make sure to Enable the SSH because you will be using this extensively. Feel free to play with the options but make sure you know what you are doing. If you don’t, please please visit the Official Raspberry Pi Documentation and read it, it will help you a lot to cover the basic as well as advanced option(s) about your Pi.
After you hit the finish, you will be asked to log in. Depending on if you changed the password for user “pi” via Raspi-config screen, use that to login and you will be in the Terminalish console.If you are well versed with Linux, the terminal is all what you will need to use it but if you are more of a GUI guy, just enter “startx” and press enter. It will boot you in the GUI environment of Raspbian.
Learning curve is bare minimum. Raspbian is a a super minimalistic, clean and free operating system based on Debian which is optimized for the Raspberry Pi hardware. An operating system is the set of basic programs and utilities that make your Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over 35,000 packages(via APT repository), pre-compiled software bundled in a nice format for easy installation on your Raspberry Pi. You will be just one command away to install any software, be it Java Development Kit or Php or MySQL server. That’s the beauty of Linux.
Remote Access is the king?!
Since we will be using the RPi in different projects, we will need a way to access it remotely so that we won’t need to connect a monitor, keyboard or mouse to it, instead we will use it with just a power supply (either plugged in the wall or battery) and internet connection (ethernet or wifi dongle).
SSH to the rescue!
SSH (Secured Shell) will allow us to access the RPi remotely from any machine (Windows/Mac/Linux/Android/iOS) provided it is in the same network. Most of you who have worked with Linux must be smiling right now as you know how powerful a shell is in Linux world. So let’s understand the basics:
So, by using SSH we basically get the command windows (SHELL) on our personal system and by using the keyboard we can execute command remotely. For our Raspberry Pi, we need a setup like this, where both the client and server are in same network. To understand more, check out the following:
Now simply headover to Raspberry Pi SSH doc page and follow the steps. Soon you will be up and running with the shell console remotely. We do have more ways to connect to the Pi, for instance if you want a full blown remote Desktop GUI access you will have to use VNC server, or if you want the access to the files you can setup a FTP server, or you can serve webpages in your intranet by setting up a HTTP webserver. Possibilities are endless! Just visit the Remote Access Documentation page and get your hands dirty (which is the best way to learn it fast).
I am assuming here that you installed Rasbian on your RPi and you can run your RPi purely headless i.e. just with power source and an ethernet cable and SSH into into from any other machine.
Since you knew and bought a Raspberry Pi, it can be safely said that you belong to the eternal “curious geek” category. You like to build stuff and you get immense pleasure out of your DIY projects. So, let us look at the things you must have up and running on your RPi to use within terminal. Let start with the list:
💡 Make sure you do a
sudo apt-get update && sudo apt-get upgrade -y before installing the software(s) below.
- apache2 – Apache HTTP Server | Duh.
$ sudo apt-get install apache2
- avahi-daemon – Avahi mDNS/DNS-SD daemon | Great for name resolution & for finding printers on network.
$ sudo apt-get install avahi-daemon
- bzip2 – High-quality block-sorting file compressor | You will need this for attempting The Python Challenge.
$ sudo apt-get install bzip2
- cowsay – A configurable talking cow | Because why the hell not?!
$ sudo apt-get install cowsay
- curl – A command line tool for transferring data with URL syntax | Should be preinstalled but just in case.
$ sudo apt-get install curl
- fortune-mod – Provides fortune cookies on demand | Isn’t that supercool?
$ sudo apt-get install fortune-mod
💡 You can use fortune with cowsay to get something cool like this:
- gcc – GNU C compiler | Super useful when you have to make a software from it’s source.
$ sudo apt-get install gcc
- git – The stupid content tracker | Push that code baby! 😉
$ sudo apt-get install git
- gzip – GNU compression utilities | Hello? ZIP files ftw \m/
$ sudo apt-get install gzip
- htop – Interactive processes viewer | My most used software!
$ sudo apt-get install htop
- minecraft-pi – Minecraft for the Raspberry Pi | Because we can.
$ sudo apt-get install minecraft-pi
- mysql-client & mysql-server – MySQL database client and server | To become SQL champ!
$ sudo apt-get install mysql-client mysql-server
- nano – small, friendly text editor inspired by Pico | Best thing if you are not comfortable with Vi
$ sudo apt-get install nano
- ncdu – ncurses disk usage viewer | Interactive disk space usage per file/folder
$ sudo apt-get install ncdu
- nmap – The Network Mapper | Network exploration tool and security / port scanner
$ sudo apt-get install nmap
$ sudo apt-get install nodejs
- omxplayer – Command line media player for Raspberry Pi | Play some music via shell
$ sudo apt-get install omxplayer💡 ProTip: Use Omxplayer on RPi to make your own BoomBox.
- openjdk-7-jdk – OpenJDK Development Kit (JDK) | Open source Java
$ sudo apt-get install openjdk-7-jdkOR
oracle-java8-jdk– Java™ Platform, Standard Edition 8 Development Kit
$ sudo apt-get install oracle-java8-jdk
Q: What is the difference between the source code found in the OpenJDK repository, and the code you use to build the Oracle JDK?
A: It is very close – our build process for Oracle JDK releases builds on OpenJDK 7 by adding just a couple of pieces, like the deployment code, which includes Oracle’s implementation of the Java Plugin and Java WebStart, as well as some closed source third party components like a graphics rasterizer, some open source third party components, like Rhino, and a few bits and pieces here and there, like additional documentation or third party fonts. Moving forward, our intent is to open source all pieces of the Oracle JDK except those that we consider commercial features such as JRockit Mission Control (not yet available in Oracle JDK), and replace encumbered third party components with open source alternatives to achieve closer parity between the code bases.
- sl – Correct you if you type `sl’ by mistake | Steam Locomotive classic Linux joke
$ sudo apt-get install sl
- tightvncserver – Virtual network computing server software | Interact with RPi graphic desktop wirelessly
$ sudo apt-get install tightvncserver
- vim – Vi IMproved,enhanced vi editor | Best text editor of Linux
$ sudo apt-get install vim
<Note: This post is in development as you read. I will keep adding the new things and DIY setups I do with my RPI so make sure to bookmark this.>