ES&IoT Lab Record
ES&IoT Lab Record
ES&IoT Lab Record
AIM: Flashing the OS on to the device into a stable function state by porting
desktop environment with necessary packages
APPARATUS:
1. Raspberry Pi
2. Beagle Bone Black
3. Micro-SD Cards
4. Raspbian image file
5. BeagleBone Black image file
6. HDMI cable and Display
7. Power Supply
1
EMBEDDED SYSTEMS LAB
BEAGLEBONE BLACK AND ITS HARDWARE:
1. The Processor
2. The Power Connector
3. Ethernet port
4. Reset Button
5. USB Host Port
6. Onboard LEDs
7. Expansion Headers
8. Mini USB port
9. MicroSD card Slot
10. Micro HDMI Port
11. Serial Header
12. On Board Flash Memory
13. Boot Switch
2
EMBEDDED SYSTEMS LAB
PROCEDURE:
1. First, download the corresponding image files from the below links.
The downloaded images will be compressed in .zip or .xz format, so extract them.
2. If the computer has a slot for SD cards, insert the card. If not, insert the card into an
SD card reader and then connect the reader to the computer. The SD card should be of
minimum 8GB size.
3. Format the SD card using either the format option or the SD card Formatter tool.
4. balenaEtcher is a graphical SD card writing tool that works on Mac OS, Linux and
Windows, and is the easiest option for most users. balenaEtcher also supports writing
images directly from the zip file, without any unzipping required. To write your
image with balenaEtcher:Download the latest version of balenaEtcher form
https://www.balena.io/etcher/ and install it.
5. Open balenaEtcher and select from your hard drive the .img or .zip file you wish to
write to the SD card.
7. Review your selections and click 'Flash!' to begin writing data to the SD card.
Writing to a drive can overwrite any partition of the machine. If the wrong device is
specified in the instructions below then the primary partition could be deleted.
Be careful.
When the procedure finishes unplug your SD card from your computer and
insert it into the hardware (Raspberry Pi or BeagleBone module).
3
EMBEDDED SYSTEMS LAB
BOOTING THE RASPBERRY PI FOR THE FIRST TIME:
1. After booting, an orange screen with options in a grey box in the centre
appears. Click on Next.
2. A Set country window is displayed where country, language and timezone can
be adjusted. Then click on Next.
4
EMBEDDED SYSTEMS LAB
Figure 1.7: Change password Window
4. A Set up screen window is displayed. Then click on Next tosave the settings.
5. An Update software window is displayed. Click on Next to check and update software.
5
EMBEDDED SYSTEMS LAB
Figure 1.10: Setup Complete Window
7. Login name: pi and password: raspberry (don't panic passwords are not shown
in Linux).
BEAGLEBONE BLACK:
1. With the power off on the BeagleBone Black, insert the eMMC flasher
MicroSD card into theMicroSD slot.
2. While holding the boot button, connect the BeagleBone to power and keep
holding the boot button for about fifteen seconds.
3. The USR LEDs will blink while the flashing process is taking place.
RESULT: Operating systems have been flashed onto the devices and their
functionalities have been verified.
6
EMBEDDED SYSTEMS LAB
2. EXPORTING DISPLAY ON TO OTHER SYSTEMS
AIM: Exporting Raspberry Pi display to a Linux system using SSH client and X11
display server.
APPARATUS:
1. Raspberry Pi
2. SD card.
SSH: SSH was designed and created to provide the best security when accessing
another computer remotely. It also provides better authentication facilities,as well as
features like secure file transfer, x session forwarding,port forwarding and more so
that you can increase the security of other protocols.
X11 display server: X11 is a network protocol designed for Unix and similar
operating systems to enable remote graphical access to applications. Display server or
window server is a program whose primary task is to coordinate the input and output
of its clients to and from the rest of O.S,the hardware,and each other. Display server
communicates with its clients over the display server protocol,
acommunication,which can be network-transparent.
PROCEDURE:
7
EMBEDDED SYSTEMS LAB
8. When procedures finishes unplug your SD card from your computer and insert
it into your Raspberry Pi.
1. After booting, an orange screen with options in a grey box in the centre
appears. Click on Next.
2. A Set country window is displayed where country, language and timezone can
be adjusted. Then click on Next.
3. A Change Password window is displayed where a password can be created.
Then click on Next.
4. A Set up screen window is displayed. Then click on Next to save the settings.
5. An Update software window is displayed. Click on Next to check and update software.
6. A Set up complete window is displayed. Click on Restart.
7. Login name: pi and password: raspberry (don't panic passwords are not shown
in Linux)
8. Enter the following command in the Raspberry Pi terminal
sudo raspi-config
9. Use the up and down arrow keys to move the highlighted selection between
the options available. Pressing the right arrow key will jump out of the options
menu and take you to the <Select> and <Finish> buttons.
Select interfacing options and enable SSH.
8
EMBEDDED SYSTEMS LAB
ACCESSING RASPBERRY PI REMOTELY BY USING SSH CLIENT FROM
LINUX SYSTEM:
Once SSH service is activated on Raspbian, you can access your Raspberry Pi
remotely by using SSH client.
1. To install SSH client on a separate Linux system, type the command below
sudo apt-get install openssh-client
2. You can get Raspberry IP address by typing the following command in the
terminal of the Pi
ifconfig
3. After SSH client is installed, connect to your Raspberry Pi over SSH as
follows.
ssh pi@[rasberrypi_ip_address]
With X11+SSH forwarding, you can actually run the entire desktop of
Raspberry Pi remotely. Your Linux desktop is running by default on the first virtual
terminal, which isvirtual terminal #7. Follow the instructions below to get your
Raspberry Pi desktop to show up in your second virtual terminal via X11 forwarding.
9
EMBEDDED SYSTEMS LAB
Open your terminal in the Linux system, and change to root user by typing
$ sudo su
# xinit -- :1 &
To launch the RPi desktop remotely, type Pi user password when asked.
10
EMBEDDED SYSTEMS LAB
You will bring to your new virtual terminal 8 the remote RPi desktop, as well
as a small terminal launched from your active virtual terminal 7
Remember, do NOT close that terminal. Otherwise, your RPi desktop will
close immediately.
You can move between first and second virtual terminals by pressing
CTRL+ALT+F7 or CTRL+ALT+F
To close your remote RPi desktop over X11+SSH, you can either close a small
terminal seen in your active virtual terminal 8, or kill session running in your
virtual terminal 7.
11
EMBEDDED SYSTEMS LAB
3. GPIO PROGRAMMING
AIM: To blink an LED connected to the Raspberry pi with the help of the GPIO pins
present on the Raspberry pi.
APPARATUS:
1. Raspberry Pi
2. SD Card With Raspbian OS flashed
3. LED
4. Connecting Wire
5. Keyboard and Mouse
6. Resistor – 1KΩ
7. Breadboard
Raspberry Pi Models A and B have 26 pins (17 GPIO) whereas the new model
B+ comes with 40 pins (26 GPIO). The model B+ is pin compatible with models A
and B.The easiest way to control these pins is to use the RPi.GPIO Python library.
The RPi model B+ consists of 40 pins, out of which 26 can be used as GPIO.
12
EMBEDDED SYSTEMS LAB
THE RPi.GPIO PYTHON LIBRARY:
The RPi.GPIO library comes pre-installed with the latest version of Raspbian.
In case it doesn’t, the library can be installed from the repositories by running the
following commands in the terminal.
Importing Module
importRPi.GPIO as GPIO
This allows us to refer the module by simply mentioning GPIO instead of its full
name RPi.GPIO.
The next step is to specify the mode in which the module is going to be used. RPi
(BOARD) and the CPU (BCM) have different pin numbers.
or
13
EMBEDDED SYSTEMS LAB
Set up a Channel
For instance, if pin 7on the board is connected to the LED, it means that the pin must
be configure as an output channel. The pin 7 on the board is mapped to GPIO4 of the
CPU.
or
GPIO.input(channel)
GPIO.output(channel, HIGH)
or
GPIO.output(channel, LOW)
Cleanup
After all the GPIO operations, we need to clean up and free any resources that
might have been used. This is not required but is considered a good programming
practice.
GPIO.cleanup()
14
EMBEDDED SYSTEMS LAB
Figure 3.2: Circuit Diagram
PROCEDURE:
Connect the circuit as shown in the circuit diagram to the Pi's GPIO pins
Here, we have used the pin 6 of GPIO as ground and pin 12 (GPIO 1) as
output pin
First, for using the GPIO pins of the Raspberry Pi, install the library
RPI.GPIO in the terminal using the necessary commands
Now, open a text editor to write the program. Since Python programming
language is used, save the file as <filename>.py
To run the program, enter the following command in the terminal
python<filename>.py
CODE:
importRPi.GPIO as GPIO
GPIO.setwarnings(FALSE)
GPIO.setmode(GPIO.BOARD)
15
EMBEDDED SYSTEMS LAB
while True:
GPIO.output(12, GPIO.HIGH)
sleep(2)
GPIO.output(12, GPIO.LOW)
sleep(2)
16
EMBEDDED SYSTEMS LAB
4.INTERFACING CHRONOS eZ430
AIM: To interface the programmable Texas Instruments watch Chronos eZ430 with
the PC and other devices and exploit its features for multiple purposes like PPT
control, mouse operations and others
OVERVIEW:
17
EMBEDDED SYSTEMS LAB
Chronos module based on Bosch Sensor Tec accelerometer and
pressure sensor
Model number engraved in metal back of wrist housing
Chronos module based on Johansson Technology Filter baluns
Access Point based on MSP430F5509 microcontroller with USB and
CC1101 <1GHz transceiver
Figure 4.1: Chronos eZ430-Black PCB Figure 4.2: Chronos eZ430-White PCB
KIT CONTENTS
18
EMBEDDED SYSTEMS LAB
One mini Phillips screwdriver
Two spare screws
PROCEDURE:
INSTALLATION IN WINDOWS
2. Respond to the prompts to install the software. During the installation a separate
window opens for the Windows driver installation. Accept the driver installation
3. When installation finishes, connect the eZ430-Chronos RF USB access point to the
PC and follow the Windows driver installation
4. If prompted for the driver for the TI CC1111 Low-Power RF to USB CDC Serial
Port (legacy software), or eZ430-ChronosAP (current software) allow Windows to
'Install the software automatically'. This can be done only if the eZ430-Chronos PC
Software package has already been installed
19
EMBEDDED SYSTEMS LAB
Figure 4.4: Chronos eZ430 Control Center
Figure 4.5: Chronos eZ430 module in ACC mode paired with the PC
4. After connection, the Control Center status bar reports "Receiving data from
acceleration sensor" and the values according to the axis. The graphs display
the acceleration data of the Chronos module for each axis.
20
EMBEDDED SYSTEMS LAB
Figure 4.6: Chronos Control Center with Acceleration Data
Mouse Control:
1. Click Mouse On (M) to control the PC mouse pointer with the eZ430-Chronos
module. Hold the Chronos module with its display facing up. The mouse
pointer moves vertically (x-axis in Control Center) when tilting the Chronos
module forward/backward and moves vertically (y-axis in Control Center)
when tilting the Chronos module left/right. Mouse clicks are possible as well:
Left single click: * button
Left double click: # button
Right click: UP button
2. Mouse control can be calibrated to set a point of zero acceleration (that is, no
pointer movement) by selecting Calibration (C). It may be disabled by clicking
Mouse Off (M) or by typing M on the PC keyboard.
Note: Holding buttons (for example, for drag and drop) is not supported.
3. Turn the demo off by pushing the DOWN button on the eZ430-Chronos
module and clicking Stop Access Point in the PC application
21
EMBEDDED SYSTEMS LAB
Figure 4.7: Chronos as Mouse Controller
PowerPoint Control:
The Control Center allows the user to map button pushes on the wrist module
into keystrokes on the PC. The default setting is PowerPoint control, which allows
switching slides forward/backward and to start the slide show.
22
EMBEDDED SYSTEMS LAB
Figure 4.8: Chronos in PPt mode
1. The date, time, temperature, altitude and other data can be read from the watch
and can also be set from the control center.
2. Open the SimpliciTI Sync tab and click on Start Access Point to pair the PC to
the watch. The Control Center status line displays "Access point started. Now
start watch in ACC, PPT or synch mode" when the PC is ready.
3. Select "SYnC" on the eZ430-Chronos module by pushing the # button.
4. Initiate pairing on the Chronos module by pushing the DOWN button to
activate the selected mode. After a short time, the link is established.
23
EMBEDDED SYSTEMS LAB
Fig 4.10: Chronos eZ430 in SYnC mode paired with the PC
7. Enter the data for temperature or altitude or any other parameter and click Set
Watch to transfer the data to the Chronos module
24
EMBEDDED SYSTEMS LAB
8. The Chronos module shows DONE
9. Push the DOWN button on the Chronos module to end connection.
1. Select heart rate mode (heart symbol is shown) by pushing the "*" button
.Start receiver on watch by pushing the "UP" button .
2. After a short moment, the current heart rate is displayed, Speed can be
selected by pushing the "*" button, Calories can be selected by pushing the "#"
button, Distance can be selected by pushing the "DOWN" button in Calorie
Mode.
3. The reception may be stopped by pushing "UP" while the heart rate is shown.
RESULT: The Chronos eZ430 module is interfaced with a PC and used for multiple
purposes like mouse control, PPT control, checking accelerometer data and setting
and reading data from the module.
25
EMBEDDED SYSTEMS LAB
5. ON/OFF CONTROL BASED ON LIGHT INTENSITY
AIM: To control the intensity of an LED (Light Emitting Diode) using an LDR (Light
Dependent Resistor) by taking analog input, making sense of that input and output
what appears to be analog signal using an Arduino board.
APPARATUS:
26
EMBEDDED SYSTEMS LAB
Figure 5.1: Arduino UNO board
27
EMBEDDED SYSTEMS LAB
Figure 5.2: Light Dependency Resistor (LDR)
CONNECTIONS:
Connect one end of a resistor (1kΩ or little more) to the 5V pin of the Arduino
board. Connect the other end of the resistor to one end of the LDR. The other
end of the LDR should be connected to the ground (GND)
28
EMBEDDED SYSTEMS LAB
Take a wire from the junction of the resistor & the LDR connected earlier and
connect it to the analog input Pin A0 on the Arduino board
Next take a wire from any of the PWM pins on your board and connect it to
the anode of the LED. Connect the cathode of the LED to one end of a resistor
with the other end connected to the GND.
PROGRAM CODE:
#include<SoftwareSerial.h>
int led=3;
void setup() {
pinMode(led,OUTPUT);
Serial.begin(9600);
void loop() {
29
EMBEDDED SYSTEMS LAB
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
if(sensorValue<30)
digitalWrite(led, HIGH);
delay(1000);
else
digitalWrite(led, LOW);
delay(sensorValue);
When we upload the program to the board we find that the value in the
variable “sensorValue” varies over a range of 30 – 50. This is a very small
range in comparison to 0 – 1023. So we constrain it between 30 and 50. If we
do not do this then value written to the led pin will vary over a much smaller
range and this will not be noticeable in the varying brightness of the LED.
We have also put in the Serial.println() function which helps in debugging.
30
EMBEDDED SYSTEMS LAB
OUTPUTS:
When the light falling on the LDR sensor is greater than the given value the
LED stops glowing.
When the light falling on the LDR sensor is less than the given value the LED
starts glowing.
31
EMBEDDED SYSTEMS LAB
6. BATTERY VOLTAGE INDICATOR
AIM: To monitor the voltage level of the battery and indicate the same using
multiple LEDs.
APPARATUS:
1. Resistors - 5 no’s
2. One battery
3. Connecting wires
4. Arduino UNO Board
5. Bread Board
6. LEDs
CONNECTIONS:
PROCEDURE:
32
EMBEDDED SYSTEMS LAB
Figure 6.2: Battery level indicator using LEDs.
CODE:
constintanalogInPin = A0;
intanalogOutPin;
intsensorValue = 0;
intoutputValue = 0;
void setup()
{
Serial.begin(9600);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
}
void loop()
{
sensorValue = analogRead(analogInPin);
outputValue = map(sensorValue, 0, 1023, 0, 255);
analogWrite(analogOutPin, outputValue);
33
EMBEDDED SYSTEMS LAB
Serial.print("sensor = ");
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);
intval=(sensorValue*5)/1023;
Serial.print("\t val = ");
Serial.println(val);
if(val>=4)
{
digitalWrite(9,HIGH);
digitalWrite(10,HIGH);
digitalWrite(11,HIGH);
}
if(val>=2 &&val<4)
{
digitalWrite(10,HIGH);
digitalWrite(11,HIGH);
}
if(val>0 &&val<2)
{
digitalWrite(11,HIGH);
}
else
{
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
}
delay(1000);
}
34
EMBEDDED SYSTEMS LAB
CALCULATIONS:
V(battery)=9V
RT = R1 + R2
Case 1:
V(battery)*(R2/RT)>=4V
R2/R1>=4/5
Consider R2=R1=1K ohm
Case 2:
2<=V(battery)*(R2/RT)<4V
2/7<=R2/R1<4/5
Consider R2=470 ohm,R1=1K ohm
Case 3:
0<V(battery)*(R2/RT)<2V
0<R2/R1<2/7
Consider R2=100 ohm,R1=1K ohm
OUTPUTS:
35
EMBEDDED SYSTEMS LAB
Figure 6.4: 3 LEDs Glowing
When the sensor value or battery voltage is greater than or equal to 4V all the
three LEDs (9,10,11) start glowing.
When the battery voltageis in between 2V and4V two LEDs (10, 11) start
glowing.
When the battery voltage is in between 0V and 2V one LED (11) starts
glowing.
When the battery voltage is 0v no LED glows.
RESULT: The voltage level of a battery is monitored using multiple LEDs and
Arduino UNO.
36
EMBEDDED SYSTEMS LAB
7. DICE GAME SIMULATION
AIM:To generate a random value similar to dice value and display the same value
using LEDs
APPARATUS:
37
EMBEDDED SYSTEMS LAB
Figure 7.1: Arduino UNO board
SCHEMATIC DIAGRAM:
To create all the faces of the dice, you must follow these rules:
38
EMBEDDED SYSTEMS LAB
For the number 5 of the dice: light up the groups 1, 3 and 4
For the number 6 of the dice: light up the groups 1, 2 and 3
First, attach the Arduino ground with the ground line of the breadboard. Then,
connect the LEDs to Arduino.Finally, connect the 5v of Arduino with the button, and
connect the button with the pin 6 of Arduino.
PROCEDURE:
CODE:
int pinLeds1 = 2;
int pinLeds2 = 3;
int pinLeds3 = 4;
int pinLed4 = 5;
int buttonPin = 6;
int buttonState;
long ran;
int time = 2000;
void setup ()
{
pinMode (pinLeds1, OUTPUT);
pinMode (pinLeds2, OUTPUT);
pinMode (pinLeds3, OUTPUT);
pinMode (pinLed4, OUTPUT);
pinMode (buttonPin, INPUT);
randomSeed(analogRead(0));
39
EMBEDDED SYSTEMS LAB
Serial.begin(9600);
}
void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH){
ran = random(1, 7);
Serial.println(ran);
if (ran == 1){
digitalWrite (pinLed4, HIGH);
delay (time);
}
if (ran == 2){
digitalWrite (pinLeds1, HIGH);
delay (time);
}
if (ran == 3){
digitalWrite (pinLeds3, HIGH);
digitalWrite (pinLed4, HIGH);
delay (time);
}
if (ran == 4){
digitalWrite (pinLeds1, HIGH);
digitalWrite (pinLeds3, HIGH);
delay (time);
}
if (ran == 5){
digitalWrite (pinLeds1, HIGH);
digitalWrite (pinLeds3, HIGH);
digitalWrite (pinLed4, HIGH);
delay (time);
}
if (ran == 6){
40
EMBEDDED SYSTEMS LAB
digitalWrite (pinLeds1, HIGH);
digitalWrite (pinLeds2, HIGH);
digitalWrite (pinLeds3, HIGH);
delay (time);
}
}
digitalWrite (pinLeds1, LOW);
digitalWrite (pinLeds2, LOW);
digitalWrite (pinLeds3, LOW);
digitalWrite (pinLed4, LOW);
}
OUTPUT:
41
EMBEDDED SYSTEMS LAB
8. HOSTING A WEBSITE ONRASPBERRY PI
AIM: Building and hosting a simple website on device (Raspberry Pi Board) and
making it accessible online
APPARATUS:
1. Raspberry pi board
2. SD memory card (4GB/larger)
3. Power adapter
4. Ethernet patch cable
5. HDMI compatible monitor and HDMI cable
6. USB keyboard and mouse
PROCEDURE:
1. Boot the SD card loaded with the operating system. The latest version is
Raspbian Buster.
2. Once the OS is copied into the SD card, plug the card into Raspberry Pi's SD
card slot and power on the device.
3. After booting, an orange screen with options in a grey box in the centre can be
seen. Click on Next.
4. A Set country window is displayed where country, language and timezone can
be adjusted. Then click on Next.
5. A Change Password window is displayed where a password can be created.
Then click on Next.
6. A Set up screen window is displayed. Then click on Next to save the settings.
7. An Update software window is displayed. Click on Next to check and update software.
8. A Set up complete window is displayed. Click on Restart.
9. Login name: pi and password: raspberry (don't panic passwords are not shown
in Linux).
10. Enter the following command in the Raspberry Pi terminal.
sudo raspi-config
42
EMBEDDED SYSTEMS LAB
Figure 8.1: Raspberry Pi Configuration Window
9. Use the up and down arrow keys to move the highlighted selection between
the options available. Pressing the right arrow key will jump out of the options
menu and take you to the <Select> and <Finish> buttons.
Select interfacing options and enable SSH.
CODE : ifconfig
INSTALLING APACHE:
You will be promoted and asked to continue, type Y for yes and hit enter it will
continue and this process takes some time.
43
EMBEDDED SYSTEMS LAB
Now open the browser and type the IP address into the URL bar. If you forget
your IP address simply use the command "ifconfig" and continue. A web page is
displayed as in the below figure. If you get error as web page not found then repeat
the above commands again.
INSTALL FTP:
Now install VSFTPD (Very Secure File Transfer Protocol Daemon) with the
following command
Now open the web browser in another system and type the IP address of your Pi
and you going to see the web page of our Pi in another computer. Hence after
personal web server is complete, we can use it to host a custom HTML page. To edit
your HTML page use the following command
CODE : cd /var/www/html
44
EMBEDDED SYSTEMS LAB
Then give file name
Now edit the HTML file as per your requirement. The image below shows the
edited HTML file.
CODE : ls -al
The ls command lists the content of the current directory (or one that is specified).
It can be used with the -l flag to display additional information (permissions, owner,
group, size, date and timestamp of last edit) about each file and directory in a list
format. The -a flag allows you to view files beginning with . (i.e. dotfiles).
The chown command changes the user and/or group that owns a file. It normally
needs to be run as root using sudo, e.g. sudo chown pi:root *filename* will change
the owner to pi and the group to root.
45
EMBEDDED SYSTEMS LAB
Figure 8.4: Necessary commands
Now open the web browser in another system and type the IP address of your
Pi and the web page of our Pi can be seen in another computer. Image of the
website is shown below.
RESULT: A website has been hosted using Raspberry pi board and the functionality
has been verified.
46
EMBEDDED SYSTEMS LAB
9. FM TRANSMISSION
APPARATUS:
1. Raspberry Pi
2. SD card (8GB) with Raspbian OS flashed
3. Connecting wire
THEORY:
1. The experiment uses the hardware on the Raspberry pi that is actually meant
to generate spread-spectrum clock signals on the GPIO pins to output FM
radio energy.
2. This means that the Raspberry Pi can be turned into an FM transmitter simply
by plugging in a wire as the antenna (as little as 20cm will do) into GPIO pin 4
and run the code. It transmits on 100.0 MHz
3. The EMI suppression in a microprocessor is done by a signal called spread-
spectrum clock signal or SSCS. The frequency of this signal can vary from
1MHz to 250MHz which luckily falls within the FM band. So by writing a
code to perform frequency modulation using the spread-spectrum clock signal,
the Pi can be tweaked to work as an FM transmitter.
47
EMBEDDED SYSTEMS LAB
Figure 9.2: GPIO port pin configuration
PROCEDURE:
1. Boot the SD card loaded with the operating system. The latest version is
Raspbian Buster.
2. Once the OS is copied into the SD card, plug the card into Raspberry Pi's SD
card slot and power on the device.
3. After booting, an orange screen with options in a grey box in the centre can be
seen. Click on Next.
4. A Set country window is displayed where country, language and timezone can
be adjusted. Then click on Next.
5. A Change Password window is displayed where a password can be created.
Then click on Next.
6. A Set up screen window is displayed. Then click on Next to save the settings.
7. An Update software window is displayed. Click on Next to check and update software.
8. A Set up complete window is displayed. Click on Restart.
9. Login name: pi and password: raspberry (don't panic passwords are not shown
in Linux).
10. Enter the following command in the Raspberry Pi terminal.
sudo raspi-config
48
EMBEDDED SYSTEMS LAB
Figure 9.3: Raspberry Pi Configuration Window
9. Use the up and down arrow keys to move the highlighted selection between
the options available. Pressing the right arrow key will jump out of the options
menu and take you to the <Select> and <Finish> buttons.
Select interfacing options and enable SSH.
This plays the song on the default frequency set which is 100 MHz.
49
EMBEDDED SYSTEMS LAB
Figure 9.4: Commands and the Procedure
50
EMBEDDED SYSTEMS LAB
10. WEBCAM SERVER USING RASPBERRY PI
AIM: Interfacing the regular USB webcam with the device and turning it into a fully
functional IP webcam &testing the functionality
APPARATUS:
1. Raspberry pi
2. SD card (8GB)
3. Power Adapter
4. Webcam
6. Ethernet Cable
51
EMBEDDED SYSTEMS LAB
CONNECTION:
PROCEDURE:
52
EMBEDDED SYSTEMS LAB
12. sudo reboot
WEBCAM SETTINGS
sudo motion
53
EMBEDDED SYSTEMS LAB
OUTPUT:
RESULT: USB webcam has been interfaced with the device and its functionality has
been tested.
54
EMBEDDED SYSTEMS LAB
11. DISPLAYING RSS NEWS FEED ON DISPLAY
INTERFACE
AIM: To host a feed reader on the Raspberry Pi to acquire news feed from the
internet and display the feed.
APPARATUS:
1. Raspberry Pi Board
2. SD card (8 GB)
3. Power Adapter
4. Keyboard and Mouse
5. Ethernet Cable
6. Monitor/display and its cable
THEORY:
Many news sites and blogs make their news available on a home page as well
as through special newsfeed formats like RSS or Atom. These formats not only
contain the news itself but also use XML tags to supply certain data about the news,
such as title, author, and language of the text. This tagging makes the automated
processing of news easier. To access the feed, a feed reader is required. With this type
of program, you can subscribe to feeds from favourite news sites, and the software
will download the latest articles at regular intervals. You can then mark, sort, archive,
and even delete these feeds as desired.
Tiny Tiny RSS is a free and open source web-based news feed (RSS/Atom)
reader and aggregator. Hosting Tiny Tiny RSS on the Raspberry Pi promises not only
continuity but also data security. The bundled news feeds of the Pi server can be then
read - even via several client devices – at any time.
PROCEDURE:
BOOTING YOUR RASPBERRY PI FOR THE FIRST TIME:
11. Boot the SD card loaded with the operating system. The latest version is
Raspbian Buster.
12. Once the OS is copied into the SD card, plug the card into Raspberry Pi's SD
card slot and power on the device.
13. After booting, an orange screen with options in a grey box in the centre can be
seen. Click on Next.
55
EMBEDDED SYSTEMS LAB
14. A Set country window is displayed where country, language and timezone can
be adjusted. Then click on Next.
15. A Change Password window is displayed where a password can be created.
Then click on Next.
16. A Set up screen window is displayed. Then click on Next to save the settings.
17. An Update software window is displayed. Click on Next to check and update
software.
18. A Set up complete window is displayed. Click on Restart.
19. Login name: pi and password: raspberry (don't panic passwords are not
shown in Linux).
20. Enter the following command in the Raspberry Pi terminal.
sudo raspi-config
10. Use the up and down arrow keys to move the highlighted selection between
the options available. Pressing the right arrow key will jump out of the options
menu and take you to the <Select> and <Finish> buttons.
56
EMBEDDED SYSTEMS LAB
2. Next, open the website for Tiny Tiny RSS in a web browser and scroll down to
the Download section. Save the offered tarball to the Raspberry Pi. In the terminal,
change to the directory in which the archive is stored and enter the following
sequence of commands. It is necessary to adapt the name of the download archives
appropriately, because it contains the actual version number.
$ sudo mv Tiny-Tiny-RSS-<versionnumber>.tar.gz /var/www/
$ cd /var/www
$ sudo tar xvfz Tiny-Tiny-RSS-<versionnumber>.tar.gz
$ sudorm Tiny-Tiny-RSS-<versionnumber>.tar.gz
$ sudo mv Tiny-Tiny-RSS-<versionnumber>tt-rss
$ sudochmodugoa+rwtt-rss
3. A request needs to be made to create a new database on the freshly installed
MySQL environment. This step can be quite easily accomplished with the help of the
shell client for MySQL, which was installed during the first step.
$ mysql --user=root --password=<MySQL-password>
mysql> CREATE DATABASE ttrss;
mysql> QUIT
4. Determine the IP address of the Raspberry Pi using the following command.
$ ifconfig
5. Now, execute the installation assistant of Tiny Tiny RSS by pointing a web browser
on any computer attached to your LAN to the URL http://<RaspPi-IP>/tt-rss/install/.
Fill in the displayed form with information about your MySQL server.
57
EMBEDDED SYSTEMS LAB
6. The feed reader itself can be invoked via http://<RaspPi-IP>/tt-rss/. For the first
login, a standard user account exists with user name admin and password password.
At this point, you should replace the admin password with your own. To do so, click
on Actions at the top right of the overview screen for Tiny Tiny RSS and
choose Preferences from the submenu that appears.
Figure 11.4: The overview screen shows the latest news feeds
7. The Raspberry Pi still needs to refresh automatically and at regular intervals the
news feeds to which have been subscribed. The easiest way to accomplish this is by
installing a cron job. To do so, open up the cron editor and add the following line
viasudocrontab –e.
*/30 * * * * /usr/bin/php5 /var/www/tt-rss/update.php --feeds –quiet
This command will execute the accompanying update.php script approximately
every 30 minutes.
8. The Raspberry Pi now functions as a server, and client access is accomplished
through numerous other devices.
RESULT: The Raspberry Pi hosts a web based feed reader and the news feed is
acquired and displayed
58
EMBEDDED SYSTEMS LAB