Tech > RaspberryPi

Raspberry Pi

Unless otherwise stated, these notes relate to running Debian 8 (Jessie) on the Raspberry Pi.

Controlling LEDs

The red LED can be turned on and off with the following commands:

  # echo 1 >/sys/class/leds/led1/brightness
  # echo 0 >/sys/class/leds/led1/brightness

Any value bigger than zero turns it on, zero turns it off.

After turning off the green LED, it is necessary to re-enable the trigger for when the SD card is accessed.

  # cat /sys/class/leds/led0/trigger
  # echo 0 >/sys/class/leds/led0/brightness
  # cat /sys/class/leds/led0/trigger
  # echo 1 >/sys/class/leds/led0/brightness
  # cat /sys/class/leds/led0/trigger
  # echo mmc0 >/sys/class/leds/led0/trigger
  # cat /sys/class/leds/led0/trigger

Linux Kernel

apt-cache show linux-image-rpi-rpfv states:

  Description: This metapackage will pull in the raspbian kernel for the raspberry pi 1
   based on the version currently reccomended by the raspberry pi foundation
   (currently 3.18).

apt-cache show raspberrypi-bootloader states:

  Description: Raspberry Pi bootloader
   This package contains the Raspberry Pi bootloader (plus, temporarily, a


  $ dpkg --search /boot/kernel.img
  raspberrypi-bootloader: /boot/kernel.img
  $ dpkg --search /boot/kernel7.img
  raspberrypi-bootloader: /boot/kernel7.img

This page suggests the kernel is updated as one of the Debian packages, which conflicts with the page suggesting use of rpi-update

Understanding kernels on the Raspberry Pi and Raspi-LTSP explains there are two sources of kernels for the Raspberry Pi. 'foundation kernels' and 'team kernels'. My guess is that rpi-update provides foundation kernels, and the linux-image-rpi-rpfv package provides the team kernels, even though the package description for linux-image-rpi-rpfv says "reccomended[sic] by the raspberry pi foundation".

At the time of writing, the Raspbian Downloads page states that Raspian Jessie is kernel version 4.1.

apt-cache show linux-image-rpi-rpfv depends on linux-image-3.18.0-trunk-rpi.

apt-cache show linux-image-3.18.0-trunk-rpi gives its version as 3.18.5-1~exp1+rpi19 and booting into that image uname -r gives 3.18.0-trunk-rpi

Booting kernel.img uname -r gives 4.1.17+.

So I guess rpi-update gets you the latest and greatest and the linux-image-rpi-rpfv package gets you an older, but presumably stable kernel and the foundation expect most people to use rpi-update, but ultimately it will depend on what hardware support you need from the kernel.

Note also that rpi-update doesn't clean up the modules after itself. You will need to manually delete (with care) the kernel modules installed under /lib/modules/.

See also:

Kernel Configuration

If you do not want to use the default kernel.img or kernel7.img, you need to add some entries to config.txt, e.g.:

initramsfs initrd.img-3.18.0-trunk-rpi followkernel

Installing Java

$ sudo apt-get install oracle-java8-jdk

Installing Eclipse

$ sudo apt-get install eclipse eclipse-jdt

for C/C++

$ sudo apt-get install eclipse-cdt

Upgrading Debian 7 (Wheezy) to Debian 8 (Jessie)


Related Topics: DebianTips, LinuxDevelopment