Showing posts with label raspberry pi 2. Show all posts
Showing posts with label raspberry pi 2. Show all posts

This Week I Learned - 2016 Week 23

Last week write-up or you might want to read the whole series.

Calculate the power supply needed for your Power Supply Unit (PSU). It seems that my HP Proliant ML110 G6's PSU of 300 watt seems sufficient enough. Maybe the issue is with the power socket or adapter? Next step, install different operating system to test it out. Or maybe I should proceed on building a HTPC instead? But find the required parts is quite an frustrating process. I've never realize that quite a lot of product, for example, casing is not available in MY.

AMD Athlon 5350 Kabini Quad-Core 2.05 GHz is my favourite CPU processor (or APU to be exact) right now besides the XEON X-series. This is a very unique processor that sits between 5150 and 5370 but that supports virtualization extension (AMD-V). Hence, this processor is suitable for building your own homelab which fully utilizes the quad-cores for virtualization. Furthermore, the power consumption is 25 Watt TDP. However, the motherboard choices for AM1l is quite limited but so far only Asus AM1l-A seems to support ECC Ram or not?

One good example of using this processor is building a pfSense firewall. Why one want to build and setup a homelab? Well, if you want to be a full stack engineer or just having some fun building a machine.

As it's very hard to find a single 5350 in MY. The next best option to go for A4 5000, which have similar features to Athlon 5350 but lower clock speed. The only available APU option right now here is BioStar A68N 5000. While having higher TDP, it's still a preferable choice when compare to Celeron J1800 or J1900 for its AES encryption support and less painful VMWare's ESXi installation.

How to teach yourself programming. Learning a new programming language is never hard, you just have to use it on daily basis and experienced the whole eco-system.

Something more about Perl. The official Perl's Docker image is up (via Reddit). So right now, we can have an isolated Perl environment for customization and development. So many things I want to try out, for examples, Moo (Minimalist Object Orientation), DNSMadeEasy Webservices API, and try to figure out how to define and use constant properly in Perl.

While we're on Docker, it seems the default Docker installation in my Ubuntu 16.04 cannot be executed by non-root user. To enable this,
$ sudo groupadd docker
$ sudo gpasswd -a ${USER} docker
$ sudo systemctl restart docker
$ sudo systemctl status docker
$ newgrp docker # no need to logout and login again
$ docker version

Chromiun OS for Single Board Computers (SOCs). Is time to use back the shelved Raspberry Pi 2.



Raspberry Pi 2 : Installation

Tail your kernel log and insert your SD Card. Below is the result I obtained from my lappy.
$ sudo tail -f /var/log/messages
......
Feb  8 03:15:27 butterfly kernel: [16266.527753] mmc0: new high speed SDHC card at address aaaa
Feb  8 03:15:27 butterfly kernel: mmc0: new high speed SDHC card at address aaaa
Feb  8 03:15:27 butterfly kernel: [16266.528442] mmcblk0: mmc0:aaaa SL08G 7.40 GiB 
Feb  8 03:15:27 butterfly kernel: mmcblk0: mmc0:aaaa SL08G 7.40 GiB 
Feb  8 03:15:28 butterfly kernel: [16266.538560]  mmcblk0: p1
Feb  8 03:15:28 butterfly kernel: mmcblk0: p1

Or list our our SD Card block device. Note that MMC stands for MultiMediaCard where the naming convention, mmcblk{id}{partition} is used in GNU/Linux.
$ lsblk | grep mmc
mmcblk0                                       179:0    0   7.4G  0 disk  
└─mmcblk0p1                                   179:1    0   7.4G  0 part 

Confirm again through local file system.
$ ls -l /dev/mmc*
brw-rw----. 1 root disk 179, 0 Feb  8 03:15 /dev/mmcblk0
brw-rw----. 1 root disk 179, 1 Feb  8 03:15 /dev/mmcblk0p1

As the time of writing, the there are only four Operating System images available for Pi 2. We're going to download both Raspbian (Debian Wheezy) and also recently release Snappy Ubuntu Core, a minimal server image. For faster download, use a download manager that support multiple connections download. I'm using aria2 with four concurrent connections as shown below.
$ aria2c -x 4 http://downloads.raspberrypi.org/raspbian_latest
$ aria2c -x 4 http://downloads.raspberrypi.org/ubuntu_latest

$ ls -lh 2015*.zip
-rw-rw-r--. 1 ang ang 977M Feb  7 03:05 2015-01-31-raspbian.zip
-rw-rw-r--. 1 ang ang 679M Feb  8 03:55 2015-02-03-pi-snappy.zip

To verify that you've downloaded both images successfully, generate the SHA-1 hash value locally and then copy it and search against the downloads page.
$ sha1sum 2015*.zip
0171e77f687c447dae32609fcc6aa700c750d6f5  2015-01-31-raspbian.zip
4ca8ea6b694ad644cf4b00337a625b28bc8f8455  2015-02-03-pi-snappy.zip

Uncompress both download images. Note that you need to add single quote for the unzip program to work on multiple zip files.
$ time unzip '2015-0*.zip'
Archive:  2015-01-31-raspbian.zip
inflating: 2015-01-31-raspbian.img  

Archive:  2015-02-03-pi-snappy.zip
inflating: pi-snappy.img           

2 archives were successfully processed.

real    2m24.316s
user    1m7.767s
sys     0m4.985s

As you can see from the uncompress file size of both images, is best to get a SD Card with size equal or more than 8Gb if you wish to install or store more data to it.
$ ls -lh *.img
-rw-r--r--. 1 ang ang 3.1G Jan 31 21:36 2015-01-31-raspbian.img
-rw-r--r--. 1 ang ang 2.8G Feb  3 15:06 pi-snappy.img

Following the installation guideline for GNU/Linux using command line tools, we're going to write the image (Raspbian first) to the SD card using the dcfldd program, which show progress instead of disk dump (dd) program.
$ sudo yum install dcfldd
......
$ time sudo dcfldd bs=4M if=2015-01-31-raspbian.img of=/dev/mmcblk0
768 blocks (3072Mb) written.
781+1 records in
781+1 records out

real    4m50.750s
user    0m0.017s
sys     0m8.754s

Remove your SD card and insert into your Pi and boot up the machine.

Raspberry Pi 2 : Hardware

The next generation of Raspberry Pi 2 has been recently released and on sale for USD 35. Instead of sourcing it through local MY distributor (slow and expensive as well), I bought it directly from element 14 which costs me around MYR 118 with free shipping. Surprisingly, instead of posted delivery date in the website, they shipped the board to me directly the next available day after confirmed payment!

Why getting this Pi 2? Two main reasons. First, ARMv7 processor support where you can install any available ARM GNU/Linux distributions and Windows 10. Secondly, better hardware specification of 900Mhz quad-core ARM A7 CPU and 1Gb RAM, which surely will give me a better media experience compare to Pi 1.

Unfortunately, you will need to spend more money to set everything up. There is no available casing for Pi 2 yet and the I can't reuse back my original Pi 1 casing. But I can live with that. Also, I've misplaced my micro SD card and need to get a new one instead. Checking against the available and working SD cards, I ended up purchasing SanDisk 8GB MicroSD Memory Card [SDSDQM008GB35A] which cost me MYR 15. There are cheaper card but I opted to be safe and the card also came with an adapter.

Next, continue with Operating System installation.