Simply Raspberry Pi by Abd Allah
-
Upload
lamiaaabdrabou -
Category
Documents
-
view
224 -
download
0
Transcript of Simply Raspberry Pi by Abd Allah
-
8/10/2019 Simply Raspberry Pi by Abd Allah
1/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
2/229
1
-
8/10/2019 Simply Raspberry Pi by Abd Allah
3/229
2
"
"
PDF
Creative Common v4
:
-CC-NC(:)
()
2-BY:
3-SA:
: (
)
0.1
)(03 4103
" "
https://asnadstore.com/p/67no
mailto:[email protected]://asnadstore.com/p/67nohttps://asnadstore.com/p/67nomailto:[email protected] -
8/10/2019 Simply Raspberry Pi by Abd Allah
4/229
3
-
8/10/2019 Simply Raspberry Pi by Abd Allah
5/229
4
(
(
arabdigitalexpression.org
)
(
fablab-egypt.com
hacking15.org
)(
3alemni.com
http://arabdigitalexpression.org/http://fablab-egypt.com/http://www.hacking15.org/http://3alemni.com/http://3alemni.com/http://www.hacking15.org/http://fablab-egypt.com/http://arabdigitalexpression.org/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
6/229
5
" "
http://simplyarduino.com/?p=832http://simplyarduino.com/?page_id=747http://simplyarduino.com/?page_id=5 -
8/10/2019 Simply Raspberry Pi by Abd Allah
7/229
6
4
3
6
7
0
:4:40
:
30
:7
:
74
:88
:
006
:0
:036
:
08
:070
:0
http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576613 -
8/10/2019 Simply Raspberry Pi by Abd Allah
8/229
7
4
3
6
7
0
:4
3
3
""
7Model A7
Model B7
8
ARM Cortex00
00
-00
04
0
06
Hardware07
ARM Cortex0
0
41
:40
44
46
48
4
4
4
4
:Ubuntu Image Writer4
:dd
3
http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644http://d/0-Raspberry%20Pi-Project/Simply%20Raspberry%20Pi.docx%23_Toc381576644 -
8/10/2019 Simply Raspberry Pi by Abd Allah
9/229
1
31
31
:30
34
LXDE3
33
Accessories33
Education3
Internet3
Programming3
System tools36
Preferences36
37
38
3
1
Sudo0
0
.deb6
6
:
7
SSH8SSH server
8
SSH60
VNC
protocol64
VNC server
6
IP Address
67
6
:6:71
:
74
Resistor7
:7
73
7
Ohm's Law76
Power76
LED77
Motors78
-
8/10/2019 Simply Raspberry Pi by Abd Allah
10/229
2
BreadBoard7
81
80840:
4:()83
+:86
3:87
:
88
GPIO8
8
1
1
1
GPIO
0
44
3
3
3
6
6
:Blinking Led7
8
011014
:()01
013
013
01
:016
:017
017
00184018
PIR Motion:Detector01
PIR Motion
Detector01
:000
000
004
BCM00
00
-
8/10/2019 Simply Raspberry Pi by Abd Allah
11/229
3
Adafruit003
003
Adafruit GPIO breakout
cable00:006
PWM007
:Software PWM00
:041
041
PWM
044
PWM044
04:04
04
046
:auto login
046:
046
047
048
04
01
i2C04
0i2C03
i2c0
:BMP08506
i2C08
:0
MIT031
GPIO
Scratch034
GPIO034
03033
03
03
:
036
WebIOPi037
WebIOPi037
038
038
-
8/10/2019 Simply Raspberry Pi by Abd Allah
12/229
4
WebIOPi03
GPIO Header&GPIO list01
WebIOPi00Device Monitor04
0
1Wire0
0
06
06
WebIOPi07
WebIOPi
07
:
08
USB Web
Camera0
0
061
060
064
Motion064
064
06
Motion06
06
066
067
068
06
071
:
070
074
07
073
07
USB (3G)
Modem076
:3G modem076
:077
:3G modem077:
078
07
:080
Sakis3G
084
-
8/10/2019 Simply Raspberry Pi by Abd Allah
13/229
5
3G modem08
083
Raspi-Config086Change user password086
087
088
00
Rastrack04()0
0
03
0
0
Advanced Options06
07
07
08
08
:
0
FM411
411
411
410
414
414
41
41Supercomputers413
41
41
417
418
41
404
406
-
8/10/2019 Simply Raspberry Pi by Abd Allah
14/229
1
212
IT (Information Technology)
!
" "
IT
" "
3
" "
-
8/10/2019 Simply Raspberry Pi by Abd Allah
15/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
16/229
3
Raspberry Pi
2012
25" "
CPU
700
GPU
250 HD
RAM
512
Microcontrollers
"" SoC: System on Chip
8.6 cm x 5.4 cm 45
2212213
Arduino
-
8/10/2019 Simply Raspberry Pi by Abd Allah
17/229
4
:
Libreoffice
Microcontrollers:
Smart Home Automation
RobotsROV and UAV
Camera Streamers
Remote Monitor
Smart TV
Linux: Http server, FTP, MySql, SSH, Etc.
Supercomputers
Balloon Satellites (weather balloon)
!
-
8/10/2019 Simply Raspberry Pi by Abd Allah
18/229
5
" "
211
(
)
Eben Upton
!!
Rob MullinsJack LangAlan Mycroft
35
21
USB
HMDI
-
8/10/2019 Simply Raspberry Pi by Abd Allah
19/229
6
:
GPIO
25
:
http://www.raspberrypi.org
http://youtu.be/gov0BfJ2RqA:
http://www.raspberrypi.org/http://youtu.be/gov0BfJ2RqAhttp://youtu.be/gov0BfJ2RqAhttp://youtu.be/gov0BfJ2RqAhttp://www.raspberrypi.org/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
20/229
7
Module A25Module B
35
RAM
USB Ethernet
Model A
Model B
700 MHz Low PowerARM1176JZ-F
700 MHz Low Power
ARM1176JZ-F
Dual Core 250 MHz withShared Memory
Dual Core 250 MHz withShared Memory
RAM256 MB512 MB
USB12
Ethernet
GPIO
HMDI
3.5 audio jack
RCA-Video
5 volt (400mA) = 2.4 watt5 volt (700mA) = 3.5 watt
( --) 8.6cm x 5.4cm x 1.5cm8.6cm x 5.4cm x 1.7cm
2535
:Module B
Ethernet
-
8/10/2019 Simply Raspberry Pi by Abd Allah
21/229
8
:
)SoC(2835Broadcom BCM:" "
CPURAM GPU
( )
HDMI Output:
" Video & Audio "
-
8/10/2019 Simply Raspberry Pi by Abd Allah
22/229
9
RCA Video Output:
Audio Jack :3.5mm
Ethernet port:
2USB:
USB
KeyboardMouse
USB flash disk
MicroUSB:
5
-
8/10/2019 Simply Raspberry Pi by Abd Allah
23/229
10
:
SD card Slot:
GPIO Pins:
Microcontrollers
CSI Camera input:
DSI Display:
Touch Screen
http://youtu.be/PWgXXtXvNxM:
http://youtu.be/PWgXXtXvNxMhttp://youtu.be/PWgXXtXvNxM -
8/10/2019 Simply Raspberry Pi by Abd Allah
24/229
11
RM Cortex
(
Android)
ARM11 051
!5
ARM
( PIC16f877)
CPU
GPU
RAM
ARM Cortex
( )
( GNU-Linux)
( Source Code)
"
"
-
79AT&T Unix
Assembly
-
8/10/2019 Simply Raspberry Pi by Abd Allah
25/229
12
:
GNU
77
)
+
(
Embedded Devices
( Routers)
Switches & Access Points
1% Servers ( (
:
http://youtu.be/mxvqL3JlSdI
http://ar.wikipedia.org/wiki/%D8%B1%D9%8A%D8%AA%D8%B4%D8%A7%D8%B1%D8%AF_%D8%B3%D8%AA%D8%A7%D9%84%D9%85%D9%86http://ar.wikipedia.org/wiki/%D8%B1%D9%8A%D8%AA%D8%B4%D8%A7%D8%B1%D8%AF_%D8%B3%D8%AA%D8%A7%D9%84%D9%85%D9%86http://ar.wikipedia.org/wiki/%D8%B1%D9%8A%D8%AA%D8%B4%D8%A7%D8%B1%D8%AF_%D8%B3%D8%AA%D8%A7%D9%84%D9%85%D9%86http://ar.wikipedia.org/wiki/%D9%84%D9%8A%D9%86%D9%88%D8%B3_%D8%AA%D9%88%D8%B1%D9%81%D8%A7%D9%84%D8%AF%D8%B2http://ar.wikipedia.org/wiki/%D9%84%D9%8A%D9%86%D9%88%D8%B3_%D8%AA%D9%88%D8%B1%D9%81%D8%A7%D9%84%D8%AF%D8%B2http://ar.wikipedia.org/wiki/%D9%84%D9%8A%D9%86%D9%88%D8%B3_%D8%AA%D9%88%D8%B1%D9%81%D8%A7%D9%84%D8%AF%D8%B2http://youtu.be/mxvqL3JlSdIhttp://youtu.be/mxvqL3JlSdIhttp://youtu.be/mxvqL3JlSdIhttp://ar.wikipedia.org/wiki/%D9%84%D9%8A%D9%86%D9%88%D8%B3_%D8%AA%D9%88%D8%B1%D9%81%D8%A7%D9%84%D8%AF%D8%B2http://ar.wikipedia.org/wiki/%D9%84%D9%8A%D9%86%D9%88%D8%B3_%D8%AA%D9%88%D8%B1%D9%81%D8%A7%D9%84%D8%AF%D8%B2http://ar.wikipedia.org/wiki/%D8%B1%D9%8A%D8%AA%D8%B4%D8%A7%D8%B1%D8%AF_%D8%B3%D8%AA%D8%A7%D9%84%D9%85%D9%86http://ar.wikipedia.org/wiki/%D8%B1%D9%8A%D8%AA%D8%B4%D8%A7%D8%B1%D8%AF_%D8%B3%D8%AA%D8%A7%D9%84%D9%85%D9%86 -
8/10/2019 Simply Raspberry Pi by Abd Allah
26/229
13
51
ARM Cortex
Intel x86AMD x64
ARMx86AMD64
C
1
" " :
Linux Debian
-:raspbian.org
OpenElec
Media Center
XBMC -
:openelec.tv
http://www.raspbian.org/http://openelec.tv/http://openelec.tv/http://www.raspbian.org/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
27/229
14
:
Occidentalis v0.2
Adafruit
-:learn.adafruit.com
-Kali
BackTrack
:kali.org
ROS Robotics Operating System
" "
DebianUbuntu: ros.org
ARM
( ): androidpi.wikia.com
http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/overviewhttp://www.kali.org/http://www.ros.org/http://www.ros.org/http://androidpi.wikia.com/wiki/Android_Pi_Wikihttp://androidpi.wikia.com/wiki/Android_Pi_Wikihttp://www.ros.org/http://www.kali.org/http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/overview -
8/10/2019 Simply Raspberry Pi by Abd Allah
28/229
15
Arch
: archlinuxarm.org
NOOBS
:
Raspbian, Pidora, RaspBMC, OpenELEC
-:raspberrypi.org
RISC OS
RISC OS
Acorn Computers Ltd
ARM
:riscosopen.org
http://raspberrypidiskimages.com
http://youtu.be/P0B1qb4SuXk:
http://archlinuxarm.org/platforms/armv6/raspberry-pihttp://www.raspberrypi.org/downloadshttp://en.wikipedia.org/wiki/Acorn_Computers_Ltdhttp://en.wikipedia.org/wiki/Acorn_Computers_Ltdhttps://www.riscosopen.org/http://raspberrypidiskimages.com/http://youtu.be/P0B1qb4SuXkhttp://youtu.be/P0B1qb4SuXkhttp://raspberrypidiskimages.com/https://www.riscosopen.org/http://en.wikipedia.org/wiki/Acorn_Computers_Ltdhttp://www.raspberrypi.org/downloadshttp://archlinuxarm.org/platforms/armv6/raspberry-pi -
8/10/2019 Simply Raspberry Pi by Abd Allah
29/229
16
:
3
: BegaleBone Raspberry Pi
Arduino UNO
(ARM SoC )
)
(GPIO
)(Microcontroller Atmega328
Arduino C
http://simplyarduino.com
http://simplyarduino.com/http://simplyarduino.com/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
30/229
17
ardwareArduino Uno Raspberry Pi Beaglebone Black
20 25 55
R3 Model B Rev A5A
ATMega 328 ARM11 ARM Cortex-A8 SoC
16MHz
20
700MHz
111
1000 MHz
2KB 512 MB 512 MB
32KB
2+
5-17V 5V 5V
1080p42mA 320 to 480 mA 210 to 460 mA
14 8 66
6 10-bit
7 12-bit
6 1 8 PWM
2 1 2 i2C1 1 1 SPI1 1 5 UART
:2 : USB
10/100 10/100 Ethernet
HDMI, RCAVideo (analog)
microHDMI
HDMI, Analog Analog Arduino CEmbedded CScratch
-
8/10/2019 Simply Raspberry Pi by Abd Allah
31/229
18
:
Arduino C
2025
51
Sleep mode 7
311
0 9
Analog to Digital
converter
-
8/10/2019 Simply Raspberry Pi by Abd Allah
32/229
19
RCA video
HDMI
RM Cortex
ARM Cortex
25
( 51)
) ) 11
Beagle-xM BeagleBone Cubie-
board
pcDuino Rascal Mi-
cro
Raspberry Pi
$201,00 $89,00 $49,00 $60,00 $199,00 $25,00
1 GHz 720 MHz 1 GHz 1 GHz 400 MHz 700 MHz to 1 Ghz (overclock)
ARM Raspberry Pi
projects ) (
:25A35B
05
pCduino
51
=1
(* ) _*
pCduino
-
8/10/2019 Simply Raspberry Pi by Abd Allah
33/229
20
:
ARM
( DebianUbuntu)
ARM
pCduino
)(
91%
BegalBoard, UDOO, pCduino, Parallela
GPIO GPIO 31%
ARM :http://www.cooking-hacks.com/blog/new-linux-embedded-devices-comparison-arduino-
beagleboard-rascal-raspberry-pi-cubieboard-and-pcduino
:
http://youtu.be/ysltNeQ8r5I
http://www.cooking-hacks.com/blog/new-linux-embedded-devices-comparison-arduino-beagleboard-rascal-raspberry-pi-cubieboard-and-pcduinohttp://www.cooking-hacks.com/blog/new-linux-embedded-devices-comparison-arduino-beagleboard-rascal-raspberry-pi-cubieboard-and-pcduinohttp://www.cooking-hacks.com/blog/new-linux-embedded-devices-comparison-arduino-beagleboard-rascal-raspberry-pi-cubieboard-and-pcduinohttp://youtu.be/ysltNeQ8r5Ihttp://youtu.be/ysltNeQ8r5Ihttp://www.cooking-hacks.com/blog/new-linux-embedded-devices-comparison-arduino-beagleboard-rascal-raspberry-pi-cubieboard-and-pcduinohttp://www.cooking-hacks.com/blog/new-linux-embedded-devices-comparison-arduino-beagleboard-rascal-raspberry-pi-cubieboard-and-pcduino -
8/10/2019 Simply Raspberry Pi by Abd Allah
34/229
21
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
35/229
22
:
SD Card)( :
0 32
Full Size SD cardMicroSD
: +
Classes:
class
class 4 class
:0
Kali-linux
-
8/10/2019 Simply Raspberry Pi by Abd Allah
36/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
37/229
24
:
HDMI)( :
RCA Video)(:
HD
Memory Card reader)(:
)( :
-
8/10/2019 Simply Raspberry Pi by Abd Allah
38/229
25
paper box
for raspberry
-
8/10/2019 Simply Raspberry Pi by Abd Allah
39/229
26
:
(
)
BreadBoard(:)
:)( Female-to-
male wires
Raspberry Pi Breakout Cable)(:
short
circuit
-
8/10/2019 Simply Raspberry Pi by Abd Allah
40/229
27
Adafruit
-
8/10/2019 Simply Raspberry Pi by Abd Allah
41/229
28
:
LED
5
:
Resistors
:
Resistor 300 Ohm (x5)
Resistor 10 Killo-Ohm (x5)
Push Buttons
2
LDR
(
)
( 25)Relay Board
Relay
compenent-list.txt
-
8/10/2019 Simply Raspberry Pi by Abd Allah
42/229
29
//www.raspberrypi.org/downloadshttp:
Raspbian
7zipWinRAR
wheezy-raspbian.img
SD cardUSB SD Card
USB
My Computer
F:.
http://www.raspberrypi.org/downloadshttp://www.raspberrypi.org/downloadshttp://www.raspberrypi.org/downloads -
8/10/2019 Simply Raspberry Pi by Abd Allah
43/229
30
:
Format FAT32
Format
Win32 Disk Image Writer
diskimager/files/latest/download32http://sourceforge.net/projects/win
2
30
http://sourceforge.net/projects/win32diskimager/files/latest/downloadhttp://sourceforge.net/projects/win32diskimager/files/latest/downloadhttp://sourceforge.net/projects/win32diskimager/files/latest/downloadhttp://sourceforge.net/projects/win32diskimager/files/latest/downloadhttp://sourceforge.net/projects/win32diskimager/files/latest/download -
8/10/2019 Simply Raspberry Pi by Abd Allah
44/229
31
: Device( F:)
wheezy-raspbian.img
:Write
(
)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
45/229
32
:
Win32 Disk image
Writer
Image WriterUbuntu
dd
:buntu Image Writer
(Terminal):sudo apt-get install usb-imagewriter
sudo imagewriter
-
8/10/2019 Simply Raspberry Pi by Abd Allah
46/229
33
:d
dd DVD, USB
flash
ls /dev/
mmcblk0p1sdb1
mmcblk0p1
" unmounts"
umount /dev/mmcblk0p1
sdb1umount /dev/sdb1
(
/download/wheezy.img)
sudo dd bs=1M if=~/Downloads/2012-08-16-wheezy-raspbian.img of=/dev/sdb
:
dd bs=1M if/Downloads/2012-08-16-wheezy-raspbian.img" of=/dev/mmcblk0p1
1850+0 records in
1850+0 records out
1939865600 bytes (1.9 GB) copied, 379.351 s, 5.1 MB/s
-
8/10/2019 Simply Raspberry Pi by Abd Allah
47/229
34
:
:
) ( MicroUSB
5 911
-
8/10/2019 Simply Raspberry Pi by Abd Allah
48/229
35
KeyboardMouse HDMI RCA
-
8/10/2019 Simply Raspberry Pi by Abd Allah
49/229
36
:
:
oExpand rootfs:
(2)
oOverscan:HD
oConfigure Keyboard:
( )()
oChange Pass :
raspberrypi
oChange Locale:
)
(
oChange time zone :
oMemory split:
( )
oOverclock:
911
711111
-
8/10/2019 Simply Raspberry Pi by Abd Allah
50/229
37
:
oSSH
:(
Secure Shell server
))
)
oBoot Behavior:
oUpdate:
o:Finish
Expand rootfs
2
Finish
-
8/10/2019 Simply Raspberry Pi by Abd Allah
51/229
38
:
Boot behavior
-
8/10/2019 Simply Raspberry Pi by Abd Allah
52/229
39
Raspian
QEMU
RaspberryPi emulation for Windows
511 QEMU
Download
http://sourceforge.net/projects/rpiqemuwindows/
http://sourceforge.net/projects/rpiqemuwindows/http://sourceforge.net/projects/rpiqemuwindows/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
53/229
40
:
run.bat
:
:
:Ctrl+Alt
:
GPIO
( 2
)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
54/229
41
:
)Shell)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
55/229
42
:
0
:Kernal
)(
)(Shell:
( DOS
command line
)
Graphical User
Interface (GUI)
LXDE
KDE Unity
Cinnamon Elementary
Applications
GUI
Shell
kernel
-
8/10/2019 Simply Raspberry Pi by Abd Allah
56/229
43
XDE
LXDE Explorer
Desktoplxde(start)
0
LXTerminal, Scratch, Debian Refrence, PiStore
lxde
Internet, Education, System Tools, Games
-
8/10/2019 Simply Raspberry Pi by Abd Allah
57/229
44
:
ccessories
Accessories9:
Debian Reference )( :
File Manager
:
Image Viewer:
LeafPad :Notepad
LXTerminal :Shell
Root Terminal
:
(Root):(
LXTerminal)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
58/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
59/229
46
:
ystem tools
Task Manager
"
"
references
:
Customise Look:
Desktop Session:
Keyboard & Mouse :
Monitor Setting : Resoultion
Openbox configuration :openbox
( lxde )
Preferred Applications
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
60/229
47
Folders
pCmanFM
LXDEAccessories
/home/pi:
pCmanFM Windows 7
( /home/pi)
Copy
CutDeleteRename
(Copmress(
Tab
Open in New Tab
-
8/10/2019 Simply Raspberry Pi by Abd Allah
61/229
48
:
My Computer)(/
:
/ (
root
)
(
My Computer)
/etc
/home
/home/pi pi
/root )/home/pi)
/media) )
/proc
/sbin
/dev
USB Modem
/lib )( +
-
8/10/2019 Simply Raspberry Pi by Abd Allah
62/229
49
/tmp
/usr
/var
/boot
/selinux SElinux (Security-Enhanced Linux)
/opt
LXterminal
Shell
LXDE
-
8/10/2019 Simply Raspberry Pi by Abd Allah
63/229
50
:
pwd/home/pi:
list everythinglspi
/home/pi:
(
python game, Documents, Scratch
) hellomkdirmake a directory)(
mkdir hello ls
:
cd(change directory)
cd hellopwd
-
8/10/2019 Simply Raspberry Pi by Abd Allah
64/229
51
udo
)
(
System Administrator
Pi
sudosuper user do
)( root
)(
sudo sudosudo programe1
sudo programe2
Root Terminalsudo
command
Show manual
of command
man command
Print Working Directory
pwd
Show date
date
-
8/10/2019 Simply Raspberry Pi by Abd Allah
65/229
52
:
)( name
Make
directory
mkdir name
List everything
ls
List everythingin a list
ls -l
.txt
txtList .txt files
only
ls *.txt
folderChangedirectory
cd folder
Back directory
cd ..
/destination
Copy file(s)cp file/destination
/destination
Move file(s)mv file/destination
file1 file2 file3Remove files
rm file1 file2
file3
folder1 folder2Remove folder
rm -r folder1folder2
commandroot)(Super user do
sudo command
Conver to rootaccoount
Sudo su
site.comfile.zip Download
file.zip
wget
site.com/file.zip
Network
configerations
ifconfig
.zipExtract file.zipunzip file.zip
-
8/10/2019 Simply Raspberry Pi by Abd Allah
66/229
53
Repositories )
(
( )
apt-get
apt-get
sudo apt-get update
-
8/10/2019 Simply Raspberry Pi by Abd Allah
67/229
54
:
)) apt-get sudo
: sudo apt-get install programe1
programe1
Geany sudo apt-get install geany
Enter
apt-get
(y)
Enter:
( " y- )
"y:
sudo apt-get install -y geanysudo apt-get install geany -y
install
remove geany:
sudo apt-get remove geany
( y-)
apt-get
upgrade
-
8/10/2019 Simply Raspberry Pi by Abd Allah
68/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
69/229
56
:
deb
.deb
) ( .deb.msi
dpkg:
sudo dpkg -i application.deb
Bash
) )
:
http://ss64.com/bash/ http://www.pixelbeat.org/cmdline.html
http://linuxcommand.org/learning_the_shell.php
http://librebooks.org/simply-ubuntu
http://librebooks.org/gnu-linux-advanced-administration
http://librebooks.org/linuxawy-diaries-2
http://ss64.com/bash/http://ss64.com/bash/http://ss64.com/bash/http://www.pixelbeat.org/cmdline.htmlhttp://www.pixelbeat.org/cmdline.htmlhttp://linuxcommand.org/learning_the_shell.phphttp://linuxcommand.org/learning_the_shell.phphttp://librebooks.org/simply-ubuntu/http://librebooks.org/gnu-linux-advanced-administration/http://librebooks.org/linuxawy-diaries-2/http://librebooks.org/linuxawy-diaries-2/http://librebooks.org/gnu-linux-advanced-administration/http://librebooks.org/simply-ubuntu/http://linuxcommand.org/learning_the_shell.phphttp://www.pixelbeat.org/cmdline.htmlhttp://ss64.com/bash/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
70/229
57
:
SSH
VNC
RoutersSwitchs
-
8/10/2019 Simply Raspberry Pi by Abd Allah
71/229
58
:
SSH SSH Secure Shell
(
)
(Terminal)
( Secure Shell)
)SSH :server)
( : client)
clients
SH server Raspbian SSH
sudo raspi-config
Advanced Options:
SSH
-
8/10/2019 Simply Raspberry Pi by Abd Allah
72/229
59
:
Finish
SSH:
IP address ifconfig
192.168.1.4
-
8/10/2019 Simply Raspberry Pi by Abd Allah
73/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
74/229
61
SH
o
o ConnectBot
https://play.google.com/store/apps/details?id=org.connectbot
o
Iphone
Ipad
Server Auditor
https://itunes.apple.com/us/app/server-auditor-ssh-client/id549039908?mt=8
SSH clients http://en.wikipedia.org/wiki/Comparison_of_SSH_clients
https://play.google.com/store/apps/details?id=org.connectbothttps://play.google.com/store/apps/details?id=org.connectbothttps://itunes.apple.com/us/app/server-auditor-ssh-client/id549039908?mt=8https://itunes.apple.com/us/app/server-auditor-ssh-client/id549039908?mt=8http://en.wikipedia.org/wiki/Comparison_of_SSH_clientshttp://en.wikipedia.org/wiki/Comparison_of_SSH_clientshttp://en.wikipedia.org/wiki/Comparison_of_SSH_clientshttps://itunes.apple.com/us/app/server-auditor-ssh-client/id549039908?mt=8https://play.google.com/store/apps/details?id=org.connectbot -
8/10/2019 Simply Raspberry Pi by Abd Allah
75/229
62
:
VNC protocol Virtual Network ComputingVNC
VNC
(Server)
(Viewer)
VNC
VNC protocol
Ethernet
tightvncserver
: sudo apt-getupdatesudo apt-getinstall -y tightvncserver
VNC server: vncserver :1
-
8/10/2019 Simply Raspberry Pi by Abd Allah
76/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
77/229
64
:
192.168.1.4:1 " connect:"
Ok
continue
-
8/10/2019 Simply Raspberry Pi by Abd Allah
78/229
65
VNC server
VNC
vncserver :1
VNC
VNC
pi:cd /home/pi
.config config:mkdir .config
autostart:
mkdir autostart
cd autostart
VNC:nano tightvnc.desktop
Ctrl+X
-
8/10/2019 Simply Raspberry Pi by Abd Allah
79/229
66
:
YEnter
[DesktopEntry]Type=ApplicationName=TightVNCExec=vncserver :1
StartupNotify=false
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
80/229
67
IP ddress SSH VNC
IP Address
ifconfig
IP
address
)(
192.168.1.10
192.168.1.1http://192.168.0.1http:// Link-TP
Username: adminPassword: admin
DHCP(
)
DHCP client list
MAC)(
http://192.168.1.1/http://192.168.1.1/http://192.168.0.1/http://192.168.0.1/http://192.168.0.1/http://192.168.1.1/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
81/229
68
:
)rasberrypi MAC Address(B8-27-EB-48-48-D7
MAC Address Address Reservation
Save:
192.168.1.10
2MAC:
(
(MAC
-
8/10/2019 Simply Raspberry Pi by Abd Allah
82/229
69
(
Switch
)
:
My Computer
boot:
cmdline.txtBoot
:
ip=192.168.1.10
-
8/10/2019 Simply Raspberry Pi by Abd Allah
83/229
70
:
cmdline.txt:
:
2
-
8/10/2019 Simply Raspberry Pi by Abd Allah
84/229
71
: IP Address: 192.168.1.5Subnet Mask: 255.255.255.0Default Gateway: 192.168.1.5
PuTTY
VNC viewer
:
Obtain IP Address Automatically
30
-
8/10/2019 Simply Raspberry Pi by Abd Allah
85/229
72
:
:
Breadboard
Ohm's Law
Resistors
Switchs
Motors
BreadBoard
-
8/10/2019 Simply Raspberry Pi by Abd Allah
86/229
73
esistor
(
)
(
)-
Ohm
R( 111)
1 Ohm 1
1000 Ohms = 1 K Ohm 1 K
1000000 Ohms = 1 M Ohm 1 M
:
2
3
0
:
"
"
: :
-
8/10/2019 Simply Raspberry Pi by Abd Allah
87/229
74
:
: 1) (
100
5%
:
= ) ( 5%
= ) ( 1%
Multimeter
( 5)
ohm
-
8/10/2019 Simply Raspberry Pi by Abd Allah
88/229
75
(
)
1( 111)
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
89/229
76
:
hm's Law
(Amp I))((
V)
R
=
(
)
:
I(Current):
V(Voltage: )
R(Resistance):
:2 =\2=3
2:5= 1 =1*5=51
3=
:1
=0
= :\=1\0=2.5)(
ower
Watt 221 1
2211
-
8/10/2019 Simply Raspberry Pi by Abd Allah
90/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
91/229
78
:
Motors
:
:
( DC Servo Stepper)
( 1 Phase3 Phase)
DC Motor
Servo Motor
DC MotorServo Motor
-
8/10/2019 Simply Raspberry Pi by Abd Allah
92/229
79
readBoard
(
soldering iron )
"
BreadBoard "
Test Boardprototype board
-
8/10/2019 Simply Raspberry Pi by Abd Allah
93/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
94/229
81
(
) jumpers
Cat5
)
(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
95/229
82
:
:
3
221
3+
: 5
( 5)
= 3)(\221( = )(1.13= )3
)led) )(
221
)
(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
96/229
83
:33221
-
8/10/2019 Simply Raspberry Pi by Abd Allah
97/229
84
:
2)( :
3
221
)(
3
+
:
Push button switch
-
8/10/2019 Simply Raspberry Pi by Abd Allah
98/229
85
:2 2
2
2
(
221)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
99/229
86
:
3 + :
3
221
) (
2)(
3
+
-
8/10/2019 Simply Raspberry Pi by Abd Allah
100/229
87
0 :
11
3+
-
8/10/2019 Simply Raspberry Pi by Abd Allah
101/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
102/229
89
PIOGPIOGeneral-purpose input/output (
)
2(
pins
)GPIO
( outputs( )imput )
Pin (1, 17) :3.3
51 51
Pin (2, 4) )( 5:
MicroUSB
MicroUSB
5
Pin (6, 9, 14, 20, 25) :Ground (GND)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
103/229
90
:
Pin (3, 5, 7, 8, 10, 11, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 26):9
OutputInput
:Pins GPIOPin3
GPIO2 GPIO 17
Raspberry Pi GPIO pin map
802.11 g
WiFi
TCP/IP
0
i2C, SPI, UART, 1Wire
" "
inputGPIO
OutputCommunication Protocol
C, C++, C# (Mono), Java, Python, Perl, Ruby, Pascal
GPIO
-
8/10/2019 Simply Raspberry Pi by Abd Allah
104/229
91
GPIO
PythonScratchCWiringPi
PIO
GPIO
C
) )GPIO
251(
250,000,000)
(
)
GPIO
http://elinux.org/RPi_Low-level_peripherals
http://elinux.org/RPi_Low-level_peripheralshttp://elinux.org/RPi_Low-level_peripheralshttp://elinux.org/RPi_Low-level_peripherals -
8/10/2019 Simply Raspberry Pi by Abd Allah
105/229
92
:
""
77
GUI
Supercmputers (cluster parrallel programming)
GPIO
"NASA"
(
GitHUB) CWI
" "Guido van Rossum
77 C" "
Monty Python
: ) (
) ( SymbianAndroid
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
106/229
93
++CJava
)
(
oOracle, sybase , PostGres, mSQL , persistence , dbm
GPIO
2.9
GPIO
))
"
":http://librebooks.org/learn_programming_with_python3/
http://librebooks.org/learn_programming_with_python3/http://librebooks.org/learn_programming_with_python3/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
107/229
94
:
) (
python IDLEPython Shell
:
"
"
Hello World
print
:print " Hello World "
Enter
-
8/10/2019 Simply Raspberry Pi by Abd Allah
108/229
95
:
1+1Enter
2*2-1(22)
:
)= (
printx = 2print x
"" = )(
: " " myName = "Abdallah El-Masry"
print myName
x=2+3+2
print x
Ctrl+D
-
8/10/2019 Simply Raspberry Pi by Abd Allah
109/229
96
:
)
(
py
x=3y=1+2sum=x+yprint sum
LeafPadAccssories sum.py
/home/pi
python sum.py
rpi.gpio GPIO
:sudo apt-get update
sudo apt-get instally python-dev python-rpi.gpio
-
8/10/2019 Simply Raspberry Pi by Abd Allah
110/229
97
:linking Led
(
Flash)
:
Bread Board
Led
311
:
311
-
8/10/2019 Simply Raspberry Pi by Abd Allah
111/229
98
:
import timeimport RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)GPIO.setup(11, GPIO.OUT)
while True:GPIO.output(11,0)
time.sleep(1)GPIO.output(11,1)time.sleep(1)
Leafpad
nano
(
)
LeafPad
LeafPadAccssories blinkpin11.py
/home/pi
Nano
while True
Tab
-
8/10/2019 Simply Raspberry Pi by Abd Allah
112/229
99
nano Your-File
Your-File
nano blinkpin11.py
:
Ctrl+x
yEnter
: sudo python blinkpin11.py
) )
Ctrl + C
(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
113/229
100
:
)
Led "
"
) Pin)
GPIO.setwarnings(False) :
:
time
RPi.GPIOGPIO
: GPIO
Pin: Pin
PinINOUTGPIO
Pin INOUT
pinPin23:
GPIO.setup(11, GPIO.OUT)GPIO.setup(23, GPIO.IN)
import timeimport RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
114/229
101
:loops
while True:
Tab
:GPIO.output(pin,
status)
GPIO
pin status=
= =))(3.3 = )
:
time.sleep(time)
time.sleep(5)5
)
=
(GPIO.output(11,0)
time.sleep(1)
= (GPIO.output(11,1(3.3)
time.sleep(1)
GPIO.output(pin,status)TrueFalseTrue
(
1
)False
(
0
):
import timeimport RPi.GPIO as GPIOGPIO.setmode(GPIO.BOARD)GPIO.setup(11, GPIO.OUT)
while True:GPIO.output(11, False)time.sleep(1)
GPIO.output(11, True)time.sleep(1)
while True:command to doanother thing to doanother thin to do
while True:
GPIO.output(11,0)
Time.sleep(1)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
115/229
102
:
print:import timeimport RPi.GPIO as GPIOGPIO.setmode(GPIO.BOARD)GPIO.setup(11, GPIO.OUT)
while True:GPIO.output(11,False)print "Led on Pin 11 is now OFF (output = zero volt)"
time.sleep(1)
GPIO.output(11,True)print "Led on Pin 11 is now ON (output = 3.3 volt)"time.sleep(1)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
116/229
103
)(:
:
Digital Input
:
Bread Board
1
push button)(
:
3.3
1
23 GND
"" nano inputRead.py
-
8/10/2019 Simply Raspberry Pi by Abd Allah
117/229
104
:
import timeimport RPi.GPIO as GPIOGPIO.setmode(GPIO.BOARD)
GPIO.setup(23, GPIO.IN)while True:
if (GPIO.input(23)==True):
print "'Input is True (3.3 volt)"else:
print "'Input is False (zero volt)"
time.sleep(1)
import timeimport RPi.GPIO as GPIO
GPIOGPIO.setmode(GPIO.BOARD)GPIO.setup(23, GPIO.IN)
GPIO.setmode(GPIO.BOARD) GPIO
GPIO.setup(23,GPIO.IN) 23
input
-
8/10/2019 Simply Raspberry Pi by Abd Allah
118/229
105
)if-else =
- (
(
)()
if:
GPIO.input(23)
True 3.3Input isTrue (3.3 volt)
(
False)
Input is False
(zero volt)
if
if ( ):
else:
2
(something1 == something2) :2
(something1 != something2) : )(2
((something1 > something2 : 2
((something1 < something2 : 2
((something1 >= something2
:
2
((something1
-
8/10/2019 Simply Raspberry Pi by Abd Allah
119/229
106
:
:
:
) (
:Light Detremnid Resistor (LDR)
:
Bread Board
1
))
311)(
:
1
GND3.3
23 nano lightSensor.py
311
1
-
8/10/2019 Simply Raspberry Pi by Abd Allah
120/229
107
:import timeimport RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)GPIO.setup(23, GPIO.IN)GPIO.setup(11, GPIO.OUT)
while True:if (GPIO.input(23) == True):
GPIO.output(11,0)
else:GPIO.output(11,1)
:
sudo python lightSensor.py
)(
if
=
23=3.3
23)
=
(
if (GPIO.input(23)==True):print "'Input is True (3.3 volt)"
else:print "'Input is False (zero volt)"
time.sleep(1)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
121/229
108
:
True if False
)( import timeimport RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)GPIO.setup(23, GPIO.IN)
GPIO.setup(11, GPIO.OUT)
while True:if (GPIO.input(23) == False):
GPIO.output(11,0)else:
GPIO.output(11,1)
2
print GPIO.output
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)GPIO.setup(23, GPIO.IN)GPIO.setup(11, GPIO.OUT)
while True:if (GPIO.input(23) == False):
GPIO.output(11,0)print " Led on pin 11 is now OFF "
else:GPIO.output(11,1)print " Led on pin 11 is now ON "
time.sleep(1)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
122/229
109
: IR Motion Detector
IR Motion Detector
Ultrasonic (
Radar
)IR: Infra-red
PIR motion detector
( 9 )
711 91
)(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
123/229
110
:
:
3 3
5
)
(
Digital Out
()Ground)(
:
( 5 )
23
)
(
: nano motion.py
-
8/10/2019 Simply Raspberry Pi by Abd Allah
124/229
111
:import timeimport RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)GPIO.setup(23, GPIO.IN)
while True:if (GPIO.input(23) == True):
pritn " Motion Detected "
else:pritn " There is No Motion "
time.sleep(1)
:
3 23
True
ifMotion Detected
-
8/10/2019 Simply Raspberry Pi by Abd Allah
125/229
112
:
311) (
3
import timeimport RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)GPIO.setup(23, GPIO.IN)GPIO.setup(11, GPIO.OUT)
while True:if (GPIO.input(23) == True):
GPIO.output(11,1)
print " Motion Detected, Now Turning On Led "time.sleep(3)
else:GPIO.output(11,0)print " There is No motion "
time.sleep(1)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
126/229
113
BCM
(
BOARD
)BCM
( Broadcom )
BCM BOARD Adafruit Breakout cable
( BCM
BOARD)
GPIO
GPIO: GPIO.setmode(GPIO.BOARD)
BCM: GPIO.setmode(GPIO.BCM)
BCM
-
8/10/2019 Simply Raspberry Pi by Abd Allah
127/229
114
:
AdafruitAdafruitOpen Source Electronics
))
Adafruit Breakout Cable
GPIO
:
GPIO
Adafruit breakout cable
BCM
GPIO BCM
-
8/10/2019 Simply Raspberry Pi by Abd Allah
128/229
115
dafruit GPIO breakout cable
-
8/10/2019 Simply Raspberry Pi by Abd Allah
129/229
116
:
:
i2C
SPI
-
8/10/2019 Simply Raspberry Pi by Abd Allah
130/229
117
PWM
Digital
HIGH(3.3
)
LOW
)
(
HIGHLOW3.3
)32
3.3)
Pulse Width
Modulation
HIGHLOW
HIGHLOW
)(
HIGH
LOW
Duty Cycle
-
8/10/2019 Simply Raspberry Pi by Abd Allah
131/229
118
:
:PWM
(
)(
)
Hardware PWMSoftware PWMPWM
2(pin12)
GPIO
PWM
GPIO Software PWM
PWM
-
8/10/2019 Simply Raspberry Pi by Abd Allah
132/229
119
:Software PWM
Software PWM
:
Bread Board
Led
311
nano
pwm.py: nano pwm.py
-
8/10/2019 Simply Raspberry Pi by Abd Allah
133/229
120
:
:
import RPi.GPIO as GPIOimport timeGPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
p = GPIO.PWM(11, 50)p.start(5)
p.ChangeDutyCycle(10)time.sleep(3)p.ChangeDutyCycle(40)time.sleep(3)
p.ChangeDutyCycle(80)time.sleep(3)p.ChangeDutyCycle(100)time.sleep(3)
p.stop()GPIO.cleanup()
sudo python pwm.py
3
GPIOPWM:time
p = GPIO.PWM(11, 50)
PWM 51
p
pp.start(5)
Duty Cycle=5%p.ChangeDutyCycle(10)
time.sleep(3)
p.ChangeDutyCycle(10) Duty Cycle PWM
11% time.sleep(3)
PWMDuty cycle 10%
3
-
8/10/2019 Simply Raspberry Pi by Abd Allah
134/229
121
p.ChangeDutyCycle(40)
time.sleep(3)p.ChangeDutyCycle(80)time.sleep(3)p.ChangeDutyCycle(100)
time.sleep(3)
Duty Cycle1%01%
1%11%
DutyCycle(10)DutyCycle(40)DutyCycle(80)
p.stop()GPIO.cleanup()
p.stop()
PWM
GPIO.cleanup()
)) PWM
Raspi.tv 2http://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-control
ULN2003
http://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-controlhttp://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-controlhttp://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-controlhttp://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-controlhttp://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-speed-control -
8/10/2019 Simply Raspberry Pi by Abd Allah
135/229
122
:
WM
GPIOPWM
( ATmega ) PWM
Expanders
WM
PWMAdafruit Occidentalismotor?view=all-dc-a-controlling-9-lesson-pi-raspberry-http://learn.adafruit.com/adafruit
PWMWiring Pi
tutorials/gpio-pi-https://sites.google.com/site/semilleroadt/raspberry
Servo i2CPWMAdafruitPWMpi/overview-raspberry-with-driver-servo-channel-16-http://learn.adafruit.com/adafruit
32PWMPridopialp.html-2-9685-http://www.pridopia.co.uk/pi
http://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=allhttps://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpiohttps://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpiohttps://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpiohttps://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpiohttps://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpiohttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://www.pridopia.co.uk/pi-9685-2-lp.htmlhttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overviewhttps://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpiohttp://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?view=all -
8/10/2019 Simply Raspberry Pi by Abd Allah
136/229
123
3( )
:
:
:
Bread Board
2311
2
-
8/10/2019 Simply Raspberry Pi by Abd Allah
137/229
124
:
blink11.py:
import timeimport RPi.GPIO as GPIOGPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)GPIO.setup(11, GPIO.OUT)
while True:GPIO.output(11,True)time.sleep(2)
GPIO.output(11,Flase)time.sleep(2)
blink13.py:
import timeimport RPi.GPIO as GPIOGPIO.setwarnings(False)GPIO.setmode(GPIO.BOARD)
GPIO.setup(13, GPIO.OUT)while True:
GPIO.output(13, True)time.sleep(.1)GPIO.output(13, True)
time.sleep(.1)
and(&)
) (
&:
2577 2579
sudo kill
:
sudo kill 2577
sudo kill 2579
-
8/10/2019 Simply Raspberry Pi by Abd Allah
138/229
125
killall:
sudo killall sudo python blink11.py
killall:
:
) (
2(
)
)
(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
139/229
126
:
:
:uto loginpi
/etc/inittab()
:sudo nano /etc/inittab
Ctrl + w
1:2345:respawn:/sbin/getty --noclear 38400 tty1
(#)#1:2345:respawn:/sbin/getty --noclear 38400 tty1
1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1
Ctrl+X
y
Enter
:
bootloginauto profile/etc/
:sudo nano /etc/profile
) &(
sudo python
:sudo python /home/pi/python_programe_1.py &sudo python /home/pi/python_programe_2.py &/home/pi/your_programe_1.sh &/home/pi/your_programe_2.sh &
-
8/10/2019 Simply Raspberry Pi by Abd Allah
140/229
127
Htop
Task Manager
:sudo apt-get install htopy
sudo htop
:
( 1) 5%
Kill
F9 F10
-
8/10/2019 Simply Raspberry Pi by Abd Allah
141/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
142/229
129
from nanpy import Arduinofrom nappy import serial managerfrom time import sleep
LED =13Arduino.pinMode(LED, Arduino.OUTPUT)
print ("Start Arduino Blink 5 time")
for i in range(0,5):Arduino.digitalWrite(LED, Arduino.HIGH)sleep(0.5)
Arduino.digitalWrite(LED, Arduino.LOW)sleep(0.5)
(
)
http://simplyarduino.com/?page_id=5
https://pypi.python.org/pypi/nanpy
https://github.com/nanpy/nanpy
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hi
lit=Arduino#p368522
ttyACM0
3
3
5
http://simplyarduino.com/?page_id=5http://simplyarduino.com/?page_id=5https://pypi.python.org/pypi/nanpyhttps://pypi.python.org/pypi/nanpyhttps://github.com/nanpy/nanpyhttps://github.com/nanpy/nanpyhttp://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=46881&p=368522&hilit=Arduino#p368522https://github.com/nanpy/nanpyhttps://pypi.python.org/pypi/nanpyhttp://simplyarduino.com/?page_id=5 -
8/10/2019 Simply Raspberry Pi by Abd Allah
143/229
130
:
:
sudo apt-get install -y arduinosudo apt-get install -y python-serial
USB
/dev/ttACM0ttyACM1
:ls /dev/tty*
( LXDEElectronics)
Arduino
UARTpython-serial
:
http://www.andremiller.net/content/raspberry-pi-and-arduino-via-gpio-uart
http://www.andremiller.net/content/raspberry-pi-and-arduino-via-gpio-uarthttp://www.andremiller.net/content/raspberry-pi-and-arduino-via-gpio-uarthttp://www.andremiller.net/content/raspberry-pi-and-arduino-via-gpio-uart -
8/10/2019 Simply Raspberry Pi by Abd Allah
144/229
131
http://www.fritz-hut.com/2012/08/27/connecting-an-arduino-and-raspberry-pi/ http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-
communication/ http://www.instructables.com/id/The-Raspberry-Pi-Arduino-Connection/
http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-
usb-i2c/
http://www.fritz-hut.com/2012/08/27/connecting-an-arduino-and-raspberry-pi/http://www.fritz-hut.com/2012/08/27/connecting-an-arduino-and-raspberry-pi/http://www.fritz-hut.com/2012/08/27/connecting-an-arduino-and-raspberry-pi/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://www.instructables.com/id/The-Raspberry-Pi-Arduino-Connection/http://www.instructables.com/id/The-Raspberry-Pi-Arduino-Connection/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://robot-kingdom.com/ways-link-raspberry-pi-with-arduino-using-gpio-serial-usb-i2c/http://www.instructables.com/id/The-Raspberry-Pi-Arduino-Connection/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/http://www.fritz-hut.com/2012/08/27/connecting-an-arduino-and-raspberry-pi/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
145/229
132
:
2CI2C Inter Integrated Circuit Communications
(
IC
) )(
( 29)
PIC
i2C Nodes
( Serial data line)SDA(Serial clock line)SCL
-
8/10/2019 Simply Raspberry Pi by Abd Allah
146/229
133
i2C
addressDatasheet
( Master )
) Slave )
Bits:7
START ( :) (
)
2Slave Address(9 :)
3Read/Write( :)(
( )
)
0ACK :)(
(
read
Write
)5Data (1) :
ACK:
9Data (2):
ACK:
7STOP :
i2C
51.111(
51)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
147/229
134
:
2C
Digital-to-analogue converters (DACs)
Analogue-to-digital converters (ADCs)
LCD displays
OLED Screens
Keyboards
Motor drivers
LED drivers
Memory chips and cards (EEPROM, RAM, FERAM, Flash)
Bus expanders/extenders (chips with 8 or 16 I/O pins controllable via I2C)
Other microcontrollers (Arduino based, genral AVR families, PIC).
i2C:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
148/229
135
i2c
GPIO i2C
Inputs/output i2C:
nano:sudo nano /etc/modules
: i2c-bcm2708i2c-dev
: sudo nano /etc/modprobe.d/raspi-blacklist.conf
( #)( )blacklist spi-bcm2708
blacklist i2c-bcm2708
sudo reboot
i2C i2C:sudo apt-get install -y python-smbussudo apt-get install -y i2c-tools
:Adafruit i2cSPI
UART
-
8/10/2019 Simply Raspberry Pi by Abd Allah
149/229
136
:
:MP085
BMP085
)( i2C
( i2C Address)
2( 52)
(25)sudo i2cdetect -y 1 #if you use raspberry pi V.2sudo i2cdetect -y 0 #if you use raspberry pi V.1
i2C
0x77
-
8/10/2019 Simply Raspberry Pi by Abd Allah
150/229
137
Adafruit (
)Github:git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
i2C
:
cd Adafruit-Raspberry-Pi-Python-Codecd Adafruit_I2C
2 B
Adafruit_I2Cnano Adafruit_I2C
def __init__(self, address, bus=smbus.SMBus(0), debug=False):
)
(
def __init__(self, address, bus=smbus.SMBus(1), debug=False)
Adafruit_BMP085
sudo python Adafruit_BMP085_example.py
:from Adafruit_BMP085import BMP085bmp = BMP085(0x77)
temp = bmp.readTemperature()pressure = bmp.readPressure()altitude = bmp.readAltitude()
print "Temperature: %.2f C" % temp
print "Pressure: %.2f hPa" % (pressure / 100.0)print "Altitude: %.2f" % altitude
Adafruit_BMP085
-
8/10/2019 Simply Raspberry Pi by Abd Allah
151/229
138
:
2C
GPIO Expander GPIO
i2Chttp://learn.adafruit.com/mcp230xx-gpio-expander-on-the-raspberry-pi
Character 16x2http://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi
RTChttp://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi
( Seven Segment)http://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pi
Digital to Analog Converter (DAC)
http://learn.adafruit.com/mcp4725-12-bit-dac-with-raspberry-pi
Servo Motor http://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi
BMP085) (http://learn.adafruit.com/using-the-bmp085-with-raspberry-pi
http://learn.adafruit.com/mcp230xx-gpio-expander-on-the-raspberry-pihttp://learn.adafruit.com/mcp230xx-gpio-expander-on-the-raspberry-pihttp://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pihttp://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pihttp://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pihttp://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pihttp://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pihttp://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pihttp://learn.adafruit.com/mcp4725-12-bit-dac-with-raspberry-pihttp://learn.adafruit.com/mcp4725-12-bit-dac-with-raspberry-pihttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pihttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pihttp://learn.adafruit.com/using-the-bmp085-with-raspberry-pihttp://learn.adafruit.com/using-the-bmp085-with-raspberry-pihttp://learn.adafruit.com/using-the-bmp085-with-raspberry-pihttp://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pihttp://learn.adafruit.com/mcp4725-12-bit-dac-with-raspberry-pihttp://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pihttp://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pihttp://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pihttp://learn.adafruit.com/mcp230xx-gpio-expander-on-the-raspberry-pi -
8/10/2019 Simply Raspberry Pi by Abd Allah
152/229
139
:
):
GPIO
-
8/10/2019 Simply Raspberry Pi by Abd Allah
153/229
140
:
MIT MIT
()
.
)(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
154/229
141
01
:
:
:
http://scratch.uaeu.ac.ae/
:GPIO
)(
http://scratch.uaeu.ac.ae/http://scratch.uaeu.ac.ae/http://scratch.uaeu.ac.ae/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
155/229
142
:
cratchPIO
GPIO
PIO Raspian
GPIO
:
sudo wgethttps://db.tt/mwn3LsYv -O isg.sh
sudo bash isg.sh
ScratchGPIO3:
" "
https://db.tt/mwn3LsYvhttps://db.tt/mwn3LsYv -
8/10/2019 Simply Raspberry Pi by Abd Allah
156/229
143
ScratchGPIO
) (File
Open
Blink11:
:
311(
"" )
""
-
8/10/2019 Simply Raspberry Pi by Abd Allah
157/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
158/229
145
:
( Scratch)
GPIO
(
:)http://www.pridopia.co.uk/rs-pi-set-scratch.html
http://scratch.uaeu.ac.ae/
http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/
http://cymplecy.wordpress.com/2013/12/27/scratchgpio-documentation/
http://www.pridopia.co.uk/rs-pi-set-scratch.htmlhttp://www.pridopia.co.uk/rs-pi-set-scratch.htmlhttp://scratch.uaeu.ac.ae/http://scratch.uaeu.ac.ae/http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/http://cymplecy.wordpress.com/2013/12/27/scratchgpio-documentation/http://cymplecy.wordpress.com/2013/12/27/scratchgpio-documentation/http://cymplecy.wordpress.com/2013/12/27/scratchgpio-documentation/http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/http://scratch.uaeu.ac.ae/http://www.pridopia.co.uk/rs-pi-set-scratch.html -
8/10/2019 Simply Raspberry Pi by Abd Allah
159/229
146
:
:
WebIOPi
GPIO
-
8/10/2019 Simply Raspberry Pi by Abd Allah
160/229
147
ebIOPi
WebIoPIInternet of Things
+) ( GPIO
WebIOPi
Firefox, Chrome,
Opera
GPIO
ExpandersShift Registers
C2iSPI 31 https://code.google.com/p/webiopi/
ebIOPi
WebIOPi
wget http://webiopi.googlecode.com/files/WebIOPi-0.6.0.tar.gz
:
https://code.google.com/p/webiopi/https://code.google.com/p/webiopi/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
161/229
148
:
:
tar xvzf WebIOPi-0.6.0.tar.gz
cd WebIOPi-0.6.0sudo ./setup.sh
( )
21
1
Home Automation
:
sudo update-rc.d webiopi defaults
)( Reboot
Ip Address ifconfig
192.168.1.8
-
8/10/2019 Simply Raspberry Pi by Abd Allah
162/229
149
) (
:8000:
http://192.168.1.8:8000
webiopiraspberry
:
ebIOPi
0:
GPIO Header:
2GPIO list:
3Serial Monitor:
( Serial Monitor Arduino IDE)
0Device Monitor:
(
)
http://192.168.1.8:8000/http://192.168.1.8:8000/http://192.168.1.8:8000/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
163/229
150
:
PIO Header&PIO list
:
GPIO HeaderGPIO List
( |)
INOUT
2
Pin
HIGH
3.3
) (
3.3
3.3
-
8/10/2019 Simply Raspberry Pi by Abd Allah
164/229
151
ebIOPi
Led311 2
OUT
IN
221
Relay Board
-
8/10/2019 Simply Raspberry Pi by Abd Allah
165/229
152
:
evice Monitor
WebIOPi
DS1822
ADS1014
:
http://code.google.com/p/webiopi/wiki/DEVICES
/etc/webiopi/config
Device Monitor
Expansion Board
ADC
http://code.google.com/p/webiopi/wiki/OneWireTemphttp://code.google.com/p/webiopi/wiki/ADS1000http://code.google.com/p/webiopi/wiki/DEVICEShttp://code.google.com/p/webiopi/wiki/DEVICEShttp://code.google.com/p/webiopi/wiki/DEVICEShttp://code.google.com/p/webiopi/wiki/ADS1000http://code.google.com/p/webiopi/wiki/ADS1000http://code.google.com/p/webiopi/wiki/OneWireTemp -
8/10/2019 Simply Raspberry Pi by Abd Allah
166/229
153
:
DS18B20
WebIOPi
:
Bread Board
DS18B20
4.7
Wire
1Wiresudo modprobe w1-gpio
sudo modprobe w1-therm
-
8/10/2019 Simply Raspberry Pi by Abd Allah
167/229
154
:
1Wire) (
cd /sys/bus/w1/devicesls
ls 28-000004598ef8:
WebIOPi
/etc/webiopi/config:
sudo nano /etc/webiopi/config #temp0#temp1
( #)
DS18b20:
temp3 = DS18B20 slave:28-000004598ef8
28-000004598ef8
-
8/10/2019 Simply Raspberry Pi by Abd Allah
168/229
155
Ctrl+X
Y
Enter
WebIOPiDevcies Monitor:
DS18B20 1Wire
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
169/229
156
:
WebIOPi:
temp3 = DS18B20 slave:28-0000045348ev5temp4 = DS18B20 slave:28-00000411984ntemp5 = DS18B20 slave:28-000006698xcf
/sys/bus/w1/devices
1Wire i2C:temp1 = TMP102 slave:0x49temp2 = TMP102 slave:0x50
temp3 = DS18B20 slave:28-0000045348ev5temp4 = DS18B20 slave:28-00000411984n
WebIOPi
5
1Wire3 i2C
:
1Wire
: http://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-
temperature-sensing/overview
http://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-
a-raspberry-pi-using-ds18b20
http://www.sbprojects.com/projects/raspberrypi/temperature.php
DS1822 1-Wire Temperature sensorDS1825 1-Wire Temperature sensorDS18B20 1-Wire Temperature sensor
DS18S20 1-Wire Temperature sensor
DS28EA00 1-Wire Temperature sensor
TMP75 I2C Temperature sensor
TMP102 I2C Temperature sensorTMP275 I2C Temperature sensor
http://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overviewhttp://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overviewhttp://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overviewhttp://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overviewhttp://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overviewhttp://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://www.sbprojects.com/projects/raspberrypi/temperature.phphttp://www.sbprojects.com/projects/raspberrypi/temperature.phphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/TMPXXXhttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttps://code.google.com/p/webiopi/wiki/OneWireTemphttp://www.sbprojects.com/projects/raspberrypi/temperature.phphttp://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://raspbrew.tumblr.com/post/39850791984/reading-temperatures-on-a-raspberry-pi-using-ds18b20http://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overviewhttp://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overview -
8/10/2019 Simply Raspberry Pi by Abd Allah
170/229
157
WebIOPi: Client Server
client
WebIOPi Server
WebIOPi
Pi-2-Pi communication
Serial monitor
Firmata
http://code.google.com/p/webiopi/wiki/README?tm=6
ebIOPi
http://trouch.com/2013/03/04/webiopi-in-the-
magpi-cambot-tutorial/
http://inductible.wordpress.com/2013/02/23/tel
emus-a-remotely-operated-vehicle-based-on-
raspberry-pi-and-arduino/
http://code.google.com/p/webiopi/wiki/README?tm=6%20http://code.google.com/p/webiopi/wiki/README?tm=6%20http://code.google.com/p/webiopi/wiki/README?tm=6%20http://trouch.com/2013/03/04/webiopi-in-the-magpi-cambot-tutorial/http://trouch.com/2013/03/04/webiopi-in-the-magpi-cambot-tutorial/http://trouch.com/2013/03/04/webiopi-in-the-magpi-cambot-tutorial/http://trouch.com/2013/03/04/webiopi-in-the-magpi-cambot-tutorial/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://inductible.wordpress.com/2013/02/23/telemus-a-remotely-operated-vehicle-based-on-raspberry-pi-and-arduino/http://trouch.com/2013/03/04/webiopi-in-the-magpi-cambot-tutorial/http://trouch.com/2013/03/04/webiopi-in-the-magpi-cambot-tutorial/http://code.google.com/p/webiopi/wiki/README?tm=6%20http://code.google.com/p/webiopi/wiki/README?tm=6%20 -
8/10/2019 Simply Raspberry Pi by Abd Allah
171/229
158
:
:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
172/229
159
SB Web Camera ) (
3( 21
)
4Tech
Web
Camera
USB(
)
BootUSB
USB
/dev/:lsusbls /dev/v*
)(
( video0)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
173/229
160
:
fswebcamera:
sudo apt-get install fswebcamy
test.jpg
/home/pi:fswebcam -d /dev/video0 -r 640x480 test.jpeg
fswebcam
-d /dev/video0 /dev
-r 640x480Resolution
test.jpeg
/home/pi
-
8/10/2019 Simply Raspberry Pi by Abd Allah
174/229
161
ffmpeg
mplayer:
sudo apt-get install ffmpeg -ysudo apt-get install mplayer -y
test.avi 640x480:
ffmpeg -f video4linux2 -r 25 -s 640x480 -i /dev/video0 test.avi
ffmpeg aviCtrl+C
/home/pi:
mplayer /home/pi/test.avi
VNC
-
8/10/2019 Simply Raspberry Pi by Abd Allah
175/229
162
:
Motion
:
Motion Detector
Frame Rate
otion
: sudo apt-get install motion-y
motion
/etc/default/motion
:
"
"
sudo nano /etc/default/motion
start_motion_daemon=no noyes
motion Ctrl+X:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
176/229
163
""
:sudo nano /etc/motion/motion.conf
:
:
:
daemon off
daemon on
:0101
-
8/10/2019 Simply Raspberry Pi by Abd Allah
177/229
164
:
:webcam_localhost ononoff
Ctrl+X
sudo reboot
: ) (
http://192.168.1.7:8081
192.168.1.7 :8081
VLC
FileOpen network stream
http://192.168.1.7:8081/http://192.168.1.7:8081/http://192.168.1.7:8081/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
178/229
165
otion
HDhttp://www.codeproject.com/Articles/665518/Raspb
erry-Pi-as-low-cost-HD-surveillance-camera
http://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/
https://medium.com/p/2d5a2d61da3d
http://astrobeano.blogspot.com/2012/08/raspberry-
pi-with-two-webcams.html
http://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camerahttp://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camerahttp://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camerahttp://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/http://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/http://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/http://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/https://medium.com/p/2d5a2d61da3dhttps://medium.com/p/2d5a2d61da3dhttp://astrobeano.blogspot.com/2012/08/raspberry-pi-with-two-webcams.htmlhttp://astrobeano.blogspot.com/2012/08/raspberry-pi-with-two-webcams.htmlhttp://astrobeano.blogspot.com/2012/08/raspberry-pi-with-two-webcams.htmlhttp://astrobeano.blogspot.com/2012/08/raspberry-pi-with-two-webcams.htmlhttp://astrobeano.blogspot.com/2012/08/raspberry-pi-with-two-webcams.htmlhttps://medium.com/p/2d5a2d61da3dhttp://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/http://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/http://www.makeuseof.com/tag/how-to-capture-time-lapse-photography-with-your-raspberry-pi-and-dslr-or-usb-webcam/http://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camerahttp://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camera -
8/10/2019 Simply Raspberry Pi by Abd Allah
179/229
166
:
:
Face Recognetion
ASIMO
Word fiel
Motion Estimation
Image Restoration
Object Recognition
Video Tracking
OpenCV (Open Computer Vision)
Python, C, Java, Ruby,
VB, C#.net Windows, Mac, Linux, Solaris
-
8/10/2019 Simply Raspberry Pi by Abd Allah
180/229
167
(
Compiling
)
Debian
python-opencv
): :)
sudo apt-get instally python-opencvsudo apt-get instally libcv-dev libopencv-dev libcv2.3 opencv-doc
35 1
openCV
wget:)(
wgethttp://stevenhickson-code.googlecode.com/svn/trunk/AUI/Imaging/testchmod +x test
./test
Terminal)(
http://stevenhickson-code.googlecode.com/svn/trunk/AUI/Imaging/testhttp://stevenhickson-code.googlecode.com/svn/trunk/AUI/Imaging/testhttp://stevenhickson-code.googlecode.com/svn/trunk/AUI/Imaging/testhttp://stevenhickson-code.googlecode.com/svn/trunk/AUI/Imaging/test -
8/10/2019 Simply Raspberry Pi by Abd Allah
181/229
168
:
""
face_detect_rpi.zip
wget
(
:)wgethttp://goo.gl/oA8SB0
unzip face_detect_rpi.zip
facedetect.pyface.xml python facedetect.pycascade=face.xml 0
0
:
Vendetta (V for Vendetta )
( 91)
http://goo.gl/oA8SB0http://goo.gl/oA8SB0http://goo.gl/oA8SB0http://goo.gl/oA8SB0 -
8/10/2019 Simply Raspberry Pi by Abd Allah
182/229
169
"
"
Magic mirror
openCV
Face Recognition
:http://www.youtube.com/watch?v=yzYIxNgDZu4
" "
" "
9
:http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/
openCV :
compile
http://www.youtube.com/watch?v=yzYIxNgDZu4http://www.youtube.com/watch?v=yzYIxNgDZu4http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/http://www.youtube.com/watch?v=yzYIxNgDZu4 -
8/10/2019 Simply Raspberry Pi by Abd Allah
183/229
170
:
OpenCV
http://opencv.org/books.html
http://opencv.org/books.htmlhttp://opencv.org/books.htmlhttp://www.amazon.com/gp/product/B00CHMQ8L4/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B00CHMQ8L4&linkCode=as2&tag=opencv00-20http://www.amazon.com/gp/product/1430239123/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1430239123&linkCode=as2&tag=opencv00-20http://www.amazon.com/gp/product/1849517827/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849517827&linkCode=as2&tag=opencv00-20http://shop.oreilly.com/product/0636920022497.dohttp://opencv.org/books.html -
8/10/2019 Simply Raspberry Pi by Abd Allah
184/229
171
:
WiFi
3GInternet
WiFi
3G Usb
Modem
-
8/10/2019 Simply Raspberry Pi by Abd Allah
185/229
172
:
USB
( Alfa Wifi )3
Tplink WN321, Dlink-802.11n, Alfa Wifi AUS036
Alfa Wifi
external powered usb
hub
-
8/10/2019 Simply Raspberry Pi by Abd Allah
186/229
173
WiFi Config
:
Scan
add
-
8/10/2019 Simply Raspberry Pi by Abd Allah
187/229
174
:
connect
/etc/network/interfaces
)
(
:sudo nano /etc/network/interfaces
iface wlan0 inet dhcp
wpa-ssid "ssid"wpa-psk "password"
ssid
password
my-network-ssidmy-wifi-password
iface wlan0 inet dhcp
wpa-ssid "my-network-ssid"
wpa-psk "my-wifi-password"
-
8/10/2019 Simply Raspberry Pi by Abd Allah
188/229
175
:
Ctrl+X wifi
ifconfig
wlan0eth0
wlan0 192.168.1.10:
-
8/10/2019 Simply Raspberry Pi by Abd Allah
189/229
176
:
SB (3G) Modem 3G modem
:
o
3G modems
o(USB flash disk)
o3G internet 02
3G modem
3G modem: 3G modem:
" Etisalat Egypt"
:
12
3
-
8/10/2019 Simply Raspberry Pi by Abd Allah
190/229
177
:
sudo apt-get install sg3-utils ppp wvdial -y
:G modem
3G modem
ls /dev/tty*
/dev/ttyUSB0
(
)
3G modem
USB flash disk
sudo apt-get install usb-modeswitchsudo /usr/bin/sg_raw /dev/sr0 11 06 20 00 00 00 00 00 01 00
usb-modeswitch
ls /dev/tty*
/dev/ttyUSB0/ dev/ttyUSB1
USB modem
-
8/10/2019 Simply Raspberry Pi by Abd Allah
191/229
178
:
:
/ etc/wvdial.conf
sudo nano /etc/wvdial.conf
[Dialer etisalat]Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0Modem Type = USB Modem
Phone = *99***1#ISDN = 0Username = " "Password = " "
Init1 = ATZInit3 = AT+CGDCONT=1,"IP","internet.etisalat"Modem = /dev/ttyUSB2Baud = 7200000Auto DNS = 1Dial Command = ATDTCarrier Check = yesStupid Mode = 1
" "
-
8/10/2019 Simply Raspberry Pi by Abd Allah
192/229
179
Phone:( server )
( -- ) o
*99***1#o
*99#
Username:)(
" blank"
Password:)(
Baud :
:o
115200o 7200000o
9600
Modem:ls /devo /dev/ttyUSB0o
/dev/ttyUSB1o /dev/ttyUSB2
ZTE MF190S
Configurations: ZTE MF190S Linux connection configurations
-
8/10/2019 Simply Raspberry Pi by Abd Allah
193/229
180
:
USB Modems
-ZTE[Dialer etisalat]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0Modem Type = USB ModemPhone = *99***1#ISDN = 0Username = " "Password = " "
Init1 = ATZInit3 = AT+CGDCONT=1,"IP","internet.etisalat"Modem = /dev/ttyUSB2Baud = 7200000Auto DNS = 1Dial Command = ATDTCarrier Check = yesStupid Mode = 1
-Huawei[Dialer vodafone]Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0Modem Type = USB Modem
Phone = *99***1#ISDN = 0Username = "internet"
Password = "internet"Init1 = ATZInit3 = AT+CGDCONT=1,"IP","internet.vodafone.net"Modem = /dev/ttyUSB0Baud = 115200Auto DNS = 1
Dial Command = ATDTCarrier Check = yesStupid Mode = 1
nterneti
:
/ etc/wvdial.conf
-
8/10/2019 Simply Raspberry Pi by Abd Allah
194/229
181
:
sudo wvdial etisalat &
Etisalat
sudo wvdial vodafon &
IP address
WvDial: Internet dialer version 1.61--> Initializing modem.
--> Sending: ATH
ATH
OK--> Sending: ATE1ATE1OK--> Sending: AT+CGDCONT=1,"IP","internet"
AT+CGDCONT=1,"IP","internet"OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.ATDT*99#CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Fri Jun 14 22:35:19 2013--> Pid of pppd: 3145--> Using interface ppp0
--> pppd: y
--> pppd: y
--> local IP address 10.133.163.246--> pppd: y
--> remote IP address 10.64.64.64--> pppd: y--> primary DNS address 89.108.202.20
--> pppd: y--> secondary DNS address 89.108.195.20
--> pppd: y
-
8/10/2019 Simply Raspberry Pi by Abd Allah
195/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
196/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
197/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
198/229
185
:
Raspi-Config
111
-
8/10/2019 Simply Raspberry Pi by Abd Allah
199/229
-
8/10/2019 Simply Raspberry Pi by Abd Allah
200/229
187
raspi-config
Enable Boot to Desktop
Boot3
:
Console text
:( boot)
2Desktop log in as user "pi" :LXDE
( booting)
3Scratch start :Scratch
Scratch
Desktop log in
-
8/10/2019 Simply Raspberry Pi by Abd Allah
201/229
188
:
Internationalisation option
:
Change Local
:
:
ar_EG.UTF-8space)(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
202/229
189
Tab OkEnter
) )
) (
Internationalisation option
) (
(
)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
203/229
190
:
" Cairo"TabokEnter
Internationalisation option
Change Keyboard Layout:
) ( )(
-
8/10/2019 Simply Raspberry Pi by Abd Allah
204/229
191
Enable Camera
CSI Camera
CSIEnable CameraRaspi-
Config
-
8/10/2019 Simply Raspberry Pi by Abd Allah
205/229
192
:
Rastrack
rastrack
(http://rastrack.co.uk)
http://rastrack.co.uk/http://rastrack.co.uk/http://rastrack.co.uk/http://rastrack.co.uk/ -
8/10/2019 Simply Raspberry Pi by Abd Allah
206/229
193
)( ""Overclocking CPU
GPU
RAM
raspi-configoverclock
:
5:
None :CPUGPU
2Modest:11
3Medium:711
051( 011)
0High:751 051
5Turbo( ):111
GPU511 ( 251 )
11
-
8/10/2019 Simply Raspberry Pi by Abd Allah
207/229
194
:
51%
211%
High
Turbo
)( Heat Sink
Sticky Thermal Compound
)(
= 5
= 9
:
http://www.michaeldornisch.com/2012/06/diy-raspberry-pi-heat-sink.html
http://www.michaeldornisch.com/2012/06/diy-raspberry-pi-heat-sink.htmlhttp://www.michaeldornisch.com/2012/06/diy-raspberry-pi-heat-sink.htmlhttp://www.michaeldornisch.com/2012/06/diy-raspberry-pi-heat-sink.html -
8/10/2019 Simply Raspberry Pi by Abd Allah
208/229
195
:
BCM
)
(
: vcgencmd measure_temp
0.9:
http://elinux.org/RPiconfighttp://htpcbuild.com/htpc-software/raspberry-pi-openelec/openelec-overclocking/http://www.raspberrypi.org/archives/2008
http://elinux.org/RPiconfighttp://elinux.org/RPiconfighttp://htpcbuild.com/htpc-software/raspberry-pi-openelec/openelec-overclocking/http://htpcbuild.com/htpc-software/raspberry-pi-openelec/openelec-overclocking/http://www.raspberrypi.org/archives/2008http://www.raspberrypi.org/archives/2008http://www.raspberrypi.org/archives/2008http://htpcbuild.com/htpc-software/raspberry-pi-openelec/openelec-overclocking/http://elinux.org/RPiconfig -
8/10/2019 Simply Raspberry Pi by Abd Allah
209/229
196
:
dvanced Options
" Advanced option":
Overscan :
HD
Hostname :
Memory Split
:
RAM
52
GPU
RAM(0 GPU=0RAM=448
)
SSH :
( )
SPI :SPIGPIO
Update
:raspi-config
-
8/10/2019 Simply Raspberry Pi by Abd Allah
210/229
197
Backup
Ghost backup
Win32 Image Writer
ReadWrite
:
d:\raspberry-pi-backup.img
raspberry-pi-backup.img)( d/:
:Read raspberry-pi-
backup.img(
)
-
8/10/2019 Simply Raspberry Pi by Abd Allah
211/229
198
:
/ dev/sdb
ls /dev sudo umount sdb*
raspberry-pi.backup.img
sudo dd if=/dev/sdb of=~/raspberry-pi-backup.img bs=1M
:3810+0 records in
3810+0 records out
3995074560 bytes (4.0 GB) copied, 340.63 s, 11.7 MB