Linux Scheduler

The default Linux process scheduler is the Completely Fair Scheduler (CFS). To change the default for Raspberry Pi, change the ‘elevator’ kernel parameter within /boot/cmdline.txt.

By default, it’ll have “elevator=deadline”. You can change deadline to noop or cfq. However, the default seems to be the best for interactive performance.

PiGlow

Experiments with PiGlow 🍰 ✨

I just got the PiGlow LED display module for raspberry pi. Connected it to RPi and tried to enable the SPI and i2c buses using

sudo raspi-config

But this is what I got:

ERROR: could not insert 'spi_bcm2708': No such device

😪

Turns out that there have been some changes in the Linux kernel. From 3.18 onward, (for the arm-compiled kernel), the kernel uses “device trees”, which breaks SPI and I2C unless config changes are made 👷. Here are some posts describing the problem:

linux kernel 3.18+ breaks spi, i2c

Well it turns out that in spite of the error above, the raspi-config utility does add the required lines to /boot/config. Once that is done, follow the remaining steps as outlined here:

Setup I2C

After that is done, reboot and test if I2C is up and running by doing:

i2cdetect -y 1

and you’ll see some output of rows and columns.

For the B+ board, and all newer boards, the channel 1 is used instead of channel 0. Once I2C is setup, download the code from Pimoroni’s website. Compile it and run the example script as described!

PiGlow

Jason has a nice Python class for the PiGLow on his github page:

Jason-PiGlow

Here’s a picture of my PiGlow module:

IMG_5754

Raspberry Pi Home Server: Part 6, Adding a hard drive

The perfect guide to booting up the Raspberry Pi from a USB stick.

MelGrubb.ToBlog()

This article is part of a series. See the Index for more information.

Running the Raspberry Pi off of an SD card is simple, affordable, and very convenient. SD cards are also very small compared to hard drives, though, and they can only be written to a finite number of times. That number is ridiculously large, but some have said that it can still be used up faster than you think by things like virtual memory swap files which are written and re-written constantly.

Whether you believe that or not, one thing is certain; In order to be a useful home server, the Raspberry Pi is going to need access to more storage space than you get from a simple SD card. The Raspberry Pi Home Server is going to need a proper hard drive, and as long as you’re adding a hard drive, you may as well take advantage…

View original post 3,971 more words

Backup, backup and wait for it…. backup!

We must remember to backup the RPi’s SD card! First of all, SD cards were never meant to be used the way they are in the RPi. They were meant for data blocks written infrequently by cameras. USB flash drives are better suited for RPi-kind data storage than SD cards.

Secondly, the RPi’s data bus is very finicky when it comes to the input voltage. I was trying to power my Pi using a portable mobile phone charger by HooToo (hootoo). Though it’s rated output is 2A, I think I connected and disconnected it multiple times by mistake without a clean shutdown. This corrupted my sd card! But I am not talking about just data corruption – it physically corrupted it such that it cannot even be read anymore.

So the lesson learnt is – backup as much as possible!

The simplest way I know is to use a Linux computer and the ‘dd’ command. Here are some steps to follow:

Make sure there’s enough space on the local drive!

Check partition names:

sudo fdisk -l

Unmount SD-card partitions before reading or (esp.) writing!

sudo umount /media//root

Use this for backup:

sudo dd if=/dev/mmcblk0p6 of=root.img bs=32M

(The block size could also be 4M)

Use this for restore:

sudo dd if=root.img of=/dev/mmcblk0p6 bs=32M

For those who want to use windows for backup, the standard win32diskimager tool is great. But note that it clones the entire SD-card. You cannot select individual partitions.

RPi

Raspberry Pi beginnings

rasp_turn_around

Credit: Epic Zoe

I just got my first Raspberry Pi. I should have bought it 2 years ago! Well I’ve just started tinkering around with it and it seems cool. Its not as complicated as building your own board, loading customized firmware on it and hope everything will run the way it should. On the contrary, they’ve made it really easy to use. Let’s see if I can get something useful out of it.