Cov txheej txheem:

UCL -IIOT - Cov Ntaub Ntawv Teev Npe ntawm Raspberry Pi: 6 Cov Kauj Ruam
UCL -IIOT - Cov Ntaub Ntawv Teev Npe ntawm Raspberry Pi: 6 Cov Kauj Ruam
Anonim
UCL -IIOT - Cov Ntaub Ntawv Loggings ntawm Raspberry Pi
UCL -IIOT - Cov Ntaub Ntawv Loggings ntawm Raspberry Pi

Cov lus qhia no tau tsim los ntawm Obayda Haj Hamoud thiab Sidse Henriksen rau lub tsev kawm ntawv qhov haujlwm.

Lub tswv yim tseem ceeb yog khaws cov ntaub ntawv los ntawm lub teeb pom kev zoo, txiav cov ntaub ntawv mus rau lub hauv paus database tsis siv neeg ntawm raspberry pi thiab saib xyuas cov ntaub ntawv los ntawm lub dashboard tsim siv Node liab.

Kauj Ruam 1: Tsim Circuit Court

Tsim lub Circuit
Tsim lub Circuit

Yuav tsum muaj

Kho vajtse:

● NodeMcu

● Raspberry pib

Oc Photocell lub teeb pom kev zoo

● Coj

● Tiv thaiv

● Jumber cables

Software:

Ode Node Liab

● Mosquitto neeg rau zaub mov

● Mysql cov ntaub ntawv puag (phpmyadmin)

● Arduino IDE

Kauj ruam 2: Arduino Code

Cov cai hauv qab no yog siv los hu xov tooj rau tus neeg muag khoom mositto tau teeb tsa ntawm raspberry pi thiab tau txais cov ntaub ntawv tshaj tawm.

'Cov ntaub ntawv kawg arduino tau tso rau hauv qhov kawg ntawm qhov kev tsim tawm no'

tsis muaj dab tsi hu rov qab (Txoj hlua ntsiab lus, byte* lus, tsis tau kos npe ntev) {

Serial.print ("Cov lus tuaj txog ntawm lub ncauj lus:"); Serial.print (ncauj lus); Serial.print (". Xov:"); Txoj hlua lusLight;

Kauj Ruam 3: Txhim Kho Software ntawm Raspberry Pi

1. Txhim Kho MQTT Broker ntawm Raspberry pi.

- Qhib Terminal thiab ntxig cov lus txib hauv qab no kab ntawm kab:

wget

sudo apt-key ntxiv mosquitto-repo.gpg.key

cd /etc/apt/sources.list.d/

- Rau jessie version

sudo wget

nyob rau hauv rooj plaub koj muaj wheezy version ntawm Raspberry pi, ntxig cov lus txib hauv qab no hloov

sudo wget

- Hloov kho cov npe khoom

apt-tau hloov tshiab

- txhim kho tus broker

apt-tau nruab yoov tshaj cum

apt-tau nruab mosquitto-cov neeg siv khoom

2. Txhim kho MYSQL cov ntaub ntawv puag rau tus neeg rau zaub mov

- Txhim kho apache server

sudo apt nruab apache2

- Txhim kho PHP

sudo apt nruab php php-mbstring

- Txheeb xyuas PHP ua haujlwm:

- rho tawm cov ntawv “index.html” hauv phau ntawv teev npe “/var/www/html”. los ntawm ntxig qhov hais kom ua:

sudo rm /var/www/html/index.html

- Tsim cov ntawv index.php

ncha ""> /var/www/html/index.php

- Nruab MYSQL

sudo apt nruab mysql-server php-mysql

- Txheeb xyuas tias MySQL ua haujlwm tau raug. Ua ntej tsim MYSQL tus neeg siv thiab tus lej zais.

sudo mysql -u hauv paus -p

- Hloov 'username' thiab 'password' nrog koj lub npe siv thiab tus password xaiv

ZOO TSHAJ PLAWS TSEV KAWM NTAWV ntawm mydb.* TO 'username'@'localhost' IDENTIFIED BY 'password';

- Txhim kho PHPMyAdmin

sudo apt nruab phpMyAdmin

- Txheeb xyuas tias PHPMyAdmin ua haujlwm tau zoo los ntawm kev ntxig kab hauv qab no hauv koj lub vev xaib:

127.0.0.1/phpmyadmin

- Yog tias koj tseem tau txais qhov yuam kev, nws yuav yog vim PHPMyAdmin tau hloov mus rau lwm cov npe. Hauv qhov no, sim cov lus txib thiab tshawb xyuas dua.

sudo ln -s/usr/qhia tawm/phpmyadmin/var/www/html/phpMyAdmin

Kauj ruam 4: Node Liab

Noob Liab
Noob Liab

Yoov mqtt node tau siv los nyeem cov ntaub ntawv los ntawm lub teeb

sensor hloov nws mus rau qhov sib txuam nrog Hloov node thiab tom qab ntawd tsim cov ntsuas thiab teeb tsa cov ntaub ntawv rau cov ntaub ntawv nyeem hom ntawv uas yuav muab tso rau hauv database (mydb) tom qab nrog SQL Insert muaj nuj nqi.

Tom qab cov ntaub ntawv tau ntxig rau mydb, nws yuav raug siv los tsim daim ntawv los saib xyuas los ntawm lub dashboard.

Daim ntawv Max tau tsim los txhawm rau txheeb xyuas qhov ntau kawg ntawm kev nyeem yuav tsum tau qhia ntawm daim ntawv daim ntawv pib txij thawj zaug nyeem ntawv mus rau qhov siab tshaj plaws los ntawm tus neeg siv interface.

Kauj ruam 5:

Kauj Ruam 6:

Cov ntaub ntawv kawg

Pom zoo: