Cov txheej txheem:

RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi: 11 Kauj Ruam
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi: 11 Kauj Ruam

Video: RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi: 11 Kauj Ruam

Video: RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi: 11 Kauj Ruam
Video: Рау сиаб хвв ной пож ниам деев хлуас 13.03.2018 2024, Hlis ntuj nqeg
Anonim
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi
RFID Nkag Mus Saib Xyuas Nrog Arduino Yun thiab Raspberry Pi

Txais tos rau Kuv Cov Lus Qhia! Koj puas tau tshawb fawb online rau RFID Kev Tswj Xyuas Kev Ruaj Ntseg uas tuaj yeem muaj ntau tus neeg siv yam tsis siv tus tswv tseem ceeb los teeb tsa nws? Lub kaw lus uas tuaj yeem nkag mus nkag nrog cov neeg lub npe? Ib qhov system uas koj tuaj yeem yooj yim ntxiv lossis tshem tawm qee tus neeg nkag tau yooj yim? Saib tsis muaj ntxiv! Cov kab ke no muaj qhov yooj yim siv Cov Duab Sib Txuas Sib Txuas los ntawm lub vev xaib. Qhov no yog qhia paub yuav taug koj txhua kauj ruam ntawm yuav tsim thiab teeb tsa cov txheej txheem no li cas. Kuv tau tshawb nrhiav cov lus qhia yuav ua li cas thaum kuv xav tsim ib qho. Kuv muab cov ntaub ntawv los ntawm kev qhia sib txawv, kev sib tham, thiab cov vis dis aus kom txog thaum kuv tsim kuv tus kheej. Qhov ze kuv tuaj yeem pom qhov kuv xav tau yog cov lus qhia no: https://www.instructables.com/id/Control-Access-of…, tab sis nws tsis yog txhua yam kuv xav ua. Kuv tau siv cov hlua yooj yim los ntawm cov lus qhia tab sis txhim kho nws.

Kauj Ruam 1: Nws Ua Haujlwm Li Cas

Cov kab ke no siv ob qho tib si thiab Arduino thiab Raspberry Pi. Arduino Kuv xaiv yog YUN rau nws lub peev xwm kom muaj wifi thiab ua nws tus kheej network. Kuv xaiv Raspberry Pi Zero vim nws daim ntawv me thiab tau tsim hauv Wifi thiab muaj tus nqi zoo.

Thaum Arduino pib nws tshaj tawm nws lub wifi thiab pib txhua qhov kev sib txuas. Nws nyeem Lub Sijhawm Tiag (RTC) thiab teeb tsa nws mus rau lub sijhawm. Lub vijtsam LCD qhia cov lus txais tos. Raspberry Pi txuas rau wifi network YUN tshaj tawm. Thaum koj luam theej duab daim npav RFID, arduino yuav nyeem txhua byte thiab tsim cov hlua ntawm tus lej hexadecimal, nws pib sau cov nab nab los sib piv cov hlua ntawd rau hauv ib daim teb hauv MySQL cov lus ntawm Raspberry Pi. Yog tias nws sib xws nws ua rau pom lub ntsej muag ntsuab ntsuab, nthuav qhia Access Granted ntawm lub LCD, xa lub teeb liab kom qhib lub qhov rooj tawm tsam kom qhib lub qhov rooj, pib tsab ntawv nab nab los nkag rau RFID code, hnub tim thiab sijhawm, thiab tau txais Kev nkag mus rau lwm MySQL lub rooj, teeb ib lub LED xiav, qhia Logging ntawm lub vijtsam LCD, tom qab ntawd qhia cov lus txais tos dua. Thaum tus lej RFID tsis sib xws, LED yuav nyem liab, lub vijtsam LCD yuav tso saib Tsis pom, nyem lub xiav LED, Sau cov ntaub ntawv, thiab tso tawm cov lus txais tos dua.

Lub vev xaib yog li cas koj ntxiv lossis tshem tawm cov neeg siv, hloov kho lawv cov ntaub ntawv, thiab saib cov ntaub ntawv nkag mus. PHP yuav sau rau cov neeg siv lub npe nrog cov lej sib txuam RFID hauv kev nkag mus nkag. Koj tseem tuaj yeem xa tawm ob qho Nkag Mus Nkag thiab Cov Neeg Siv Database rau CSV cov ntaub ntawv pom hauv daim ntawv nthuav tawm. Kev Nkag Mus Nkag yuav tshem tawm txhua yam uas muaj hnub nyoog tshaj 60 hnub.

Kauj Ruam 2: Qhov Chaw

Qhov
Qhov
Qhov
Qhov

Arduino Yus

Raspberry Pi Zero W.

Micro SD Card - 2 GB rau YUN thiab 32GB rau Raspberry Pi

Innovations ID-20 RFID nyeem ntawv

Breakout Board rau RFID nyeem ntawv

16X2 Cim LCD Screen

Hnab ev ntawv Serial rau LCD Screen

RGB LED

DS3231 RTC - Tsuas xav tau yog tias qhov no yuav tsis txuas rau internet

Buzzer

Jumper Hlau

Headers thiab pins

125KHz RFID Daim Npav

12V Access Control Fais Fab Khoom

DC Relay uas tuaj yeem tswj tau nrog 5V DC thiab dhau 12V DC - Kuv tau siv lub xeev ruaj khov

12V tsheb ntsaws cigarrette lub teeb ntsais style

12V USB tsheb them lub tsheb nrog 2 USB Ports nrog tsawg kawg 2 amps zog

12V Hluav Taws Xob Qhov Rooj Tawm Tsam

Cov ntaub ntawv yas - loj txaus rau tsev nyeem ntawv thiab LCD Screen

10 "X 10" X 4 "lub thawv hluav taws xob rau lub tsev cov khoom siv.

2 modular ethernet plugs (poj niam) nrog lub peev xwm ntaus nrig

ib ethernet cable

ib qho qauv me me PCB Board (cov uas muaj qhov thiab cov tooj liab ncig ib puag ncig los ua koj tus kheej PCB.)

Qee qhov 16 gauge xaim

2 micro USB cables

Ntev ntawm 2 lub teeb xaim hlua (ntev txaus los ntawm qhov rooj tawm tsam mus rau Lub Thawv Loj)

Kauj Ruam 3: Sib sau Cov Nyeem Ntawv lub thawv thiab cov khoom siv

Sib sau Nyeem Ntawv Box thiab Cheeb Tsam
Sib sau Nyeem Ntawv Box thiab Cheeb Tsam
Sib sau Nyeem Ntawv Box thiab Cheeb Tsam
Sib sau Nyeem Ntawv Box thiab Cheeb Tsam

Peb yuav xub npaj tus nyeem ntawv. Solder 90 degree tus pin headers rau RFID Breakout board, Tom qab ntawd muab cov laug cam tawg mus rau RFID nyeem ntawv thiab tso ib sab.

Peb yuav npaj lub vijtsam LCD tom ntej no los ntawm kev siv cov koob ntawm lub hnab ntim rau hauv lub vijtsam LCD PCB. Thaum tag nrho cov pins tau muab tso rau ntawm qhov chaw, txiav cov pins zoo tshaj plaws mus rau qhov siab nrog kab pheeb ces kaum txiav. Muab lub vijtsam LCD tso rau sab.

Txiav ib daim square ntawm PCB kom nws muaj 2 kab ntawm qhov los ntawm 6. Siv 2 6 tus pin headers thiab cov laug rau PCB board. Txuas cov kab laug sab txuas mus rau txoj kab ntev kom tsim 2 kab laug sab tab sis khaws 2 kab sib cais. Qhov no yuav yog peb qhov kev sib txuas rau txhua 5 volt thiab hauv av xav tau hauv lub thawv nyeem ntawv.

RGB LED yuav muaj 4 tus coj, yog li txiav lwm daim PCB board nrog 4 qhov los ntawm 2 qhov. Solder 4 coj mus rau lub rooj tsavxwm thiab khoov lub LED 90 degees kom nyob hauv kab nrog lub rooj tsavxwm. Solder 4 tus pin header nyob rau sab seem ntawm PCB thiab txuas txhua tus pin rau cov hlau lead nrog cov laug ua 4 kab me me. Qhov no yuav siv tes khov kho thiab tej zaum ob peb sim ua kom 4 kab tsis txhob kov ib leeg.

Siv lub thawv yas thiab laum lub qhov nyob rau sab nraub qaum kom txaus rau lub ethernet cable kom haum rau nws, Tom qab ntawd txiav lub xwmfab ntawm lub hauv ntej rau lub vijtsam LCD, thiab lub qhov me me tsuas yog me dua lub LED thiab thawb lub LED kom zoo rau hauv..

Nqa cov xov hluav taws xob txuas thiab txuas cov hauv qab no, Sau cov xim txhua qhov khoom tau xuas nrig rau ntawm Ethernet Modular Jack, Cov xov hlau jumper yuav ntaus zoo nyob tom qab ntawm cov no.

1 tus pin ntawm GND Kev Sib Txuas --- Ethernet xuas nrig (nco ntsoov xim twg)

1 tus pin ntawm 5V Kev Sib Txuas ------ Ethernet punch down (nco ntsoov xim twg)

RFID nyeem ntawv pin tawm:

PIN 1 - GND Kev Sib Txuas

PIN 2 - 5V Kev Sib Txuas

PIN 7 - GND Kev Sib Txuas

PIN 9 Ethernet punch down (nco xim twg) ----- Thaum kawg rau Arduino PIN 10

PIN 10 - BUZZER GND Kev Sib Txuas

PIN 11 - 5V Kev Sib Txuas

Coj Pin tawm

Liab ---- Ethernet punch down (nco ntsoov xim twg) ------ Thaum kawg rau Arduino Pin 9

Ntsuab-Ethernet punch down (nco xim twg) ------ Thaum kawg rau Arduino Pin 8

Xiav ---- Ethernet punch Down (nco xim twg) ------ Thaum kawg rau Arduino Pin 7

GND ---- GND Kev Sib Txuas

LCD Screen Pin Tawm:

RX ------- Ethernet punch down (nco xim twg) ----- Thaum kawg rau Arduino Pin 11

5V ------- 5V Kev Sib Txuas

GND ----- GND Kev Sib Txuas

Lub suab nrov txuas rau GND Kev Sib Txuas (-) thiab Pin 10 ntawm RFID Breakout (+)

Tom qab qhov no, yuav muaj 1 qhov tsis siv xuas nrig ntaus. Qhov no tsuas yog xav tau 7 ntawm 8 xov ntawm Ethernet cable.

Xaub lub ethernet cable los ntawm lub nraub qaum tsim thiab ntsaws rau hauv lub qhov (socket). Siv ob daim kab xev raws ntug ntawm lub vijtsam LCD thiab nias rau hauv lub hauv ntej plaub fab txiav tawm lub thawv nyeem ntawv npaj cov khoom hauv lub thawv thiab kaw nws.

Lub thawv nyeem ntawv tam sim no tau teeb tsa thiab npaj rau kev teeb tsa.

Kauj Ruam 4: Sib Sau Lub Hauv Paus Loj

Sib sau Lub Thawv Loj
Sib sau Lub Thawv Loj

Txiav ib qho me me ntawm cov plywood uas tuaj yeem haum rau hauv 10 X 10 X 4 Lub thawv loj thiab khawm nws mus rau sab hauv lub thawv los ntawm kev ntsia hlau ntsia hauv qab ntawm lub txee rau hauv plywood. Cov plywood yuav yog kev teeb tsa rau peb cov khoom siv.

Mount lub 12v fais fab mov, Arduino Yun Case, Raspberry Pi Case, 12V Socket, thiab txuas mus rau plywood. Txiav qhov kawg ntawm lub khoos phis tawj fais fab qaum thiab hle 3 xov hlau rov qab. Txuas cov xaim dub thiab dawb mus rau 120V hauv ntawm 12v Lub Hwj Huam Fais Fab, thiab ntsuab ncaj qha mus rau rooj plaub hlau. Khiav tawm ib qho ntawm lub Qhov hauv Lub Hauv Paus Loj kom khiav lub hwj huam qaum hla.

Lub Qhov Hluav Taws Xob 12v yuav muaj 2 lub xov hlau tawm los ntawm nws, liab thiab dub, hle qhov kawg. Liab yuav mus rau +12v lub davhlau ya nyob twg ntawm lub zog hluav taws xob, dub yuav mus rau COM davhlau ya nyob twg ntawm lub zog xa khoom. Txiav qhov ntev ntawm 16 lub ntsuas cua xaim kom mus txog qhov xa tawm los ntawm lub zog xa khoom thiab sawb ob qho kawg. Ntawm 12V sab ntawm qhov txuas txuas cov hlau no mus rau lub davhlau ya nyob twg tsis zoo thiab tom qab ntawd mus rau GND lub davhlau ya nyob twg ntawm lub zog xa khoom. Txiav lwm qhov ntev ntawm 16 lub ntsuas cua xaim mus los ntawm 12v sab ntawm kev xa tawm ntawm lub davhlau ya nyob twg zoo thiab mus rau PUSH lub davhlau ya nyob twg ntawm lub zog hluav taws xob. Xaim lub teeb lub teeb, ib qho rau NO lub davhlau ya nyob twg ntawm lub zog hluav taws xob (Tsis zoo ntawm lub qhov rooj tawm tsam) thiab lwm qhov mus rau Lub davhlau ya nyob twg zoo ntawm qhov txuas (koj yuav tam sim no muaj 2 xov los ntawm lub davhlau ya nyob twg) (mus rau Qhov Zoo ntawm lub qhov rooj tawm tsam.) Koj tuaj yeem siv txoj hlua no hla tib lub khob qhov rooj raws li lub zog fais fab.

Tam sim no siv 2 jumper xov hlau thiab txuas los ntawm 5V sab ntawm kev xa mus rau Arduino, Zoo rau Pin 12, Tsis zoo rau GND.

RTC muaj 4 Pins, lub zog, GND, SDA, SCL. Txuas 4 jumper xov hlau rau cov no. Lub zog yuav ntsaws rau hauv 3.3V tus pin ntawm Arduino, GND rau GND tus pin ntawm Arduino, SDA rau SDA tus pin ntawm Arduino, thiab SCL rau SCL tus pin ntawm Arduino.

Tam sim no siv 7 jumper xov hlau, thiab ntaus lawv rau sab nraum qab ntawm lwm lub qhov (socket), tib xim uas koj siv ua ntej.

Txuas lub 5V tus pin ntawm Arduino rau xim uas phim rau 5V Kev Sib Txuas, thiab ua tib yam nrog GND rau GND thiab cov xov hlau uas tseem tshuav. Pins 7, 8, thiab 9 yog rau LEDs, Pin 10 rau RFID nyeem ntawv, thiab Pin 11 rau RX ntawm lub vijtsam LCD. Koj tuaj yeem khiav lub ethernet cable los ntawm lub thawv nyeem ntawv los ntawm kev ntaus hauv lub thawv loj thiab ntsaws nws rau hauv lub qhov (socket) uas koj nyuam qhuav ntaus. Txuas lub USB Tsheb them, thiab khiav Micro USB cables los ntawm qhov ntawd mus rau Raspberry Pi thiab Arduino. Tam sim no Lub Thawv Loj tau sib sau ua ke. thiab tag nrho cov kho vajtse tau ua tiav.

Kauj Ruam 5: Pib teeb tsa ntawm Arduino YUN

Ua ntej tso lub YUN, ntsaws rau hauv 2GB MicroSD daim npav.

Teeb YUN siv cov lus qhia ntawm Arduino Site txhawm rau teeb tsa YUN rau koj lub network hauv zej zog thiab ntxiv tus password. Ua raws cov lus qhia txhawm rau nce daim npav SD.

Siv PUTTY nkag mus rau YUN nrog tus IP chaw nyob, ID yuav hauv paus, thiab PW.

Peb yuav xav tau teeb tsa MySQL thiab Python Connector txhawm rau nkag tau MySQL ntawm Raspberry Pi yam:

opkg nruab mysql-server opkg

nruab python-mysql

Tam sim no teeb tsa Arduino Yun los ua lub wireless nkag mus nrog lub neej ntawd IP chaw nyob (192.168.240.1) uas yog lub neej ntawd.

Kauj Ruam 6: Teeb Raspberry Pi

Ua ntej koj yuav tsum hlawv cov ntawv luam tawm tshiab ntawm Rasbian mus rau 32GB Micro SD Card. Muaj ntau ntau cov lus qhia yuav ua li cas yog li kuv yuav tsis nkag mus rau qhov ntawd.

Coj Raspberry Pi thiab sib txuas cov keyboard, Saib, thiab nas rau nws. Ntxig rau 32GB SD daim npav thiab txhawb nws.

Nkag mus nrog lub npe siv pi thiab pw raspberry, koj tuaj yeem hloov qhov ntawd tom qab. Thaum lub vijtsam thauj khoom nyem rau ntawm lub cim wifi thiab txuas nws mus rau koj lub tsev wifi. Sau tus IP Chaw Nyob. Qhib lub qhov rai console (lub cim dub square nrog tus cursor) thiab ntaus cov lus txib no txhawm rau hloov kho pob npe thiab hloov kho software uas twb muaj lawm ntawm Pi.

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

sudo raspi-teeb tsa

Ntawm no koj yuav xav nthuav cov ntaub ntawv system, pab kom SSH, thiab kaw lub desktop thaum pib. Koj tseem tuaj yeem hloov koj tus password ntawm no tam sim no ib yam nkaus. rov pib dua, nkag mus.

Tam sim no peb yuav teeb tsa lub desktop deb (qhov no yog vim li cas peb thiaj xav tau SSH qhib). Hauv kab hais kom ua hom

sudo apt-tau nruab xrdp

Tam sim no koj tuaj yeem qhib lub desktop deb ntawm koj lub khoos phis tawj Windows thiab ntaus hauv Raspberry Pi IP Chaw Nyob thiab lub npe siv thiab tus password. Khaws cov keyboard, saib xyuas, thiab teeb tsa nas vim tias peb yuav xav siv nws tom qab.

Peb yuav tsum tau ntxiv khau raj ncua rau Raspberry Pi yog li tom qab thaum peb ua zog Raspberry Pi thiab Arduino YUN ua ke, nws yuav tso cai rau YUN wifi pib ua ntej Raspberry Pi. Los ntawm hom console:

sudo nano /boot /config.txt

Scroll rau hauv qab thiab ntxiv kab no:

boot_delay = 75

Nias CNTRL X, Y, Sau kom txuag. Qhov no yuav ntxiv 75 thib ob khau raj qeeb. Reboot Raspberry Pi thiab txheeb xyuas.

Thaum peb nyob ntawm koj lub khoos phis tawj tam sim no yog lub sijhawm zoo rau nruab PUTTY thiab WinSCP rau koj lub khoos phis tawj. Peb yuav xav tau nws txuas ntxiv mus. PUTTY yog lub qhov rai nyob deb ntawm Raspberry Pi thiab Arduino YUN tom qab, thiab WinSCP yog FTP ruaj ntseg los hloov cov ntaub ntawv los ntawm koj lub computer mus rau Raspberry Pi los ntawm koj lub computer.

Kauj Ruam 7: Teeb MySQL, PHP, thiab Python ntawm Raspberry Pi

Los ntawm koj lub khoos phis tawj qhib PUTTY thiab ntaus tus IP chaw nyob ntawm koj tus Raspberry Pi thiab nkag mus. Peb yuav nruab MySQL, Ntaus cov lus txib:

sudo apt-tau nruab mysql-server

Tam sim no qhib MySQL Hom:

sudo mysql -u hauv paus

Tam sim no peb nyob hauv peb yuav tsum teeb tsa MySQL los ua haujlwm hauv peb daim ntawv thov, txhua qhov chaw kuv ntaus ib lo lus ib puag ncig nrog & qhov ntawd yog qhov uas koj yuav nkag koj cov ntaub ntawv, Khaws tag nrho 'hauv cov lus txib thiab nco ntsoov siv; qhov kawg ntawm qhov hais kom ua. Hom:

CREATE USER '& neeg siv &'@'localhost' IDENTIFIED BY '& password &';

ZOO TSHAJ PLAWS YOOJ YIM RAU *. * TO '& neeg siv &'@'localhost' NROG QHOV ZOO TSHAJ PLAWS;

txiav luam yeeb;

koj tsim tus neeg siv lub npe thiab tus lej zais nrog txhua qhov kev tso cai hauv MySQL Tam sim no nkag mus nrog koj daim ntawv pov thawj tshiab.

mysql -u & neeg siv & -p

Tam sim no nws yuav nug koj tus password.

& tus password &

Tam sim no koj nyob nrog koj tus username thiab password. Tam sim no peb yuav tsim cov ntaub ntawv thiab cov lus:

Tsim DATABASE arduino;

ZOO TSHAJ PLAWS YOOJ YIM RAU ARduino.* TO '& cov neeg siv &' IDENTIFIED BY '& password &' NROG QHOV ZOO TSHAJ PLAWS;

Siv tib lub npe siv thiab tus lej koj tau tsim rau MySQL nkag rau hauv. Hauv qab no peb yuav tsim ib lub rooj hu ua usersrfid nyob hauv qab database arduino.

Siv arduino;

CREATE TABLE usersrfid (id INT (255) NOT NULL AUTO_INCREMENT PRIMARY KEY)

Peb tsuas yog xav tau los tsim nws ntxiv rau nws tom qab. id yog thawj kab ntawm lub rooj thiab yuav yog tus lej uas pib nce ntxiv thiab txhua lub rooj xav tau tus lej tseem ceeb, yog li peb teeb kab ntawv no yog tus yuam sij. Tam sim no tawm MySQL los ntawm kev ntaus ntawv:

txiav luam yeeb;

Tam sim no peb yuav tsum teeb tsa lub vev xaib xaib, PHP, Python, thiab txhua qhov txuas rau MySQL Ntaus cov lus txib hauv qab no:

sudo apt-tau nruab mysql-client

sudo apt-tau nruab python-mysqldb

sudo apt-tau nruab apache2 php5 libapache2-mod-php5

sudo apt-tau nruab php5-mysqlnd

Tom ntej no peb yuav nruab PHPMyAdmin. qhov no yuav siv los tsim koj cov lus MySQL yam tsis siv kab hais kom ua.sudo apt-tau nruab phpmyadmin

ob peb txoj kev xaiv yuav tshwm sim, xaiv apache2, yog rau dbcommon, thiab sau tus password rau phpmyadmin.

Tam sim no peb yuav tsum hloov kho apache2.conf siv PHPMyAdmin los ua hom no:

sudo nano /etc/apache2/apache2.conf

Scroll rau hauv qab thiab ntaus:

Xws li /etc/phpmyadmin/apache.conf

Tom qab ntawd nias CNTRL X, Y, tom qab ntawd nkag mus rau txuag. Thaum tau txais kev cawmdim peb yuav xav rov pib dua apache2 yam:

sudo /etc/init.d/apache2 rov pib dua

Tam sim no qhib lub vev xaib hauv Windows thiab ntaus hauv qhov chaw nyob IP tus IP ntawm raspberry Pi ua raws nrog /phpmyadmin thiab nkag mus rau hauv PHPMyAdmin nrog koj MySQL nkag mus thiab tus lej nkag.

Nov yog qhov uas peb yuav kho thiab ntxiv rau koj cov databse.

Hauv kab sab laug nthuav dav ntawm arduino thiab tom qab ntawd nyem cov neeg siv rfid koj tsim ua ntej. Nyem ntxig rau thiab ntxiv koj kab ntawv:

thawj, nruab nrab, zaum kawg, txoj kev, apt, nroog, xeev, zip, hphone, xov tooj, txoj haujlwm, rfid, rev_rfid, nkag tau 247, duab

Lawv txhua tus yog varchar 500

Tom qab ntawd tsim 2 lub rooj ntxiv los ntawm txhaj tshiab hauv kab sab laug hauv qab arduino. Hu rau thawj lub rooj usersrfid247 thiab ntxig kab:

id, thawj, zaum kawg, txoj haujlwm, rfid, duab.

tus lej yuav yog INT 255 txheeb xyuas AI kom pib nce ntxiv thiab nyem rau ntawm tus yuam sij los ua tus yuam sij thawj, tus so yuav yog varchar 500

Lub rooj thib ob, hu rau ControlUsers nrog kab:

id, rfid, rfid_st, hnub tim, thawj, kawg.

Ib zaug ntxiv tus lej yuav yog INT 255 pib qhov pib, tus yuam sij tseem ceeb thiab tus so yog varchar 500

Tam sim no txhua MySQL cov ntxhuav tau tsim, cia lawv tsis muaj dab tsi rau tam sim no

Cov neeg siv rooj siv rfid yog lub rooj tseem ceeb uas txhua tus neeg siv yuav raug ntxiv nrog lawv cov ntaub ntawv thiab RFID Code. Cov neeg siv cov lusrfid247 yog qhov uas cov neeg siv nrog 24/7 kev nkag mus yuav raug muab tso rau. thiab ControlUsers yog lub rooj uas nkag mus nkag tau. Cov teb no txhua tus yuav muaj neeg nyob tom qab.

Tam sim no tias cov ntxhuav tau tsim peb yuav teeb tsa Raspberry Pi kom tuaj yeem rub cov neeg siv cov duab, qhib PUTTY thiab ntaus tus IP Chaw Nyob thiab nkag mus rau yog tias koj tsis tau ua dua. Teem cov ntawv tso cai tso cai kho. Ntaus hauv qhov hais kom ua:

sudo chmod a+w/var/www/html

Tam sim no siv lub desktop deb thiab mus rau Raspberry Pi desktop. Mus rau cov ntawv tshawb fawb thiab mus rau phau ntawv teev npe/var/www/html. Rho tawm cov ntaub ntawv index.html los ntawm sab hauv lub nplaub tshev thiab tsim daim nplaub tshev tshiab hu ua duab. Txoj cai nyem rau ntawm daim nplaub tshev tshiab thiab mus rau kev tso cai, tso cai rau leej twg tso cai rau daim nplaub tshev.

Kauj Ruam 8: Txuas Raspberry Pi mus rau YUNs Network

Los ntawm koj lub khoos phis tawj chaw taws teeb duab mus rau hauv Raspberry Pi

Hloov pauv wifi network los txuas rau Arduino's wifi. Koj yuav plam koj qhov kev sib txuas desktop deb.

Nkag mus rau hauv Raspberry pi los ntawm cov keyboard, nas, thiab saib xyuas peb sab laug txuas. Ntawm kab hais kom ua hom startx mus rau GUI thiab saib seb IP chaw nyob li cas Arduino tau muab rau Raspberry Pi thiab sau nws.

Rov qab mus rau koj lub computer thiab txuas nws mus rau Arduino wifi. Tam sim no koj tuaj yeem siv lub desktop deb los nkag rau Raspberry Pi nrog tus IP tshiab.

Peb yuav tsum teeb tsa Arduino wifi txuas mus rau qhov tseem ceeb dua ntawm Raspberry Pi. Nkag mus rau hauv Raspberry Pi nrog Putty siv tus IP tshiab. Hom:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

hauv qab lub network tau teev tseg rau arduino, ntxiv lwm kab hauv kab ntawv thiab ntaus:

qhov tseem ceeb = 1

Txhua qhov txuas txuas tau txiav txim siab 0 thiab tsis tas yuav muaj kab ntxiv thaum nws yog 0. Kev sib txuas nrog tus lej siab tshaj yog qhov muaj feem thib.

Txuag nrog CNTRL X, Y thiab nkag mus rau txuag, thiab rov pib dua Raspberry Pi.

Nkag mus rau hauv Raspberry nrog PUTTY siv IP Chaw Nyob uas tau muab los ntawm Arduino.

Peb tam sim no teeb tsa MySQL kom nkag tau los ntawm YUN nyob deb, los ntawm lub neej ntawd MySQL yuav tsis lees paub txhua qhov chaw nkag. Txhawm rau ua qhov no, ntaus:

sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf

Txav mus rau: khi *ip chaw nyob *, muab tus cursor ntawm qhov pib ntawm kab ntawd thiab nias kuv (txhawm rau kho) thiab muab tus # nyob ntawd. Nias ESC kom tsis txhob kho thiab nqes mus rau hauv qab. Txuag thiab tawm los ntawm kev ntaus ntawv: wq

Pib dua MySQL Services:

sudo kev pabcuam mysql rov pib dua

Tam sim no peb xav tau MySQL txhawm rau txheeb xyuas YUNs IP Chaw Nyob. Nkag mus rau hauv mysql zoo li ua ntej los ntawm kev ntaus:

mysql -u & neeg siv & -p

ntawm qhov hais kom sai ntaus koj tus password

Hom:

ZOO TSHAJ PLAWS YOOJ YIM RAU *. * TO '& user &'@'& YUNip &' IDENTIFIED BY '& password &' WITH GRANT OPTION;

SELECT * LOS NTAWM information_schema.user_privileges QHOV KEV PAB LI CAS LIKE "'& user &'%";

Koj yuav tsum pom tus username@ipaddress teev nyob ntawd.

FLUSH PRIVILEGES:

Tawm;

Kauj ruam 9: Program Arduino YUN

Rub tawm Python Scripts los ntawm nplooj ntawv no mus rau koj lub computer. Kho cov nab hab sej ntawv siv Notepad ++. Nrhiav cov ntaub ntawv xov xwm ntawm sab saum toj thiab kho lawv kom phim koj cov ntaub ntawv pov thawj cov ntaub ntawv pov thawj. Tus IP Chaw Nyob yog Raspberry Pi IP Chaw Nyob tshiab, thiab nkag mus paub cov ntaub ntawv ntawm koj li MySQL.

Txuas koj lub khoos phis tawj mus rau Arduino network yog tias nws tseem tsis yog thiab ntaus hauv Arduino IP chaw nyob rau hauv lub vev xaib, nws yuav tsum yog 192.168.240.1. Nkag mus rau hauv YUN thiab mus rau kev teeb tsa qib siab uas yuav coj koj mus rau Luci GUI. Mus rau DHCP ntu hauv qab network thiab teeb Raspberry Pi ua tus IP zoo li qub. Qhov no yuav qhia rau Arduino ib txwm muab IP Chaw Nyob rau Raspberry Pi yog li nws yuav tsis hloov pauv.

Qhib WinSCP ntawm koj lub khoos phis tawj thiab xa 3 qhov kho cov nab npawb nab npawb rau/mnt/sda1/arduino/nab hab sej ntawm Arduino.

Lov tes taw NTP Server ntawm YUN yog li RTC yuav ua haujlwm raug. Qhib Putty ntawm koj lub khoos phis tawj thiab txuas rau YUNs IP Address thiab nkag mus. Hauv Command hom:

/etc/init.d/sysntpd nres/etc/init.d/sysntpd lov tes taw

Yog tias koj tseem tsis tau rub lub tsev qiv ntawv DS3132 los ntawm https://www.rinkydinkelectronics.com/library.php?id…, Koj yuav tsum rov txuas koj lub Computer wifi rau koj lub network hauv zej zog kom ua li ntawd. Tom qab txuas mus rau YUN.

Qhib Arduino IDE ntawm koj lub computer thiab teeb nws rau YUN thiab chaw nres nkoj mus rau IP Chaw Nyob. Mus rau cov ntaub ntawv> piv txwv> DS3231> DS3231_Serial_easy thiab teeb tsa lub sijhawm ntawm RTC, nco ntsoov hnub yog d/m/xyoo thiab rub tawm

upload qhov kawg Arduino Sketch rau Arduino siv Arduino IDE.

Kauj ruam 10: Raspberry Pi Webserver

Tam sim no rub cov ntawv php, html, thiab css los ntawm nplooj ntawv no mus rau koj lub computer. Kho cov hauv qab no nrog Notepad ++, dbinfo.php, thiab auth.php. dbinfo.php yuav xav tau cov ntaub ntawv xov xwm kho rau tus IP chaw nyob, tus neeg siv lub npe, tus lej zais thiab lwm yam ntawm MySQL. Lub auth.php yuav tsum tau kho rau lub vev xaib nkag mus thiab tus password uas koj xav tau los tsim. Nws yog cov ntawv me me thiab koj tuaj yeem yooj yim pom nws tsuas yog hla dhau.

Nco ntsoov tias koj lub khoos phis tawj tseem txuas nrog Arduino Wifi thiab siv WinSCP thiab muab cov ntaub ntawv php, html, thiab css los ntawm koj lub computer mus rau Raspberry Pi hauv cov npe/var/www/html.

Qhib koj lub vev xaib ntawm koj lub khoos phis tawj thiab ntaus IP Address ntawm Raspberry Pi thiab lub vijtsam nkag mus hauv lub vev xaib yuav tshwm. Nkag mus nrog UID thiab tus password koj tau tsim thaum koj kho cov ntaub ntawv auth.php. Txhua yam yuav tsis muaj dab tsi. Mus ntxiv tus tswv cuab thiab pib sau rau hauv koj cov neeg siv.

Kauj ruam 11: Txaus siab rau

Txuas koj lub khoos phis tawj/xov tooj/ntsiav tshuaj mus rau arduino wifi, qhib browser, ntaus tus IP zoo li qub ntawm Raspberry Pi, nkag mus rau nplooj ntawv web thiab koj tuaj yeem pib ntxiv cov tswv cuab pov thawj.

Txhawm rau nrhiav RFID tus lej ntawm daim npav, luam theej duab thiab txheeb xyuas qhov nkag mus. Luam cov cai thiab muab nws tso rau hauv cov tswv cuab tshiab RFID.

Kev nkag mus ib txwm yog teem rau hnub Tuesday thaum 16:00 txog 23:00 nkaus xwb. Txhawm rau hloov qhov kev hloov kho kab lus nab nab sib piv.py, muaj kab nyob rau ntawd YOG nrog Hnub Hnub ntawm Lub Limtiam thiab sijhawm nrog ntau dua thiab tsawg dua cov paib. Hloov Hnub thiab sijhawm koj xav kom txhua tus neeg siv tau nkag mus. 24/7 kev nkag mus yuav raug lees txais txhua lub sijhawm.

Thaum ib tus tswv cuab tau ntxiv scan daim npav thiab pom lub qhov rooj tawm tsam qhib. Rov qab mus rau lub cav thiab pom nws ntxiv.

Txaus siab rau

Pom zoo: