Skip to content



Raspberry Pi »

Notes for Raspberry Pi

Tips, hints, and tricks when working on Raspberry Pi

Last update: 2022-05-07


Search1 for a package distributed by Debian:

Setup Wireless#

Refer to the official guide at Raspberry Pi Configuration. Note that there are two types of access points:

Routed wireless access point: Create a new local network, which is not connected any other existing network

                                        +- RPi -------+
                                    +---+ 10.10.0.2   |          +- Laptop ----+
                                    |   |     WLAN AP +-)))  (((-+ WLAN Client |
                                    |   | 192.168.4.1 |          | 192.168.4.2 |
                                    |   +-------------+          +-------------+
                +- Router ----+     |
                | Firewall    |     |   +- PC#2 ------+
(Internet)--WAN-+ DHCP server +-LAN-+---+ 10.10.0.3   |
                |   10.10.0.1 |     |   +-------------+
                +-------------+     |
                                    |   +- PC#1 ------+
                                    +---+ 10.10.0.4   |
                                        +-------------+

Bridged wireless access point: Extend an existing Ethernet network to wireless computers and devices

                                        +- RPi -------+
                                    +---+ 10.10.0.2   |          +- Laptop ----+
                                    |   |     WLAN AP +-)))  (((-+ WLAN Client |
                                    |   |  Bridge     |          | 10.10.0.5   |
                                    |   +-------------+          +-------------+
                +- Router ----+     |
                | Firewall    |     |   +- PC#2 ------+
(Internet)--WAN-+ DHCP server +-LAN-+---+ 10.10.0.3   |
                |   10.10.0.1 |     |   +-------------+
                +-------------+     |
                                    |   +- PC#1 ------+
                                    +---+ 10.10.0.4   |
                                        +-------------+

Python packages#

Most packages can be installed using sudo apt install followed by python-<packagename> for Python2 or python3-<packagename>.

In some cases, a package is not available on the OS package manager, so install that packages via pip from python package manager.

Install pip for both Python 2 and 3:

sudo apt install -y python-pip python3-pip

Then install the target package. For example:

sudo apt install -y python-ws4py python3-ws4py

is equivalent to:

pip install ws4py
pip3 install ws4py

Who is logged on?#

Use w command from procps package.

08:53:52 up  2:21,  2 users,  load average: 0.02, 0.06, 0.07

USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
pi       pts/0    fe80::1936:b4d4: 06:34    0.00s  1.54s  0.05s w

Save power#

Save power when running on battery by turning off unused peripherals, or features.

Turn off USB#

Turn OFF the USB chip:

echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind

Turn ON the USB chip:

echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind

Turn off HDMI#

Turn OFF the HDMI output:

sudo /opt/vc/bin/tvservice -o

Turn ON the HDMI output:

sudo /opt/vc/bin/tvservice -p

Throttle CPU#

Reduce the clock of the core by changing some parameters in the /boot/config.txt file:

/boot/config.txt
arm_freq_min=250
core_freq_min=100
sdram_freq_min=150
over_voltage_min=0

Disable Wi-Fi & Bluetooth#

Disable Wi-Fi & Bluetooth

Starting from Raspberry Pi 3, WiFi and Bluetooth are added on hardware, so Raspbian has its method to control these signals in /boot/config.txt file:

/boot/config.txt
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt

It’s correct to use the word pi3 in the params’s value, for other version of Raspberry Pi.

The rfkill command can be used to soft-block the wireless connections:

rfkill list              # displays the state of the modules
rfkill block wifi
rfkill block bluetooth

but this does not completely turn off the hardware of the WiFi and the Bluetooth module. They will still draw a little power in the background.

Disable on-board LEDs#

Disable on-board LEDs

Add below parameters to the /boot/config.txt file:

/boot/config.txt
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on

  1. Add a form in Markdown:

    <form
        role="search"
        target="_blank"
        action="https://packages.debian.org/search"
    >
        <div>
            <input
                type="search"
                id="mySearch"
                name="keywords"
                placeholder="Enter package name..."
                aria-label="Search for a package name"
                style="border:1px solid gray; padding: .25em .5em;"
            />
            <button type="submit" class="md-button">Search</button>
        </div>
    </form>
    
     

Comments