Table of Contents

Raspberry Pi Tips / Issues

Some stuffs…

Check if Running Raspbian-Lite

To check if we are on lite version, (well one way to do it…) is to check if raspberrypi-ui-mods package is installed. The following command will return nothing if it is not installed - so, we are probably on lite then.

$ sudo apt list raspberrypi-ui-mods --installed

Setting Timezone on Pi from commandline

I run desktop-less Raspbian (Buster) and somehow the timezone got reset. To set that,

# sudo timedatectl set-timezone Asia/Kuala_Lumpur

Change hostname manually

Edit /etc/hostname and /etc/hosts - modify accordingly, and reboot immediately.

$ name=my1pi
$ prev=$(cat /etc/hostname)
$ sudo sed -i "s/$prev/$name/" /etc/hostname
$ sudo sed -i "s/$prev/$name/" /etc/hosts
$ sudo reboot

Disable Display from Sleeping

The simplest way is… install xscreensaver and disable it!

# sudo apt install xscreensaver

ePhoto Frame

Script to make Pi an e-Photo Frame.

eframe.sh
#!/bin/bash
 
SHOW_PATH="/home/pi/Pictures"
[ -d "$1" ] && SHOW_PATH=`cd $1;pwd`
SHOW_EXEC="feh"
SHOW_FULL=`which $SHOW_EXEC 2>/dev/null`
# args: delay 5s, fullscreen, recursive, randomize
SHOW_ARGS="-D5 -F -r -z"
 
echo "Accessing pictures in $SHOW_PATH..."
# press esc to quit?
${SHOW_FULL} ${SHOW_ARGS} ${SHOW_PATH}

Set Static IP

Display Issues

Note Got these from R-Pi site.

The HDMI monitor (or HDMI adapter) may only support a limited set of formats for CEA (TV) or DMT (Monitor). To find out which formats are supported, use the following method:

Then edit config.txt to select:

Auto-run Script/Program on Startup

Note: This assumes a Raspbian installation with desktop environment, and username is pi.

Script to run browser full-screen

start_fullscreen.sh
#!/bin/bash
 
chromium-browser http://server.local:1337 --start-fullscreen