Customizing Boot Up Screen on Raspberry Pi

This is a steps to customize Raspberry Pi’s boot up screen, specifically to change the splash image and remove unwanted images and texts. By default, Raspbian Jessie Desktop displays below during boot up before starting desktop GUI.

(1) Rainbow image
(2) Raspberry Pi Logo (image of four raspberries in the top left corner)
(3) Boot message log
(4) Blinking cursor for boot message logs (at the top left corner)
(5) Splash Image (“Welcome to pixel”)
(6) One-line text under splash image

By following the steps below, we’ll remove (1)-(4) and (6), then replace the default splash image with whatever you want to display at (5).

 

Assumption:
You should have your own splash image somewhere. In the steps below, assuming that the file name of the splash image is “my_splash.png” and it’s located home directory. (i.e. “~/my_splash.png”)

 

Here are the steps:

Remove Rainbow Screen
Open “/boot/config.txt” as root.

sudo nano /boot/config.txt

Then add below line at the end of the file.

disable_splash=1

 

Remove text message under splash image:
Open “/usr/share/plymouth/themes/pix/pix.script” as root.

sudo nano /usr/share/plymouth/themes/pix/pix.script

Then, remove (or comment out) four lines below:

message_sprite = Sprite();
message_sprite.SetPosition(screen_width * 0.1, screen_height * 0.9, 10000);
       my_image = Image.Text(text, 1, 1, 1);
       message_sprite.SetImage(my_image);

Note : This is a quick and dirty method I found. It works, but there might be better way.

 

Remove Boot Messages
Open “/boot/cmdline.txt” as root.

sudo nano /boot/cmdline.txt

Then, replace “console=tty1” with “console=tty3”. This redirects boot messages to tty3.

 

Remove other things
Still in “/boot/cmdline.txt”, add below at the end of the line

splash quiet plymouth.ignore-serial-consoles logo.nologo vt.global_cursor_default=0

Here are brief explanations.
‘splash’ : enables splash image
‘quiet’ : disable boot message texts
‘plymouth.ignore-serial-consoles’ : not sure about this but seems it’s required when use Plymouth.
‘logo.nologo’ : removes Raspberry Pi logo in top left corner.
‘vt.global_cursor_default=0’ : removes blinking cursor.

Note : The first three should be there by default, but make sure if those exist.

 

Replace Splash Image
Now, everything unwanted images and texts are gone. Let’s replace the default splash image (/usr/share/plymouth/themes/pix/splash.png) with your own splash image.

sudo cp ~/my_splash.png /usr/share/plymouth/themes/pix/splash.png

Note : As described in above assumption, “my_splash.png” should be your new splash image.

 

Verify the costumed boot up screen
Check the boot up screen by simply rebooting.

sudo reboot

 

Reference:
Guide: A custom splash screen on the Raspberry Pi, for Raspbian Jessie
https://yingtongli.me/blog/2016/12/21/splash.html

Custom boot up screen
http://www.raspberry-projects.com/pi/pi-operating-systems/raspbian/custom-boot-up-screen

 

 

Auto Power On Bluetooth Adapter on Boot-up

By default, it’s automatically powered on with Raspberry Pi 3 and Raspbian Jessie on boot. But after I updated Bluez from 5.23 to 5.43, it’s not turning on automatically and I needed to do so manually by using hciconfig or bluetoothctl as below.

Powering on manually by hciconfig:

$ hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 310:10  SCO MTU: 64:8
	DOWN 
	RX bytes:574 acl:0 sco:0 events:30 errors:0
	TX bytes:368 acl:0 sco:0 commands:30 errors:0

$ sudo hciconfig hci0 up
$ hciconfig
hci0: Type: Primary Bus: USB
 BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 310:10 SCO MTU: 64:8
 UP RUNNING PSCAN 
 RX bytes:1794 acl:0 sco:0 events:102 errors:0
 TX bytes:1772 acl:0 sco:0 commands:102 errors:0

Or, powering on manually by bluetoothctl:

$ hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 310:10  SCO MTU: 64:8
	DOWN 
	RX bytes:574 acl:0 sco:0 events:30 errors:0
	TX bytes:368 acl:0 sco:0 commands:30 errors:0

$ bluetoothctl 
[NEW] Controller xx:xx:xx:xx:xx:xx raspberry [default]
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller xx:xx:xx:xx:xx:xx Powered: yes
[bluetooth]# quit
[DEL] Controller xx:xx:xx:xx:xx:xx raspberry [default]
$ hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 310:10  SCO MTU: 64:8
	UP RUNNING PSCAN 
	RX bytes:1184 acl:0 sco:0 events:66 errors:0
	TX bytes:1070 acl:0 sco:0 commands:66 errors:0

 

This is how to power on Bluetooth adapter automatically on Raspberry Pi boot up.

1. Make ‘bluetooth’ directory under /etc

sudo mkdir /etc/bluetooth

2. Open a new file named “main.conf” under the directory.

sudo nano /etc/bluetooth/main.conf

3. Add two lines below, save it and close the file.

[Policy]
AutoEnable=true

4. Restart Raspberry Pi.

sudo reboot

5. Verify if it’s powered on by hciconfig command.

$ hciconfig
hci0: Type: Primary Bus: USB
 BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 310:10 SCO MTU: 64:8
 UP RUNNING PSCAN 
 RX bytes:658 acl:0 sco:0 events:44 errors:0
 TX bytes:2668 acl:0 sco:0 commands:44 errors:0

 

 

Updating BlueZ on Raspberry Pi (5.23 to 5.43)


Update (Jul 9, 2019):
Now, Raspbian Buster, released on 6/20/2019, has bluez 5.50 by default!


Update (Feb 14, 2018):
If you want to install newer BlueZ on Raspbian Stretch, please see the post below:
Updating BlueZ on Raspberry Pi (5.43 to 5.48)


Update (Sep 8, 2017):
Raspbian Stretch was released on 8/16/2017, and it has BlueZ 5.43 pre-installed. So these steps below won’t be necessary if you are using Stretch.  With pre-installed BlueZ 5.43, the on-board Bluetooth chip on Raspberry Pi 3 is working fine so far.


 

BlueZ is an open source Bluetooth stack for Linux. This is how I updated BlueZ on my Raspberry Pi 3 B+ from 5.23 (pre-installed version in Jessie) to 5.43. The motivation is that I wanted to test a Bluetooth Low Energy (BLE) feature and that is not supported in the original version.

Originally, I tried to update to 5.46 which is the latest version as of 7/27/2017. However, I found that hci tools have been not included in BlueZ since 5.44 for some reason. Since I wanted to use hci tools, I decided to update to 5.43, which still has hci tools.

Also, I should mention one more thing here. After update, I’ve been facing a problem with Raspberry Pi 3’s on-board Bluetooth module. So I decided to use a USB Bluetooth dongle instead. So if you’re planning to use on-board Bluetooth chip, this post is not probably for you…

 

Here is the list of contents of this post.

Contents
– Assumptions
– Steps
1. Disabling On-board Bluetooth Chip
2. Current Version Check
3. Uninstall Current BlueZ
4. Install BlueZ
5. Bluetooth Service Setting
6. Check If Everything is Fine

Let’s get started.

 

Assumptions
<Hardware>
Raspberry Pi 3 B+ with Bluetooth dongle (Panda Bluetooth 4.0 USB Adapter)

<Software>
– Raspbian OS Jessie
– BlueZ (original version:5.23, target version 5.43)

 

Steps
1. Disabling On-board Bluetooth Chip
1-1. Boot up Raspberry Pi Board. If it’s not set up yet, please refer this post.
1-2. Let’s check if Bluetooth interfaces are recognized.

pi@raspberrypi:~ $ hciconfig -a
hci1:	Type: BR/EDR  Bus: UART
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:1046 acl:0 sco:0 events:52 errors:0
	TX bytes:2516 acl:0 sco:0 commands:52 errors:0
	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH SNIFF 
	Link mode: SLAVE ACCEPT 
	Name: 'raspberrypi'
	Class: 0x000000
	Service Classes: Unspecified
	Device Class: Miscellaneous, 
	HCI Version: 4.1 (0x7)  Revision: 0xb6
	LMP Version: 4.1 (0x7)  Subversion: 0x2209
	Manufacturer: Broadcom Corporation (15)

hci0:	Type: BR/EDR  Bus: USB
	BD Address: yy:yy:yy:yy:yy:yy  ACL MTU: 310:10  SCO MTU: 64:8
	UP RUNNING 
	RX bytes:947 acl:0 sco:0 events:49 errors:0
	TX bytes:2446 acl:0 sco:0 commands:49 errors:0
	Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH HOLD SNIFF PARK 
	Link mode: SLAVE ACCEPT 
	Name: 'raspberrypi #1'
	Class: 0x000000
	Service Classes: Unspecified
	Device Class: Miscellaneous, 
	HCI Version: 4.0 (0x6)  Revision: 0x22bb
	LMP Version: 4.0 (0x6)  Subversion: 0x22bb
	Manufacturer: Cambridge Silicon Radio (10)

It looks both on-board chip and the dongle are recognized correctly. In this case, hci1 is the on-board chip (Broadcom) and hci0 is the dongle (CSR).
(* BD Addresses are replaced with “xx:xx:xx:xx:xx:xx” and “yy:yy:yy:yy:yy:yy”)

1-3. Since I don’t use the on-board BT chip, let’s disable it. Open “/etc/modprobe.d/raspi-blacklist.conf”,

sudo nano /etc/modprobe.d/raspi-blacklist.conf

1-4. Add two lines below and save.

blacklist btbcm
blacklist hci_uart

1-5. Then reboot Raspberry Pi 3.

sudo reboot

1-7. After reboot, type ‘hciconfig -a’ again.

pi@raspberrypi:~ $ hciconfig -a
hci0: Type: BR/EDR Bus: USB
 BD Address: yy:yy:yy:yy:yy:yy ACL MTU: 310:10 SCO MTU: 64:8
 UP RUNNING 
 RX bytes:670 acl:0 sco:0 events:46 errors:0
 TX bytes:2437 acl:0 sco:0 commands:46 errors:0
 Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
 Link policy: RSWITCH HOLD SNIFF PARK 
 Link mode: SLAVE ACCEPT 
 Name: 'raspberrypi'
 Class: 0x000000
 Service Classes: Unspecified
 Device Class: Miscellaneous, 
 HCI Version: 4.0 (0x6) Revision: 0x22bb
 LMP Version: 4.0 (0x6) Subversion: 0x22bb
 Manufacturer: Cambridge Silicon Radio (10)

The on-board chip is successfully disabled.

 

2. Current Version Check
2-1. BlueZ version can be retrieved by typing:

pi@raspberrypi:~ $ bluetoothctl -v
5.23 

2-2. Also, let’s check the Bluetooth related packages.

pi@raspberrypi:~ $ dpkg -l|grep blue
ii  bluej                                 3.1.7b                                    all          A simple but powerful Java IDE.
ii  bluez                                 5.23-2+rpi2                               armhf        Bluetooth tools and daemons
ii  bluez-firmware                        1.2-3+rpi1                                all          Firmware for Bluetooth devices
ii  libbluetooth3:armhf                   5.23-2+rpi2                               armhf        Library to use the BlueZ Linux Bluetooth stack
ii  pi-bluetooth                          0.1.3                                     armhf        Raspberry Pi 3 bluetooth
ii  pulseaudio-module-bluetooth           5.0-13                                    armhf        Bluetooth module for PulseAudio sound server
pi@raspberrypi:~ $ 

 

3. Uninstall Current BlueZ
3-1. Uninstall the current version of BlueZ.

sudo apt-get purge bluez -y

3-2. Remove unnecessary packages.

sudo apt-get autoremove -y

After uninstallation, the package list looks like this. (not sure why libbluetooth3 is still there…)

pi@raspberrypi:~/src/bluez $ bluetoothctl --version
-bash: /usr/bin/bluetoothctl: No such file or directory
pi@raspberrypi:~/src/bluez $ dpkg -l|grep blue
ii  bluej                                 3.1.7b                                    all          A simple but powerful Java IDE.
ii  libbluetooth3:armhf                   5.23-2+rpi2                               armhf        Library to use the BlueZ Linux Bluetooth stack

 

4. Install BlueZ
4-1. Update package list and installed packages.

sudo apt-get update && sudo apt-get upgrade -y

4-2. Install dependencies.

sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev

4-3. Download and extract BlueZ 5.43.

wget www.kernel.org/pub/linux/bluetooth/bluez-5.43.tar.xz
tar xvf bluez-5.43.tar.xz
cd bluez-5.43/

4-4. Configure.

./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental --enable-tools --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/system

4-5. Compile the source code.

make -j4

4-6. Install BlueZ.

sudo checkinstall --fstrans=no

You can ‘sudo make install’ instead of ‘sudo checkinstall’ as below:

sudo make install

4-7. Check the version if the installation is successfully done.

pi@raspberrypi:~ $ bluetoothctl -v
5.43

 

5. Bluetooth Service Setting
5-1. Enable Bluetooth service so that it will start on boot up.

sudo systemctl enable bluetooth

It’ll create symlinks and output like below:

pi@raspberrypi:~/src/bluez/bluez-5.43 $ sudo systemctl enable bluetooth
Created symlink from /etc/systemd/system/dbus-org.bluez.service to /lib/systemd/system/bluetooth.service.
Created symlink from /etc/systemd/system/bluetooth.target.wants/bluetooth.service to /lib/systemd/system/bluetooth.service.

5-2. Reboot Raspberry Pi 3.

sudo reboot

 

6. Check If Everything is Fine
6-1. After reboot, check if hci is UP.

pi@raspberrypi:~ $ hciconfig -a
hci0:	Type: Primary  Bus: USB
	BD Address: yy:yy:yy:yy:yy:yy  ACL MTU: 310:10  SCO MTU: 64:8
	DOWN 
	RX bytes:574 acl:0 sco:0 events:30 errors:0
	TX bytes:368 acl:0 sco:0 commands:30 errors:0
	Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH HOLD SNIFF PARK 
	Link mode: SLAVE ACCEPT

6-2. If it’s DOWN, then type:

sudo hciconfig hci0 up

6-3. And check again.

pi@raspberrypi:~ $ hciconfig -a
hci0:	Type: Primary  Bus: USB
	BD Address: yy:yy:yy:yy:yy:yy  ACL MTU: 310:10  SCO MTU: 64:8
	UP RUNNING 
	RX bytes:1178 acl:0 sco:0 events:65 errors:0
	TX bytes:1066 acl:0 sco:0 commands:65 errors:0
	Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH HOLD SNIFF PARK 
	Link mode: SLAVE ACCEPT 
	Name: 'raspberrypi'
	Class: 0x000000
	Service Classes: Unspecified
	Device Class: Miscellaneous, 
	HCI Version: 4.0 (0x6)  Revision: 0x22bb
	LMP Version: 4.0 (0x6)  Subversion: 0x22bb
	Manufacturer: Cambridge Silicon Radio (10)

Now it should be UP and RUNNING.
* If you want Bluetooth adapter powered up automatically at boot, see this.

6-4. Check if Bluetooth service is working.

systemctl status bluetooth

If everything is fine, you should see like:

pi@raspberrypi:~ $ systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Fri 2017-07-28 00:34:23 UTC; 2min 14s ago
     Docs: man:bluetoothd(8)
 Main PID: 456 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─456 /usr/libexec/bluetooth/bluetoothd

Make sure it’s ‘active (running)’.

6-5. Now you should be able to use bluetoothctl to pair devices.

pi@raspberrypi:~ $ bluetoothctl
[NEW] Controller yy:yy:yy:yy:yy:yy raspberrypi [default]
[bluetooth]#

 

 

Installing software from source code with ‘checkinstall’

Even though your linux has a package management system, sometimes you may need to install a software from source code for some reason. And if you install the software by ‘make install’, you may have a little difficulty later on; You cannot use your package manager to uninstall it. This is where ‘checkinstall’ comes in. It generates a package from compiled files and installs it through your package manager, so that when you need to uninstall it, you can do that easily with your package manager.

Below is an example steps that shows how to use ‘checkinstall. In this example, I’m going to install alsa-utils 1.1.4 on Raspberry Pi (Raspbian Jessie).

 

Steps
1. Install ‘checkinstall’ It’s not installed by default. So, let’s install it first.

sudo apt-get install checkinstall -y

2. Check the current alsa-utils version.

pi@raspberrypi:~ $ arecord --version
arecord: version 1.0.28 by Jaroslav Kysela <perex@perex.cz>

3. You may need to install dependencies.

sudo apt-get install libasound2-dev libncursesw5-dev

4. Download the source.

wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.1.4.tar.bz2
tar xvjf alsa-utils-1.1.4.tar.bz2
cd alsa-utils-1.1.4/

5. Compile the source code as usual.

./configure --disable-alsaconf --disable-bat --disable-xmlto --with-curses=ncursesw
make -j4

6. To install, type “sudo checkinstall” instead of ‘sudo make install’.

sudo checkinstall

Then, ‘checkinstall’ will create a .deb file (Debian package) and install it. During the process, you will be asked a few questions about the package. Unless you are planning to distribute it, you can use the default answers.

pi@raspberrypi:~/src/alsa/alsa-utils-1.1.4 $ sudo checkinstall

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.
>> alsa-utils package from source code
>> 

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values: 

0 -  Maintainer: [ root@raspberrypi ]
1 -  Summary: [ alsa-utils package from source code ]
2 -  Name:    [ alsa-utils ]
3 -  Version: [ 1.1.4 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ armhf ]
8 -  Source location: [ alsa-utils-1.1.4 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ alsa-utils ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Enter a number to change any of them or press ENTER to continue: 

Installing with make install...

<snip>

**********************************************************************

 Done. The new package has been installed and saved to

 /home/pi/src/alsa/alsa-utils-1.1.4/alsa-utils_1.1.4-1_armhf.deb

 You can remove it from your system anytime using: 

      dpkg -r alsa-utils

**********************************************************************

After the installation, it’ll tell you where the package file is saved and how to uninstall the package.

 

7. Let’s check the updated version to confirm the installation.

pi@raspberrypi:~/src/alsa/alsa-utils-1.1.4 $ arecord --version
arecord: version 1.1.4 by Jaroslav Kysela <perex@perex.cz>

OK, it’s updated from 1.0.28 (see step2) to 1.1.4 as expected.

 

Package Information
You can also check the package information with ‘dpkg -l’ command. The package description you entered during the installation will be shown here.

pi@raspberrypi:~/src/alsa/alsa-utils-1.1.4 $ dpkg -l|grep alsa
ii  alsa-base                             1.0.27+1                                  all          dummy package to ease purging of obsolete conffiles
ii  alsa-utils                            1.1.4-1                                   armhf        alsa-utils package from source code
ii  gstreamer0.10-alsa:armhf              0.10.36-2                                 armhf        GStreamer plugin for ALSA
ii  gstreamer1.0-alsa:armhf               1.4.4-2+deb8u1                            armhf        GStreamer plugin for ALSA

 

To create a package without installation
In case you just need to create a package but you don’t need to install it, type:

sudo checkinstall --install=no

 

To uninstall the package

dpkg -r alsa-utils

 

To install the package to other machine
in case you need to install the package to other machine, use ‘dpkg -i’ command with the file name.

sudo dpkg -i alsa-utils_1.1.4-1_armhf.deb

 

Troubleshoot

I got an error when I was trying to install bluez with checkinstall.

libtool: install: /usr/bin/install -c tools/btattach /usr/bin/btattach
 /bin/mkdir -p '/usr/libexec/bluetooth'
/bin/mkdir: cannot create directory ‘/usr/libexec’: No such file or directory
Makefile:3520: recipe for target 'install-libexecPROGRAMS' failed
make[2]: *** [install-libexecPROGRAMS] Error 1
Makefile:8902: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
Makefile:8896: recipe for target 'install' failed
make: *** [install] Error 2

****  Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

There are bug reports for that and found a workaround. This worked for me.

sudo checkinstall --fstrans=no

https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/307799
https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/78455

Enabling SSH on Raspberry Pi

By enabling SSH, you can access Raspberry Pi remotely. For security, you should change login password If you enable SSH. Here is the steps.

 

1. Enable SSH

1-1. Launch raspi-config

sudo raspi-config

1-2. Select “Interfacing Options”.

1-3. Select “SSH”, and “Yes”.

1-4. Then, exit raspi-config.

 

2. Change login password for user ‘pi’

2-1. Type the following command:

passwd

2-2. Enter the current password and new password. Then retype the new password.

Changing password for pi.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

 

3. Access from PC

3-1. Check IP address on Raspberry Pi.

ifconfig

Or, alternatively you may be able to figure out the IP address by using the following command on your PC.

arp -a

3-2. Then access from your PC like below (After @ sign will be your Raspberry Pi’s IP address).

ssh pi@192.168.0.1