Book Image

Banana Pi Cookbook

By : Ryad El-Dajani
Book Image

Banana Pi Cookbook

By: Ryad El-Dajani

Overview of this book

Table of Contents (13 chapters)

Booting up and shutting down the Banana Pi


This recipe will explain how to boot up and shut down the Banana Pi. As the Banana Pi is a real computer, these tasks are as equally important as tasks on your desktop computer. The booting process starts the Linux kernel and several important services. The shutting down stops them accordingly and does not power off the Banana Pi until all data is synchronized with the SD card or external components correctly.

Getting ready

To boot your device, you need the following ingredients:

  • A wired up Banana Pi

  • A prepared SD card with an operating system

How to do it…

We are going to boot up and shut down the Banana Pi.

Booting up

Do the following steps to boot up your Banana Pi:

  1. Attach the Ethernet cable to your local network.

  2. Connect your Banana Pi to a display.

  3. Plug in an USB keyboard and mouse.

  4. Insert the SD card to your device.

  5. Power your Banana Pi by plugging in the USB power cable.

The following screenshot shows a new Android installation on the Banana Pi after a successful boot:

The next screenshot shows the desktop of Raspbian after a successful boot:

Shutting down Android

To shut down Android, press and hold down the Power key of the Banana Pi.

Shutting down Linux

To shut down your Linux-based distribution, you either use the shutdown command or do it via the desktop environment (in case of Raspbian, it is called LXDE). For the latter method, these are the steps:

  1. Click on the LXDE icon in the lower-left corner.

  2. Click on Logout.

  3. Click on Shutdown in the upcoming window.

To shut down your operating system via the shell, type in the following command:

$ sudo shutdown -h now

How it works…

When you have prepared the SD card successfully, you can finally boot up your Banana Pi with your desired operating system.

The boot sequence should initiate immediately. You will see blinking LEDs. If only the red LED is lit, you probably made a mistake when writing the image to the SD card or the SD card is defective.

If you powered off the device previously, you may need to press and hold the Power key to restart the booting of your device. You will see the boot messages, if you connected your Banana Pi to a display. When the boot has finished, you are welcomed by your operating system for the first time.

Note

If you are using the wired Ethernet network interface on Android, make sure to enable Use Ethernet in the Android settings under Wireless & Networks | More.

On Linux, you can shut down the device via the shell. If you are on the desktop, you can access the shell via an application called Terminal (or LXTerminal in case of Raspbian).

The shutdown command expects a mode parameter (-h, that is, halt in this case) and a time (now). If you want to reboot your device, you can use the mode -r (reboot). As the shutdown command requires root privileges, we are executing the shutdown command with the prefix command sudo. This will issue the next command—shutdown—to be executed with root privileges. You will have to enter the password of the user. On most of the Banana Pi distributions, the default passwords for the default user is bananapi.

Alternatively, you can also power off or reboot your Banana Pi via the LXDE menu or the appropriate commands. The following are the commands for power off and reboot respectively:

$ sudo poweroff
$ sudo reboot

See also