Raspberry Pi User Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Raspberry User guide

Downloading and Installing Raspberry Pi OS


Once you have all the components you need, use the following steps to
create the boot disk you will need to set up your Raspberry Pi. These steps
should work on a using a Windows, Mac or Linux-based PC (we tried this
on Windows, but it should be the same on all three).

1. Insert a microSD card / reader into your computer.


2. Download and install the official Raspberry Pi Imager. Available for
Windows, macOS or Linux, this app will both download and install the
latest Raspberry Pi OS. There are other ways to do this, namely by
downloading a Raspberry Pi OS image file and then using a third-party
app to “burn it,” but the Imager makes it easier.
3. Click Choose OS.

4. Select Raspberry Pi OS (32-bit) from the OS menu (there are other


choices, but for most uses, 32-bit is the best).
4. Click Choose storage and pick the SD card you’re using.

5. Click the settings button or hit CTRL + SHIFT + X to enter settings.


6. Fill in settings fields as follows and then hit Save. All of these fields are
technically optional, but highly recommended so that can get your
Raspberry Pi set up and online as soon as you boot it. If you don't set a
username and password here, you'll have to go through a setup wizard
that asks you to create them on first boot.
 Set hostname: the name of your Pi. It could be "raspberrypi" or anything you like.
 Enable SSH: Allow SSH connections to the Pi. Recommended.
 Use password authentication / public key: method of logging in via SSH
 Set username and password: Pick the username and password you'll use for the Pi
 Configure wireless LAN: set the SSID and password of Wi-FI network
 Wireless LAN country: If you're setting up Wi-Fi, you must choose this.
 Set locale settings: Configure keyboard layout and timezone (probably chosen
correctly by default)
7. Click Write. The app will now take a few minutes to download the OS
and write to your card.

Booting Your Raspberry Pi for the First Time


After you're done writing the Raspberry Pi OS to a microSD card, it's time
for the moment of truth.

1. Insert the microSD card into the Raspberry Pi.


2. Connect the Raspberry Pi to a monitor, keyboard and mouse(you can use
SSH connection,putty or remote desktop connection to remotely control
your raspberry pi).
3. Connect an Ethernet cable if you plan to use wired Internet.
4. Plug the Pi in to power it on.
If you had used the Raspberry Pi Imager settings to create a username
and password, you'll be able to go straight into the desktop environment,
but if not, you will get a setup wizard.

Set up an SSH server


You can access the command line of a Raspberry Pi remotely from
another computer or device on the same network using the Secure
Shell (SSH) protocol.

SSH provides access to the command line,


Set up your local network
You can connect your Raspberry Pi to the network using a wired or
wireless connection. Configure your connection using the desktop,
command line, or by plugging your Raspberry Pi directly into your
router.

Enable the SSH server


By default, Raspberry Pi OS disables the SSH server. Enable SSH in
one of the following ways:

On the desktop
 From the Preferences menu, launch Raspberry Pi
Configuration

 Navigate to the Interfaces tab

 Select Enabled next to SSH

 Click OK

From the terminal


 Enter sudo raspi-config in a terminal window

 Select Interfacing Options

 Navigate to and select SSH

 Choose Yes

 Select Ok

 Choose Finish

Manually
 Create an empty ssh file in the boot partition: sudo touch
/boot/firmware/ssh

 Reboot the machine: sudo reboot

You can use SSH to connect to your Raspberry Pi remotely.Open


a terminal window on your computer and enter the following
command, replacing the <ip address> placeholder with the IP
address of the Raspberry Pi you’re trying to connect
to and <username> with your username:

 $ ssh <username>@<ip address>


 When the connection works, you will see a security warning.
Type yes to continue. You will only see this warning the first
time you connect.
 Enter your account password when prompted.
 You should now see the Raspberry Pi command prompt:
 <username>@<hostname> ~ $
 You are now connected to the Raspberry Pi remotely, and can
execute commands.

Enabling Uart
Enable UART connection.

 Connect your SD card with emteria.OS to your PC and mount


the boot partition.
 Open config.txt and add the following line:

enable_uart=1

Enabling I2C
Enable and disable the I2C interface on the Raspberry Pi kernel and
use the Raspberry Pi hardware board pins for I2C functionality and
GPIO, Perform these steps on the Raspberry Pi Linux® terminal to
ensure that the I2C interface is enabled in the hardware kernel.
1. Run this command:
sudo raspi-config
2. Select Interfacing Options > I2C.
3. Select Yes when prompted to enable the I2C interface.

4. Select Yes when prompted to automatically load the I2C kernel


module.
5. Select Finish.
6. Select Yes when prompted to reboot.
USER GUIDE FOR RUNNING THE SOFTWARE ON
RASPBERRY WHEN IT BOOTS:
STEP 1:

 First, we need to make bash launcher file which run our


python file when the raspberry boots. You can create a batch
file using
 nano launcher.bash
 it will open a file copy the following bash script and edit by
your directories and python file name
 #!/bin/bash
# launcher.bash
# navigate to home directory, then to this directory, then
execute python script, then back home

cd /
cd home/pi/your_directory
sudo python your_python_file.py
cd /
 Note: if you install the library on a python environment you
need to activate your environment first inside the bash file
before running your python file using the following command
 source directory_of_environment/bin/activate
 Cntrl-X, Return to save.

STEP 2:

 We need to make launcher script executable using the


following command

 chmod 755 launcher.bash

STEP 3:
 We need to make logs file for detecting error while try
running the code to troubleshoot the problem.
 Navigate back to your home directory:

 cd

 Create a logs directory:

 mkdir logs

STEP 4:

 We will add our code to crontab. crontab is a background


(daemon) process that lets you execute scripts at specific
times. It's essential to Python and Raspberry Pi.
 Type in:

 sudo crontab -e

 This will brings up a crontab window.

Now, enter the line:

 @reboot bash /home/pi/bbt/launcher.bash >/home/pi/logs/cronlog 2>&1

 What this does is rather than executing the launcher


script at a specific time, it will execute it once upon
startup.

 Note: edit the directory using your own directories.

To run our software you need to install the following software


python libraries:

1-Pyserial

2-adafruit-circuitpython-charlcd

3-board

You might also like