Skip to main content

Running Debian on Raspberry Pi (and SD card woes)

After waiting for nearly 3months, I finally got my Raspberry Pi last week from Element14. Plan was to set it up as a file server for network enabling my external hard disks.


Raspberry Pi debugging setup
Debugging setup
Attempts to use a SandDisk 8GB Class 10 Extreme SD card and Debian Squeeze image, following the instructions here, were completely futile. Tales of my woes and subsequent hardware level debug attempts can be found in this thread.
Plugging in the card and attempting to boot the RasPi failed miserably initially.
Damn ugly pull up resistors on the
SD IO lines
Implementing the pull-up resistor hack suggested by jhasler, resulted in a fugly looking but partially working RasPi. It was atleast attempting to boot now, although it was throwing up a kernel panic immediately after loading the kernel.



After loading kernel card drivers
SD DAT0 line, before kernel is loaded.
Probing the SD card IO lines with a high BW scope, revealed some glaring anomalies. The SD Clk speeds up and the pulses on the SD DAT lines become terribly distorted once the kernel mmc driver is loaded. Apparently the kernel driver is pushing things outside the hardware specs of the RasPi. Hopefully this will be addressed in the future firmware or patched kernel releases.

Anyway, finally had great luck with a 4GB SanDisk Class 4 SD card and the 2012-06-18-wheezy-beta image. It immediately booted up and within a few seconds, I was greeted by the friendly raspi-config menu similar to the one below, which lets the user configure the GPU memory share, KB layout, locale and a few other useful stuff.

raspi-config menu inside a ssh session.
A few simple choices and finally I get the much awaited Debian login prompt!

For powering the RasPi I was initially using my Nokia 5800 (yes I am still using this pre-historic phone!) micro-usb cable connected to my desktop but later on replaced it with a Belkin powered usb hub.



RasPi powered by Belkin USB Hub.
One of the downstream ports of the hub powers the RasPi. while the upstream port of the hub is plugged back to the USB port of the Pi. The arrangement looks a bit funny though ( no, this is not a perpetual machine, the external power connector to the hub is yet to be connected :P )

The external HDD, one additional USB to ethernet connector (I am connected to 2 different subnets) and keyboard (temporarily) were all plugged into the HUB. My Mac Mini's HDMI to DVI connector, was of great help during the initial setting up. Once that was done, SSH is now working just fine for me, no longer need the KB or display.
I'll keep jabbering about my further experiences with this tiny beast, in the next few posts!!





Comments

Popular posts from this blog

Force an application to use VPN, using iptables in Linux

Enforcing an application, for example a torrent client like Transmission , to always use the VPN interface or any particular network interface for that matter, is trivially simple using iptables on Debian, Ubuntu or any other GNU/Linux distro. Personally, I am running Debian Sid on the Raspberry Pi . Occasionally I use it for downloading files ( legal stuff, seriously, believe me :D  ) using Transmission Bittorrent client over a VPN connection. Sometimes it happens that the VPN connection fails and doesn't reconnect for whatever reason and Transmission continues pulling stuff directly over my internet connection, which I would like to avoid. Fortunately it is very straightforward to enforce rules based on application owner UID. Transmission runs under the owner debian-transmission in Debian (use htop to check this) and the following two lines of iptables ensures that any process with owner having UID, debian-transmission , will not use any other network interface apart from the

Rendering LaTeX in Blogger.

Rendering LaTeX in Blogger is pretty easy thanks to the JavaScript LaTeX equation render engine from http://www.yourequations.com . To enable LaTeX rendering go to the Blogger Dashboard --> Layout --> Edit HTML . Then add the line <script> type="text/javascript" src="http://tex.yourequations.com/"></script> <script type="text/javascript" src="http://tex.yourequations.com/"></script> just before <body/> . Half the job is now done. Then, for example to render: \int_{0}^{\pi}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx =\frac{22}{7}-\pi Use the code: <pre lang="eq.latex"> \int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx =\frac{22}{7}-\pi </pre> The LaTeX code will now be displayed as: \int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx=\frac{22}{7}-\pi Ofcourse Javascript needs to be enabled in the Browser for the renderer to work.

Making inactve USB Hard Disk spin down automatically in Linux.

I have a 400GB Seagate IDE HDD connected to Mars, our hostel's file-server using an USB enclosure. The USB enclosure is a cheap "Made in China" product. Consequently it has some special "features". One such notable "feature" is that the disk is kept spinning by the controller even if there has been no disk I/O for a long time. I have three other USB disks connected to the same machine, a 1TB Seagate FreeAgent Desk External Drive, a 500GB Maxtor Basics External Drive and a 2.5" 60GB Fujitsu SATA Disk inside a Transcend USB enclosure. All of these spin down themselves if there has been no I/O for sometime. Keeping the hard disk spinning unnecessarily for ever, not only wastes power but also overheats the drive, thereby reducing its life. I tried noflushd, which is supposed to force idle hard disks to spin down, but found it to be of no help. USB enclosure generally work by performing an SCSI emulation over USB. sdparm is an utility which can be use