Wednesday, September 16, 2015

Raspberry Pi 2 Model B–Adding Use 2.5″ Hard Drive - Hitachi Touro 1Tb USB 3.0

If you have a small portable 2.5″ hard drive that draws power from the USB port, you can make this work without the need for an external power supply with the Raspberry Pi. You will be modifying how the GPIO pins on the Pi work, specifically turning pin 38 on (represented by 1). 

This means you can double the current over the USB bus from 600mA to 1200mA so you can actually power external USB devices through the Raspberry Pi itself.
Update to latest firmware:
root@raspime:/# sudo rpi-update
Edit /boot/config.txt
root@raspime:/# nano /boot/config.txt
add this line to the /boot/config.txt
VerifyCheck gpio38, value should be '1'
sudo bash
root@raspime:/# cd  /sys/class/gpio
root@raspime:/# echo 38 > /sys/class/gpio/export
root@raspime:/# cat /sys/class/gpio/gpio38/value
Using the wiringPi gpio command, you can do the following:
To make sure everything in default conditions
gpio -g write 38 0
gpio -g mode 38 out
To increase the limit to 1.2A:
gpio -g write 38 1
root@raspime:/# gpio -v
gpio version: 2.26
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
Raspberry Pi Details:
  Type: Model 2, Revision: 1.1, Memory: 1024MB, Maker: Sony
Check gpio38, value should be '1'
root@raspime:/# gpio -g read 38

Raspberry Pi 2 Model B First Setup

Here is my Raspberry Pi 2 Specification :
The Raspberry Pi 2 Model B is the second generation Raspberry Pi. It replaced the original Raspberry Pi 1 Model B+ in February 2015. Compared to the Raspberry Pi 1 it has: A 900MHz quad-core ARM Cortex-A7 CPU, 1GB RAM.
Like the (Pi 1) Model B+, it also has:
  • 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
I’m using Minibian Wheezy-18022015 from here
The main features of last version (2015-02-18) included in MINIBIAN image are:
  • Kernel 3.18.7+ #755
  • 13 secs boot (on RPi 2)
  • 24 MB RAM used
  • 334 MB disk space used
  • Fit on 512MB SD Card
  • Optimized ext4 file system with swap disabled
  • Support for RPi B, RPi B+ and the new RPi 2
  • Targeted for embedded or server applications (NAS, Web server, electronic applications)
  • 100% full compatbile with officiale release
  • DHCP client enabled
  • SSHD enabled
  • root user enabled (default password: raspberry – please change it a.s.a.p.)
For storage, I’m using 4GB MicroSD Card (Visipro Class 6)
root@raspime:~# fdisk -l
Disk /dev/mmcblk0: 3997 MB, 3997171712 bytes
4 heads, 16 sectors/track, 121984 cylinders, total 7806976 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004a452
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1              16       97727       48856    b  W95 FAT32
/dev/mmcblk0p2           97728     7806975     3854624   83  Linux
Oke, Next step we are going to “copying” Minibian image (Minibian.img) to Sdcard, please follow step bellow.
  • Download Minibian Wheezy-18022015 from here.
  • Get SD Formatter from here it’s available for Windows and Mac.
  • Get Win32DiskImager from here it’s only available for Windows user, foe Linux user you can use DD tools.
  • Install and then open SD Formatter to format your MicroSDCard, when you are done, go to the next step.
  • Install and then open Win32DiskImager then choose Minibian.img  for Image File and for Device choose your Micro SDCard Drive.
  • When you ready, press Write button and wait it till finish.
  • Done, plug that MicroSDCard to Raspi and boot it.