Cov txheej txheem:

Kev Ruaj Ntseg Hauv Tsev Nrog Txiv Kab ntxwv Pi: 3 Kauj Ruam (nrog Duab)
Kev Ruaj Ntseg Hauv Tsev Nrog Txiv Kab ntxwv Pi: 3 Kauj Ruam (nrog Duab)

Video: Kev Ruaj Ntseg Hauv Tsev Nrog Txiv Kab ntxwv Pi: 3 Kauj Ruam (nrog Duab)

Video: Kev Ruaj Ntseg Hauv Tsev Nrog Txiv Kab ntxwv Pi: 3 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Kev Ruaj Ntseg Hauv Tsev Nrog Txiv Kab ntxwv Pi
Kev Ruaj Ntseg Hauv Tsev Nrog Txiv Kab ntxwv Pi

Qhov tseem ceeb nws yog hais txog tib lub tswv yim zoo li hauv kuv cov lus qhia yav dhau los:

www.instructables.com/id/Home-Security-With…

Tsuas yog kev hloov pauv yog siv Orange Pi board (kuv xaiv yog PC2) thiab ib qho 4050 qib hloov pauv los tiv thaiv cov laug cam IOs.

Txhawm rau suav nrog - tus nqi pheej yig tiv thaiv kev nyab xeeb hauv tsev uas xa koj email nrog duab ntawm koj cov khoom thaum muaj ib tus neeg tuaj ntsib koj chav nyob tsis tau xav txog. Ib qho txheej txheem uas yooj yim siv riam phom thiab tshem riam phom txoj hauv kev ntau dua qhov koj tuaj yeem xav tau - hloov pauv thiab cim npe RFID. Thov txim, Kuv nyiam nws heev;-)

Koj tuaj yeem tau txais Orange Pi rau 10 $, lub koob yees duab USB tej zaum 2 $ (qhov tseeb kuv siv ob lub ntsej muag tsis meej pem!), Tus so tej zaum 30 $ tag nrho ua ke.

Txhawm rau kom paub ntau ntxiv txog yam koj xav tau - OPi pawg thawj coj, nws lub zog xa khoom, 74HC4050 qib hloov pauv, ib lossis ntau PIR lub suab ntsuas hluav taws xob, nyeem ntawv RFID, hloov pauv ib ntus, ob lub LEDs, 2x 220Ohm + 1x 10kOhm resistors, breadboard thiab cables rau txuas txhua tus ua ke, thiab USB lub koob yees duab tau kawg.

Kauj ruam 1: Kev thaiv kab

Thaiv
Thaiv

Kuv kev teeb tsa thiab qhov chaws siv 2 lub koob yees duab nrog 2 PIR sensors. Qhov kev tawm tsam rub tawm rau qhov hloov pauv no tau siv vim tias … Kuv tsis muaj sijhawm los saib los ntawm pyA20 cov tsev qiv ntawv docs, tom qab ob peb hnub kuv tau lees paub pom txoj cai hu (saib README.txt hauv cov npe uas koj yuav tau txais nrog GIT - saib cov kauj ruam tom ntej), yog li koj tuaj yeem hloov pauv cov cai thiab tshem tawm ntawm nws. Kuv siv PC2 lub rooj tsavxwm tab sis lwm cov txiv kab ntxwv Pi muaj cov IOs zoo sib xws. 4050 qib hloov pauv tau siv cov ntsuas hluav taws xob thiab RFID nyeem ntawv siv 5V tab sis OPi pawg thawj coj lees paub 3V (lossis 3.3V yog tias koj nyiam). Tseem ceeb - xaim tag nrho "hauv av" cov cim rau ib qho ntawm cov laug cam GND! Tsis txhob hnov qab txuas koj lub koob yees duab USB!:)

Kauj ruam 2: Software

Software
Software

Cov kab hauv qab no yuav xav tias koj nruab Raspbian_desktop_lxde_For_PC2_H5_V0_1.img ntawm koj daim npav SD. Tej zaum koj yuav raug qhia kom siv Armbian hloov tab sis kuv tsis tau sim nws.

1) passwd - hloov tus password ntawm tus neeg siv orangepi, uas yog txiv kab ntxwv pib.

2) Qhov Raspbian no los nrog Suav lub zos, yog li muab qhov no rau/etc/default/locale thiab rov pib dua:

LC_ALL = "en_US. UTF-8"

LANG = "en_US"

LANGUAGE = "en_US: en"

3) Kuv txuas qhov pib muab faib nrog fdisk /dev /mmcblk0, rov pib dua thiab hloov pauv 2fs /dev /mmcblk0p2. Koj yuav pom qee qhov kev qhia ntawm qhov ntawd nrog Google.

4) sudo apt-tau hloov tshiab

5) sudo apt-tau nruab tsim tsim-qhov tseem ceeb

6) sudo apt-tau nruab python-setuptools

7) sudo apt-tau nruab python-dev

8) sudo easy_install pip

9) sudo pip nruab pyserial

10) sudo pip nruab pyA20

11) sudo apt-tau nruab git

12) git clone

13) cd orangepi_PC_gpio_pyH3

14) sudo python setup.py nruab

15) tau txais cov cai los ntawm (Kuv yuav sim muab nws tso rau Github sai; Kuv muab nws tso rau hauv GNU pej xeem, xav tias dawb los faib tawm!):

github.com/boguszjelinski/rpi-alarm

Kuv txhais hais tias opi-alarm.py.

16) sudo nab hab sej opi-alarm.py

Nco ntsoov hloov IO cov npe yog tias koj siv lwm lub rooj tsav xwm lossis txuas xov. Yog tias LEDs pib ntsais muag, tom qab ntawv tej zaum yuav txuas thiab software yog OK.

17) sudo apt-tau nruab streamer

18) teeb tsa postfix ib yam li tau piav qhia ntawm no:

www.instructables.com/id/Home-Security-With…

Kauj Ruam 3: Kev Txiav Txim Kawg

Kev Txiav Txim Kawg
Kev Txiav Txim Kawg

Khiav 'sudo python opi-alarm.py'

Koj kuj tseem tuaj yeem siv nohup sudo python opi-alarm.py &

thiab tawm ntawm lub davhlau ya nyob twg.

Yog tias koj ua haujlwm program thiab tsis muaj rfid.txt cov ntaub ntawv hauv cov npe hauv zos (vim li cas thiaj yuav tsum muaj ib qho?) Tom qab ntawd koj lub kaw lus kev nyab xeeb nkag mus rau hom kev kawm - nws tos koj kom tso koj daim npav RFID rau tus nyeem ntawv. Yog tias nws nyeem ib qho ces ntsuab ntsuab nyob ntev me ntsis. Tom qab koj tau qhia txhua yam koj cim rau tus nyeem ntawv - nias lub pob! Lub 2 vib nas this liab lees paub kev kawm tiav - rfid.txt tau tsim, nws yuav tsum muaj 10 tus cim cim.

Tam sim no txuas cov cim npe RFID rau koj cov yuam sij. Tam sim no lub kaw lus tos kom ua haujlwm (ua tub rog).

Koj tuaj yeem nias qhov hloov pauv ib zaug ntxiv thiab nkag mus rau thaj tsam ntawm PIR sensor tom qab 10 vib nas this. Koj yuav tsum tau txais daim duab zoo rau koj lub npov email;-)

Pom thawj Raspberry Pi qhia rau qhov sib txawv LED teeb liab (xav tau hloov kho tshiab, hom kev kawm yog qhov tshiab).

Kev qhia tom ntej - siv GSM module, tej zaum MMS hloov chaw Postfix.

Hloov tshiab 27.05.2018

Streamer nqus, nws qee zaum tau vwm, tej zaum tsuas yog nrog kuv lub koob yees duab tsis zoo. Tom qab ib lub lim tiam nrog CV2 - nws ua haujlwm zoo li ntxim nyiam. Txhawm rau siv tus lej Kuv nyuam qhuav xa mus rau GitHub:

apt-tau nruab python-opencv

apt-tau nruab imagemagick

Tej zaum ib qho ntxiv - ib qho ntawm kuv lub koob yees duab tau siv los ua kom tsis zoo li lub cuab yeej, yog li txhua lub sijhawm kuv yuav tau txais cov duab kuv tau ua qhov no ua ntej (rov ua haujlwm ntawm cov qauv ntsiav; tej zaum yuav ua tau yooj yim dua):

os.system ('modprobe -r vfe_v4l2 && pw 1 && modprobe vfe_v4l2')

Pom zoo: