KJIT
[1]
A Project Report On
Multipurpose Pi
Submitted in Partial Fulfilment ofThe Degree of
Bachelor of Engineering
In Computer Engineering (8th–SEM) Prepared By Parth N Parikh (100640107058) Piyush Sahani (100640107059) Dharmendra Singh Pal (110640107032)Guided By
Assistant Prof. Rohit Tiwari
GUJARAT TECHNOLOGICAL UNIVERSITY (GTU)
K.J.INSTITUTE OF ENGINEERING & TECHNOLOGY,
SAVLI, DIST: VADODARA
DEPARTMENT OF COMPUTER ENGINEERING
KJIT
[2]
K.J.INSTITUTE OF ENGINEERING & TECHNOLOGY,
SAVLI, DIST: VADODARA
C
ERTIFICATE
This is to certify that this work of UDP entitled ““Multipurpose Pi”” represents the bonafide work of Parth N Parikh (100640107058), Piyush G Sahani (100640107059) and Dharmendra Singh Pal (100640107032) for the partial fulfilment of the degree of Bachelor of Engineering in Computer Engineering at the Department of Computer Engineering, K.J.Institute of Engineering & Technology, Savli, Vadodara, Gujarat, during the academic year 2014-15 (Sem-8) and his work is satisfactory.
Internal Guide, Project Coordinators,
Rohit Tiwari Dipali Jitiya
Assistant Professor Assistant Professors
Computer Engineering Department Computer Engineering Department
Head of Department, Principal, Sohil Shah Dr. Neetha John
Assistant Professor KJIT,Savli. Computer Engineering Department
KJIT
[3]
Abstract
Project Description:
In today’s fast growing world of technology computer and its proper education is very important. Our proposed project`s motto is to make available an learning platform at very low cost which could be affordable by each and every one, Project “Multipurpose Pi“ will be developed using the concepts of embedded system “ Raspberry PI “ configuring with different applications , open source codes and tools to sum-up a perfect credit card sized device with multiple functions.
Applicability of the Project:
This project is applicable for both Commercial and Public Utility Model. Web Server, Controlling electronic devices, NAS, Media Centre, and Video Gaming.
KJIT
[4]
ACKNOWLEDGEMENTS
I would like to acknowledge the contribution of certain distinguished people, without their support and guidance this project work would not have been completed.
I take this opportunity to express my sincere thanks and deep sense of gratitude to my internal project guide Mr.Rohit Tiwari, Asst. Professor, Computer Engineering, KJIT, for his guidance and moral support during the course of preparation of this project report. I really thank him from the rock bottom of my heart for always being there with his extreme knowledge and kind nature.
I take this opportunity to thank all my friends and colleagues who started me out on the topic and provided extremely useful review feedback and for their all-time support and help in each and every aspect of the course of my project preparation. I am grateful to my K.J. Institute of Engineering & Technology, Savli for providing me all required stuff and good working environment.
Acknowledgements and thanks are also extended to all the authors whose articles have been referred to for the completion of this report.
Parth N Parikh
Piyush Sahani
Dharmendra Singh Pal
KJIT
[5]
LIST OF FIGURES
Figure Number Description Page Number
Figure-3.1 E-R Diagram 35
Figure-3.2 Use case Diagram 37
Figure-3.3 Sequence Diagram 39
Figure-3.4 Activity Diagram 41
Figure-3.5 Class Diagram 43
Figure-4.2.1 Desktop on High Resolution Display (HDMI) 48 Figure-4.2.2 Desktop on Low Resolution Display (RCA) 49
Figure-4.2.3 Gamming On Multipurpose Pi 50
Figure-4.2.4 IDLE - Python Programming 51
Figure-4.2.5 Graphics Creation Programming 52
Figure-4.2.6 Starting Raspbian 53
Figure-4.2.7 Starting Raspberry Pi Controlling Via SSH 54
Figure-4.2.8 Shell in Raspbian 55
Figure-4.2.9 Using Scratch Programming 56
Figure-4.2.10 Raspbian Basic Configuration Menu 57
Figure-4.3.1 XBMC Main Screen 58
Figure-4.3.2 Images from Hard Drive 59
Figure-4.3.3 Live Radio 60
Figure-4.3.4 Live Tv (with Addon IPNA) 61
Figure-4.3.5 Live TV 62
Figure-4.3.6 Movies Title 63
Figure-4.3.7 Music from Hard Drive 64
Figure-4.3.8 Music Streaming from Android Phone 65
Figure-4.3.9 Music Streaming from Internet 66
Figure-4.3.10 Video Streaming from Android Phone 67
Figure-4.4.1 LED Testing With GPIO 68
Figure-4.4.2 Single LED Blinking 69
Figure-4.4.3 Controlling LED Using Android Device 70 Figure-4.5.1 Network Attached File Server (NAS) 71
KJIT
[6]
LIST OF TABLES
Figure-4.6.1 Accessing Web Server 72
Table Number Description Page
Number
Table 4.1.1 Raspberry Pi Specifications 45
Table 4.1.2 GPIO input/output pin electrical characteristics 46
KJIT
[7]
ABBREVIATIONS
AND SYMBOLS
ABBREVIATIONS
GPIO : General Purpose Input Output SDLC : Software Development Life Cycle SRS : System Requirement Specification UML : Unified Modelling Language GUI : Graphical User Interface
KJIT [8]
SYMBOLS
E-R Diagram:
Entities: Attributes: Relationship: Link:Data flow Diagram:
Data Flow: Process:
KJIT
[9]
Use case Diagram:
Actor: System Boundary:
Use Case: Connectors:
Sequence Diagram:
Actor: Object Life Cycle:
KJIT
[10]
INDEX
Abstract I
Acknowledgement II
List of Figures III
List of Tables IV
Symbols and Abbreviations V
Index VIII Chapter : 1 INTRODUCTION 1 1.1 Project Detail 14 1.1.1 Project Definition 14 1.1.2 Project Profile 14 1.2 Purpose 16 1.3 Scope 16 1.4 Objective 16
1.5 Technology and Literature Review 16
Chapter : 2 ABOUT THE SYSTEM 19
2.1 System Requirement Specification 20 2.1.1 Project Management Approach 20 2.1.2 Study of Current System 21 2.1.3 Limitations of Current System 22 2.1.4 Tools and Technology used 22
2.1.5 Functionality 24
2.1.6 Hardware and Software
Specification 25
2.1.7 Raspberry Pi 2(Latest Version) 26
2.2 Feasibility Study 27
2.3 Project Planning 28
Chapter : 3 ANALAYSIS 33
3.1 E-R Diagram 35
3.2 Use Case Diagram 37
3.3 Sequence Diagram 39
3.4 Activity Diagram 41
3.5 Class Diagram 43
Chapter : 4 DESIGN 44
4.1 Raspberry Pi General Specifications 45
KJIT
[11]
4.3 XBMC OS ( Media Centre ) 58
4.4 Controlling Electronic Devices 68
4.5 Network Accessed Storage 71
Chapter : 5 IMPLEMENTATION 73 5.1 Implementation Environment 74 5.2 Coding Standard 74 5.3 . 5.4 5.5
Tools for Python Code Quality 75
Tools for Python Code 76
Python Codes 78 Chapter :6 TESTING 79 6.1 Testing Plan 80 6.2 Testing Strategy 81 6.3 Testing Methods 81
Chapter :7 CONCLUSION & FUTURE WORK 84
6.1 Conclusion 85
6.2 Future Enhancement 86
KJIT
[12]
CHAPTER - 1
INTRODUCTION
KJIT
[13]
1.
Introduction
1.1
Project Details
1.1.1 Project Definition
Project “ Multipurpose Pi “ is developed using the concepts of embedded system “ Raspberry PI “ configuring with different applications , open source codes and tools to sum-up a perfect credit card sized device with multiple functions.
1.1.2 Project Profile
We have selected a project which is Multipurpose Pi for small, medium and large scale enterprise. It will be beneficial in both Commercial Utility Model and Public Utility Model. It will be based on embedded system technology.
The project will have following features:
Media Center :-
XBMC can be used to play almost all popular audio and video formats around. It was designed for network playback, so you can stream your multimedia from anywhere in the house or directly from the internet using practically any protocol available. Use your media as-is: XBMC can play CDs and DVDs directly from the disk or image file, almost all popular archive formats from your hard drive. XBMC will scan all of your media and create a personalized library complete with box covers, descriptions, and fan art. There are playlist and slideshow functions, a weather forecast feature and many audio visualizations. Once installed and configured, your computer will become a fully functional multimedia jukebox.
NAS :-
NAS is Network Accessed Storage, one or more Hard Drive connected to the Multipurpose Pi that provides file-based data storage services and sharing to other devices on the network.
KJIT
[14] Controlling Electronic Devices :-
By connecting the different devices to GPIO (General Purpose Input Output) pins we can connect almost all types of electronic devices and control them through different mediums like Keyboard/Mouse, Android Phone, Tablets and Over Internet.
Currently we have connected an LED (Light Emitting Diode) and using android phone to control it over Wi-Fi.
Web Server :-
A web server is a system that processes requests via HTTP, the basic network protocol used to distribute information on the World Wide Web. The most common use of web servers is to host websites, but there are other uses such as data storage, running enterprise applications, handling email, FTP, educational purpose for learning in school and collages or other web uses.
Gamming :-
The emulation machine runs off of a Multipurpose Pi running Retro pie, this allows it to support various emulators such as NES, SNES, Gameboy, Gameboy Colour, Gameboy Advance, Sega Genesis, Neo Geo, MAME, PlayStation One and can even emulate an Apple II. It also supports Python Games which we have practically implemented.
KJIT
[15]
1.2
Purpose
The system is being created for both public and industrial use.
Anyone can buy low cost device with multiple features compared to computer.
By this project computer literacy rate can be improved as it can be implemented everywhere.
1.3
Scope
This device will improve the computer learning capabilities of students.
This device will improve the efficiency of an Enterprise.
This device can be used in home for entertainment, learning and luxury.
This device can work with any kind of display having RCA or HDMI port.
Exploring computing Education in Rural Schools.
Automation in Industries can be done.
It can be used as small scale web server anywhere.1.4
Objective
•
In today’s fast growing world of technology computer and its proper education is very important. Our proposed project`s motto is to make available an learning platform at very low cost which could be affordable by each and every one.•
Low cost device with multiple features which gives enhancement in automation and luxury.1.5
Technology and Literature Review
There are many projects based on embedded system Raspberry Pi.
We have selected some of the best ones and configured all in one to make a multipurpose device.
Some of the interesting projects are:
Raspberry Pi Web Server
“How to set up a simple wired web server on your Raspberry Pi, with PHP and MySql. The Raspberry Pi is a good choice for a webserver that will not receive too much traffic,
KJIT
[16]
such as a testing server, or small intranet, as it doesn’t get too hot (so is nice and quiet), and only uses around 5 Watts of power (approx. costing £3.50 a year if it's running 24/7)” http://www.instructables.com/id/Raspberry-Pi-Web-Server/
Raspberry Pi Remote For Free!
“How to use the HDMI-CEC protocol to control your Pi with your Tv's remote control. This is very useful because it saves you from having to buy a remote just for your Pi and also leaves you with an open usb that you would have needed for your wireless keyboard and mouse.”
http://www.instructables.com/id/Raspberry-Pi-Remote-For-Free/
Raspberry Pi Smart Target
“The Raspberry Pi Smart Target was designed to be hit by the now famous Flying Monkey, but it can be hit by any other light object such as small ball. When the Target is hit the following events happen:
1. A random sound effect is played through a small set of speakers connected to the Raspberry Pi.
2. A "congratulations" message is displayed in the front LCD screen.
3. The Raspberry Pi grabs a snapshot from a network camera (Dropcam) and is posted to a social network.
4. A random message is posted along with the picture taken by the Dropcam. 5. The whole action is immortalized in the interwebz.”
http://www.instructables.com/id/Raspberry-Pi-Smart-Target/
Raspberry Pi as low-cost HD surveillance camera
“This instruct able describes how to build a surveillance cam based on a Raspberry Pi micro-computer which records HD video when something moves in the monitored area. Live picture can be viewed from any web browser, even from your mobile while you're on the road.
What you will get:
See live stream in any web browser from anywhere Record any motion into video file
KJIT
[17]
Usually, such a cam will cost you around US$1.000, but with the result from this intractable, you will get such a cam for only about US$120.”
KJIT
[19]
CHAPTER - 2
KJIT
[20]
2.
About the System:
2.1 System Requirement Specification
2.1.1
Project Management Approach
Waterfall Model has been adopted as an approach for development of project.
Most of the requirements of the project are fixed and already thought of functionality updating is expected in future. So Waterfall model is the right approach for our project.
The waterfall model is a sequential design process, often used in software development processes, in which progress is seen as flowing steadily downwards through the phases of Conception, Initiation, Analysis, Design, Construction, Testing, Production/Implementation, and Maintenance.
The waterfall development model originates in the manufacturing and construction industries: highly structured physical environments in which after-the-fact changes are prohibitively costly, if not impossible. Since no formal software development methodologies existed at the time, this hardware-oriented model was simply adapted for software development.
Waterfall model, the following phases are followed in order:
1. Requirements 2. Analysis 3. design 4. coding 5. Testing 6. Acceptance
It places emphasis on documentation as well as source code. In less thoroughly designed and documented methodologies, knowledge is lost if team members leave before the project is completed, and it may be difficult for a project to recover from the loss.
KJIT
[21]
Figure-2.1.1 Water Fall Model
2.1.2 Study of Current System:
Currently, there are many people who don’t have any computer knowledge and due to its cost they can’t afford it.
There are also many schools and organizations in rural areas where requirement of computer is very necessary for education and development purpose.
There is very less awareness about the embedded systems which could reduce the cost of computers and can be used for many purposes.
KJIT
[22]
2.1.3 Limitations of Current System:
Currently only computers are used for computer education that also not on all places.
Size of computer is very huge and it is bulky compared to Multipurpose Pi.
Cost of computer is also very high almost three times of Multipurpose Pi.
Higher power consumption for running a computer.
Limited display options are available.
Only Universal Serial Bus as port for connecting different devices.
Very less chance of easy portability.
Cannot run for 24 x 7 without specific environment.
2.1.4 Tools & Technology Used:
Technology used:-•
Embedded System – (Raspberry Pi)The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse
Tools:-
•
Raspbian Operating SystemRaspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware. An operating system is the set of basic programs and utilities that make your Raspberry Pi run.
•
XBMC Operating SystemXBMC can be used to play almost all popular audio and video formats around. It was designed for network playback, so you can stream your multimedia from anywhere in the house or directly from the internet using practically any protocol available. Use your media as-is: XBMC can play CDs and DVDs directly from the disk or image file, almost all popular archive formats from your hard drive. XBMC will scan all of your media and create a personalized
KJIT
[23]
library complete with box covers, descriptions, and fan art. There are playlist and slideshow functions, a weather forecast feature and many audio visualizations. Once installed and configured, your computer will become a fully functional multimedia jukebox.
•
SD Formatter 4.0This software formats all SD memory cards, SDHC memory cards and SDXC memory cards. SD Formatter provides quick and easy access to the full capabilities of your SD, SDHC and SDXC memory cards.
The SD Formatter was created specifically for memory cards using the SD/SDHC/SDXC standards. It is strongly recommended to use the SD Formatter instead of formatting utilities provided with operating systems that format various types of storage media. Using generic formatting utilities may result in less than optimal performance for your memory cards. The SD/SDHC/SDXC memory cards have a "Protected Area" on the card for the SD standard's security function. The SD Formatter does not format the "Protected Area". Please use appropriate application software or SD-compatible device that provides SD security function to format the "Protected Area" in the memory card.
•
Win32 Disk ImagerThis program is designed to write a raw disk image to a removable device or backup a removable device to a raw image file. It is very useful for embedded development, namely Arm development projects (Android, Ubuntu on Arm, etc).
KJIT
[24] 2.1.5
Functionality:
Media Center :-
XBMC can be used to play almost all popular audio and video formats around. It was designed for network playback, so you can stream your multimedia from anywhere in the house or directly from the internet using practically any protocol available. Use your media as-is: XBMC can play CDs and DVDs directly from the disk or image file, almost all popular archive formats from your hard drive. XBMC will scan all of your media and create a personalized library complete with boxcovers, descriptions, and fanart. There are playlist and slideshow functions, a weather forecast feature and many audio visualizations. Once installed and configured, your computer will become a fully functional multimedia jukebox.
NAS :-
NAS is Network Accessed Storage, one or more Hard Drive connected to the Multipurpose Pi that provides file-based data storage services and sharing to other devices on the network.
Controlling Electronic Devices :-
By connecting the different devices to GPIO (General Purpose Input Output) pins we can connect almost all types of electronic devices and control them through different mediums like Keyboard/Mouse, Android Phone, Tablets and Over Internet.
Currently we have connected an LED (Light Emitting Diode) and using android phone to control it over Wi-Fi.
Web Server :-
A web server is a system that processes requests via HTTP, the basic network protocol used to distribute information on the World Wide Web. The most common use of web servers is to host websites, but there are other uses such as data storage, running enterprise applications, handling email, FTP, educational purpose for learning in school and collages or other web uses. Gamming :-
KJIT
[25]
The emulation machine runs off of a Multipurpose Pi running Retropie, this allows it to support various emulators such as NES, SNES, Gameboy, Gameboy Color, Gameboy Advance, Sega Genesis, Neo Geo, MAME, PlayStation One and can even emulate an Apple II. It also supports Python Games which we have practically implemented.
2.1.6 Hardware and Software Specification:
H/w Requirements:o Raspberry Pi Model B
o Display ( HDMI )
o Keyboard
o Mouse
o External Hard Disk
o USB Power Hub
o Wi-Fi Adapter
o Portable Power Bank
S/w Requirements:
o Operating System: Raspbian, XBMC o Open Source applications and tools.
KJIT
[26]
2.1.7 Raspberry Pi V2 Latest Version
The Raspberry Pi 2 Model B is the second generation Raspberry Pi. It replaced the original Raspberry Pi 1 Model B+ in February 2015.
Compared to the Raspberry Pi 1 it has:
A 900MHz quad-core ARM Cortex-A7 CPU
1GB RAM
Like the (Pi 1) Model B+, it also has:
4 USB ports
40 GPIO pins
Full HDMI port
Ethernet port
Combined 3.5mm audio jack and composite video
Camera interface (CSI)
Display interface (DSI)
Micro SD card slot
VideoCore IV 3D graphics core
Because it has an ARMv7 processor, it can run the full range of ARM GNU/Linux distributions, including Snappy Ubuntu Core, as well as Microsoft Windows 10 (see the blog for more information). The Raspberry Pi 2 has an identical form factor to the previous (Pi 1) Model B+ and has complete compatibility with Raspberry Pi 1.
KJIT
[27]
2.2 Feasibility Study
Feasibility studies aim to objectively and rationally uncover the strengths and weaknesses of an existing business or proposed venture, opportunities and threats as presented by the environment, the resources required to carry through, and ultimately the prospects for success. In its simplest terms, the two criteria to judge feasibility are cost required and value to be attained.
The assessment is based on an outline design of system requirements, to determine whether the company has the technical expertise to handle completion of the project.
Economic Feasibility
Economic analysis is the most frequently used method for evaluating the effectiveness of a new system. More commonly known as cost/benefit analysis, the procedure is to determine the benefits and savings that are expected from a candidate system and compare them with costs.
If benefits outweigh costs, then the decision is made to design and implement the system. An entrepreneur must accurately weigh the cost versus benefits before taking an action. Cost-based study:
It is important to identify cost and benefit factors, which can be categorized as follows: • Development cost
• Operating cost
This is an analysis of the costs to be incurred in the system and the benefits derivable out of the system.
Time-based study:
This is an analysis of the time required to achieve a return on investments. The future value of a project is also a factor.
KJIT
[28] Operational Feasibility
Operational feasibility is a measure of how well a proposed system solves the problems, and takes advantage of the opportunities identified during scope definition and how it satisfies the requirements identified in the requirements analysis phase of system development. Schedule Feasibility
A project will fail if it takes too long to be completed before it is useful. Typically this means estimating how long the system will take to develop, and if it can be completed in a given time period using some methods like payback period. Schedule feasibility is a measure of how reasonable the project timetable is.
Technical Feasibility
A large part of determining resources has to do with assessing technical feasibility. It considers the technical requirements of the proposed project. The technical requirements are then compared to the technical capability of the organization. The systems project is considered technically feasible if the internal technical capability is sufficient to support the project requirements.
2.3 Project Planning
Project planning is part of project management, which relates to the use of schedules such as Gantt charts to plan and subsequently report progress within the project environment.
Initially, the project scope is defined and the appropriate methods for completing the project are determined. Following this step, the durations for the various tasks necessary to complete the work are listed and grouped into a work breakdown structure. The logical dependencies between tasks are defined using an activity network diagram that enables identification of the critical path.
Necessary resources can be estimated and costs for each activity can be allocated to each resource, giving the total project cost
KJIT
[29]
At this stage, the project plan may be optimized to achieve the appropriate balance between resource usage and project duration to comply with the project objectives. Once established and agreed, the plan becomes what is known as the baseline.
Progress will be measured against the baseline throughout the life of the project. Analyzing progress compared to the baseline is known as earned value management.
Gantt Charts
Gantt Charts are useful tools for analyzing and planning more complex projects.
Help you to plan out the tasks that need to be completed
Give you a basis for scheduling when these tasks will be carried out
When a project is under way, Gantt charts are useful for monitoring its progress. You can immediately see what should have been achieved at a point in time, and can therefore take remedial action to bring the project back on course. This can be essential for the successful and profitable implementation of the project.
Allow you to plan the allocation of resources needed to complete the project, and help you to work out the critical path for a project where you must complete it by a particular date.
When a project is under way, Gantt Charts help you to monitor whether the project is on schedule. If it is not, it allows you to pinpoint the remedial action necessary to put it back on schedule.
Sequential and parallel activities:
An essential concept behind project planning (and Critical Path Analysis) is that some activities are dependent on other activities being completed first. As a shallow example, it is not a good idea to start building a bridge before you have designed it!
These dependent activities need to be completed in a sequence, with each stage being more-or-less completed before the next activity can begin. We can call dependent activities 'sequential' or 'linear'.
KJIT
[30]
Other activities are not dependent on completion of any other tasks. These may be done at any time before or after a particular stage is reached. These are nondependent or 'parallel' tasks. Step 1.List all activities in the plan
For each task, show the earliest start date, estimated length of time it will take, and whether it is parallel or sequential. If tasks are sequential, show which stages they depend on.
Step 2.Set up your Gantt chart
Head - up graph paper with the days or weeks through to task completion. Step 3.Plot the tasks onto the graph paper
Schedule them in such a way that sequential actions are carried out in the required sequence. Ensure that dependent activities do not start until the activities they depend on have been completed.
Step 4.Presenting the analysis
The last stage in this process is to prepare a final version of the Gantt chart. This shows how the sets of sequential activities link together, and identifies the critical path activities. At this stage you also need to check the resourcing of the various activities. While scheduling, ensure that you make best use of the resources you have available, and do not over-commit resource.
Analysis, development and testing of supporting modules are essential activities that must be completed on time.
Hardware installation and commissioning is not time-critical as long as it is completed before the Core Module Training starts.
KJIT
[31]
KJIT
[33]
CHAPTER - 3
ANALYSIS
KJIT
[34]
3.1 E-R Diagram
An entity-relationship diagram (ERD) is a type of data modelling that shows a graphical representation of objects or concepts within an information system or organization and their relationship to one another.
An entity-relationship diagram (ERD) is a graphical representation of an information system that shows the relationship between people, objects, places, concepts or events within that system. An ERD is a data modelling technique that can help define business processes and can be used as the foundation for a relational database.
Three main components of an ERD are the entities, which are objects or concepts that can have data stored about them, the relationship between those entities, and the cardinality.
KJIT
[35]
E-R Diagram
KJIT
[36]
3.2 Use Case Diagram:
A use case diagram at its simplest is a representation of a user's interaction with the system and depicting the specifications of a use case. A use case diagram can portray the different types of users of a system and the various ways that they interact with the system. This type of diagram is typically used in conjunction with the textual use case and will often be accompanied by other types of diagrams as well.
KJIT
[37]
Use Case Diagram
KJIT
[38]
3.3 Sequence Diagram:
The Sequence Diagram models the collaboration of objects based on a time sequence. It shows how the objects interact with others in a particular scenario of a use case.
With the advanced visual modelling capability, you can create complex sequence diagram in few clicks.
Besides, VP-UML can generate sequence diagram from the flow of events which you have defined in the use case description.
The Sequence Diagram models the collaboration of objects based on a time sequence. It shows how the objects interact with others in a particular scenario of a use case.
With the advanced visual modeling capability, you can create complex sequence diagram in few clicks. Besides, VP-UML can generate sequence diagram from the flow of events which you have defined in the use case description.
KJIT
[39]
Sequence Diagram
KJIT
[40]
3.4 Activity Diagram:
It show the interaction, focusing on the work performance.
Display a sequence of actions including alternative execution and object involved in performing the work.
Symbols:
Action state:
It show the internal actions that are executed when in the state.
It typically has an automatic state transaction to another state when its actions have been performed.
Start State:
Stop state:
It show the interaction, focusing on the work performance.
Display a sequence of actions including alternative execution and object involved in performing the work.
KJIT
[41]
Activity Diagram
KJIT
[42]
3.5 Class Diagram:
A class diagram is an illustration of the relationships and source code dependencies among classes in the Unified Modelling Language (UML). In this context, a class defines the methods and variables in an object, which is a specific entity in a program or the unit of code representing that entity.
In software engineering, a class diagram in the Unified Modelling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among objects.
The class diagram is the main building block of object oriented modelling. It is used both for general conceptual modelling of the systematics of the application, and for detailed modelling translating the models into programming code. Class diagrams can also be used for data modeling.[1] The classes in a class diagram represent both the main objects, interactions in the application and the classes to be programmed.A UML use case diagram for the interaction of a client (the actor) and a restaurant (the system)
KJIT
[43]
Class Diagram
KJIT
[44]
CHAPTER – 4
DESIGN
KJIT
[45]
4. Design
4.1 Raspberry Pi General Specifications
4.1.1 Raspberry Pi Specifications
CPU: BCM2835 CPU speed: 700 MHz RAM: 512 MB Ethernet: Yes HDMI: YesAnalog video: Yes
Audio 3.5 mm jack
SD socket: standard SD
On-board regulators: linear Expansion header pins (GPIO): 26
USB ports: 2
Mounting holes: 2
Dimensions: 3.35″ × 2.2″ × 0.8″
Weight: 40 g
KJIT
[46]
4.1.2 GPIO input/output pin electrical characteristics Table :
Output low voltage < 0.40 V 1)
VOL < 0.66 V 2)
< 0.40 V 3)
Output high voltage > 2.40 V 4)
VOH > 2.64 V 5)
> 2.90 V 6)
Input low voltage < 0.80 V 7)
VIL < 0.54 V 8)
< 1.15 V 9)
Input high voltage > 2.00 V 10)
VIH > 2.31 V 11)
> 2.15 V 12)
Hysteresis > 0.25 V 13) 0.66 – 2.08 V 14) Schmitt trigger input low
threshold 1.09 - 1.16 V 15)
VT– 0.9 16)
Schmitt trigger input high
threshold 2.24 - 2.74 V 17) VT+ 0.90 V 18) Pull-up/down 40 – 65 KΩ 19) resistance 100 KΩ 20) Pull-up/down < 50 uA 21) current < 28 uA 22) Pin capacitance 5 pF 23) Bus hold resistance 5-11 KΩ 24)
KJIT
[47]
4.1.3 GPIO 26 Pin Header
P1: 26-pin header
Signal Pins Signal
+3.3 V —1 2— +5 V GPIO_02 GPIO_00 —3 4— +5 V (SDA1) GPIO_03 GPIO_01 —5 6— GND (SCL1) GPIO_04 —7 8— GPIO_14 (GPCLK0) (UART0_TxD) GND —9 10— GPIO_15 (UART0_RxD) GPIO_17 —11 12— GPIO_18 (PCM_CLK) GPIO_27 GPIO_21 —13 14— GND GPIO_22 —15 16— GPIO_23 +3.3 V —17 18— GPIO_24 GPIO_10 —19 20— GND (SPI_0_MOSI) GPIO_09 —21 22— GPIO_25 (SPI_0_MISO) GPIO_11 —23 24— GPIO_08 (SPI_0_SCLK) (SPI_0_CE0_N) GND —25 26— GPIO_07 (SPI_0_CE1_N) Notes:
1. Signals in plain type are for Rev 2 boards, Signals for Rev 1 boards are shown in italics.
2. Primary functions for signals are shown in parentheses. Table-4.1.3: GPIO 26 Pin Header
KJIT
[48]
4.2 Raspbian OS :
4.2.1 Raspbian Desktop on High Resolution Display (HDMI) :
KJIT
[49]
4.2.2 Raspbian Desktop on Low Resolution Display (RCA) :
KJIT
[50]
4.2.3 Gamming On Multipurpose Pi:
KJIT
[51]
4.2.4 IDLE - Python Programming:
KJIT
[52]
4.2.5: Graphics Creation Programming:
KJIT
[53]
4.2.6: Starting Raspbian:
KJIT
[54]
4.2.7: Starting Raspberry Pi Controlling Via SSH:
KJIT
[55]
4.2.8: Shell in Raspbian:
KJIT
[56]
4.2.9: Using Scratch Programming:
KJIT
[57]
4.2.10: Raspbian Basic Configuration Menu:
KJIT
[58]
4.3 XBMC OS ( Media Center ) :
4.3.1 XBMC Main Screen:
KJIT
[59]
4.3.2 Images from Hard Drive:
KJIT
[60]
4.3.3 Live Radio:
KJIT
[61]
4.3.4 Live Tv (Add-on IPNA):
KJIT
[62]
4.3.5 Live Tv:
KJIT
[63]
4.3.6 Movies Title:
KJIT
[64]
4.3.7 Music from Hard Drive:
KJIT
[65]
4.3.8 Music Streaming from Android Phone:
KJIT
[66]
4.3.9 Music Streaming from Internet:
KJIT
[67]
4.3.10 Video Streaming from Android Phone:
KJIT
[68]
4.4
Controlling Electronic Devices :
4.4.1 LED Testing With GPIO:
KJIT
[69]
4.4.2 Single LED Blinking:
KJIT
[70]
4.4.3 Controlling LED Using Android Device:
KJIT
[71]
4.5
NAS :
4.5.1 Network Attached File Server (NAS)
KJIT
[72]
4.6
Web Server :
4.6.1 Accessing Web Server
KJIT
[73]
CHAPTER – 5
KJIT
[74]
5. Implementation:
5.1 Implementation Environment:
Our project is based on embedded system, moreover it is multi user device (User cover both Public utility and commercial Utility usage). User can use any feature whenever they want so for that all the features combined in such a manner that users can use it easily.
Multi Users:
The environment in our system is Multi User environment. There can be multiple users like Public at home, Workers in industries, Students in schools and colleges, Scientist and researchers at their labs and organizations etc.
Multipurpose:
A better model is needed so that each user can perform their task easily. Moreover system should be such that it is easily understandable by users so they can use this system with easily and improve their productivity and knowledge.
For this we have divided modules in two parts based on operating system used. XBMC for Media Center and Raspbian for Webserver, NAS, Controlling Electronic Devices & Gamming. Implementation phase requires precise planning and monitoring mechanism in order to ensure schedule and completeness.
5.2 Coding Standard:
The following guidelines are applicable to all aspects python development:
• Make code as simple and readable as possible. Assume that someone else will be reading your code.
• Prefer small cohesive classes and methods to large monolithic ones.
• Use a separate file for each class, struct, interface, enumeration, and delegate with the exception of those nested within another class.
• Write the comments first. When writing a new method, write the comments for each step the method will perform before coding a single statement. These comments will become
KJIT
[75]
the headings for each block of code that gets implemented.
• Use liberal, meaningful comments within each class, method, and block of code to document the purpose of the code.
• Mark incomplete code with // TODO: comments. When working with many classes at once, it can be very easy to lose a train of thought.
• Prefer while and for each over other available looping constructs when applicable. They are logically simpler and easier to code and debug.
5.3 GPIO (General Purpose Input Output)
The GPIO pins on a Raspberry Pi are a great way to interface physical devices like buttons and LEDs with the little Linux processor. If you’re a Python developer, there’s a sweet library called RPi.GPIO that handles interfacing with the pins. In just three lines of code, you can get an LED blinking on one of the GPIO pins.
The R-Pi has 17 GPIO pins brought out onto the header, most have alternated functions other than just I/O, and there are two pins for UART, two for I2C and six for SPI. All the pins can be use for GPIO with either INPUT or OUTPUT, there also internal pull-up & pull-downs for each pin but the I2C pins have and onboard pull-up so using them for GPIO may not work in some cases.
Using any of the pins will require extra care, than most Arduino users maybe be used to. These pins are 3V3 not 5V like the AVR chips, and they a directly connected to the Broadcom chip at the heart of the R-Pi. This means there is not protection, if you send 5V down a pin there is a good chance of killing the Pi.
There will also be an issue with trying to draw to much power form the pins, according to the data-sheet each pin programmed to current drive between 2mA and 16mA, and it has been warned that trying to draw 16mA from several pins at once could also lead to a damaged Pi. Also from the wiki the "maximum permitted current draw from the 3v3 pin is 50mA" and the "maximum permitted current draw from the 5v pin is the USB input current (usually 1A) minus any current draw from the rest of the board." The current draw for Model B is stated as 700mA so with a 1A power supply this leaves about 300mA to play with.
KJIT
[76] Installing RPi.GPIO
RPi.GPIO is a small python library that take some of the complexity out of driving the GPIO pins, once install a single LED can be lit with 3 lines of python. Installing the library is almost as simple, either at a text console or using Terminal enter the following
$ wget http://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.1.0.tar.gz
$ tar zxf RPi.GPIO-0.1.0.tar.gz
$ cd RPi.GPIO-0.1.0
$ sudo python setup.py install
5.4 Tools for Python Code Quality:
There are various tools that can help you to check your Python code for PEP8 conformance and general code quality. We recommend using them.
• pep8 checks your Python code against some of the style conventions in PEP 8. Perform style clean-ups on master to help avoid spurious merge conflicts.
• pylint analyzes Python source code looking for bugs and signs of poor quality. • pyflakes also analyzes Python programs to detect errors.
• flake8 combines both pep8 and pyflakes into a single tool.
KJIT
[77]
5.5 Python Codes:
Python program for activating GPIO pin to glow LED.
import RPi.GPIO as GPIO ## Import GPIO library
GPIO.setmode(GPIO.BOARD) ## Use board pin numbering GPIO.setup(7, GPIO.OUT) ## Setup GPIO Pin 7 to OUT GPIO.output(7,True) ## Turn on GPIO pin 7
Python program to switch off LED.
import RPi.GPIO as GPIO ## Import GPIO library
GPIO.setmode(GPIO.BOARD) ## Use board pin numbering GPIO.setup(7, GPIO.OUT) ## Setup GPIO Pin 7 to OUT GPIO.output(7,False) ## Turn on GPIO pin 7
Python program to blink LED.
import RPi.GPIO as GPIO ## Import GPIO library
import time ## Import 'time' library. Allows us to use 'sleep'
GPIO.setmode(GPIO.BOARD) ## Use board pin numbering GPIO.setup(7, GPIO.OUT) ## Setup GPIO Pin 7 to OUT
##Define a function named Blink()
def Blink(numTimes,speed):
for i in range(0,numTimes): ## Run loop numTimes print "Iteration " + str(i+1) ## Print current loop GPIO.output(7,True) ## Switch on pin 7
KJIT
[78] GPIO.output(7,False) ## Switch off pin 7 time.sleep(speed) ## Wait
print "Done" ## When loop is complete, print "Done" GPIO.cleanup()
## Ask user for total number of blinks and length of each blink
iterations = raw_input("Enter total number of times to blink: ") speed = raw_input("Enter length of each blink(seconds): ")
## Start Blink() function. Convert user input from strings to numeric data types and pass to Blink() as parameters
KJIT
[79]
CHAPTER - 6
TESTING
KJIT
[80]
6.1 TESTING PLAN
Software Testing has a dual function; it is used to identify the defects in program and it is used to help judge whether or not program is usable in practice. Thus software testing is used for validation and verification, which ensure that software conforms to its specification and meets need of the software customer.
Developer resorted Alpha testing, which usually comes in after the basic design of the program has been completed. The project scientist will look over the program and give suggestions and ideas to improve or correct the design. They also report and give ideas to get rid of around any major problems. There is bound to be a number of bugs after a program have been created.
Analyze and check system representations such as the requirements document, design diagrams and program source code. They may be applied at all stages of the process.
KJIT
[81]
6.2 TESTING STRATEGY
Unit Testing
Software products are normally tested first at the individual component (unit) level. Unit testing (or module testing) is the testing of different units (or modules) of a system in isolation.
Integration Testing
After testing all the components individually the components are slowly integrated and tested at each level of integration. That is called integration testing.
System Testing
Finally the fully integrated system is tested that is called system testing.
6.3 TESTING METHODS
Statistical TestingStatistical Testing is used to test the program’s performance and reliability and to check how it works under operational conditions. Tests are design to reflect the actual user inputs and their frequency.
The stages involved in the statistical analysis for this system are as follows: Parameter type mismatches
Parameter number mismatches
Black-Box Testing
In Black-Box Testing or Functional Testing, Developers are concerned about the output of the module and software, i.e. whether the software gives proper output as per the requirements or not. In another words, this testing aims to test behavior of program against it specification without making any reference to the internal structure of the internal structure of the program or the algorithms used. Therefore the source code is not needed, and so even purchased modules can be tested. The program just gets a certain input and its functionality is examined by observing the output.
KJIT
[82] Input Interface
Processing
Output Interface
The programs get certain inputs. Then the program does its jobs and generates a certain output, which is collected by a second interface. This result is then compared to the expected output, which has been determined before the test.
White Box Testing
White box testing is an important primary testing approach. Here code is inspected to see what it does. This test is designed to check the code. Code is tested using code scripts, driver, etc which are employed to directly interface with and drive the code.
The tester can analyse code and use the knowledge about the structure of a component to drive the test data.
Performance Testing
Performance testing is design to test the runtime performance of the system within the
context of the system. This test is performed at module level as well as the as at system level. Individual modules developed by Developers are tested for required performance.
KJIT
[83] TEST CASES
TEST CASE: Starting, Power Failure, Internet Failure Sr.
No
Test Case Expected Output Actual Output Status
1 Starting Raspberry Pi with Raspbian OS
Raspbian should Boot and Desktop should be loaded
Booting completed and Desktop Loaded
Pass
2 Power Failure & Reboot (Raspbian)
Raspbian should Boot and Desktop should be loaded Booting Done Desktop Loaded Message : “Use Power Off to Shutdown “ Pass 3 Starting Raspberry Pi with XBMC OS XBMC should Boot and Media Centre should be loaded Booting completed and Media Centre Loaded Pass
4 Power Failure & Reboot (XBMC)
XBMC should Boot and Media Centre should be loaded Booting Done. Media Centre Loaded. Message : “Use Power Off to Shutdown “ Pass 5 Internet Connection Lost Running Applications do not affected other than live streaming All applications running successfully. Message: Internet Conn Lost Pass
- 84 -
CHAPTER - 7
CONCLUSION & FUTURE
WORK
- 85 -
7.1 Conclusion:
The development of Multipurpose Pi includes so many people like user system developer, user of system and the management, it is important to identify the system requirements by properly collecting required data for its development.
Proper design builds upon this foundation to give a blue print, which is actually implemented by the developers. On realizing the importance of systematic documentation all the processes are implemented using a software engineering approach.
Working in a live environment enables one to appreciate the intricacies involved in the System Development Life Cycle (SDLC) with Water fall model.
The Multipurpose Pi is developed using embedded system Raspberry Pi and Open Source tools.
The Project provide a credit card sized computer with multiple features which can be used as both public utility model and commercial utility model.
The system includes mainly 5 modules: (i) Media Center
(ii) Web Server
(iii) Controlling Electronic Devices (iv) Network Access Storage (v) Gamming
We have gained a lot of practical knowledge from this project, which we think, shall make us stand in a good state in the future.
- 86 -
We will try to implement voice recognition.
Controlling electronic devices directly through voice commands.
Controlling more number of electronic devices.
We will try to add motion sensing technology.
- 87 -
REFRENCES
1. Raspberry Pi Official Website
http://www.raspberrypi.org/We got the startup and basic guide to achieve this successful completion of project.
2. Raspberry Pi Forum
We got help from the developer all over the world by this forum. http://www.raspberrypi.org/forums/
3. Source forge
We got many open source tools and software’s from source forge like SD card formatter, win32 disk writer etc.
http://www.sourceforge.net/
4. Instructables
We got ideas and help to understand the procedures easily from this tutorial website. http://www.instructables.com/
5. Google
Last but not least, without Google we could not think to resolve our problems we faced. We surfed thousands of website through it to successfully complete the project.
http://www.raspberrypi.org/documentation/usage/gpio/