Cov txheej txheem:

Raspberry Pi Web Interface: 5 Kauj Ruam
Raspberry Pi Web Interface: 5 Kauj Ruam

Video: Raspberry Pi Web Interface: 5 Kauj Ruam

Video: Raspberry Pi Web Interface: 5 Kauj Ruam
Video: Пять мифов о Raspberry Pi: зачем создавалась, как работает с Win 10 и кто победит — Pi 3 или Arduino 2024, Hlis ntuj nqeg
Anonim
Raspberry Pi Web Interface
Raspberry Pi Web Interface

Cov no yog cov lus qhia txhawm rau txhim kho lub vev xaib sib tham Kuv tsim los rau toggling gpio pins ntawm raspberry pi txhawm rau txhawm rau tswj kev ua haujlwm tsis tshua muaj neeg sib kis uas xav tau rau arduino. Nws ua haujlwm rau nplooj ntawv yooj yim uas tso cai rau koj nyem rau kab ntawv txhawm rau hloov pauv lub xeev ntawm tus pin thiab muab koj cov lus tawm tswv yim ntawm lawv cov xwm txheej yooj yim los ntawm kev xa qhov txuas ntsuab rau qhov ua haujlwm txuas thiab liab rau qhov tsis ua haujlwm tiag.

Kauj Ruam 1: Nruab Qhov Duab Raspbian Tseeb

nab hab sej 3.5 tsawg kawg yuav tsum tau preinstalled

Kauj Ruam 2: Kho lub Ntiaj Teb Ib puag ncig

Qhov no yog nyob ntawm yeem tab sis nws yog kev xyaum zoo.

qhib lub davhlau ya nyob twg thiab ua raws li cov lus txib hauv qab no:

ua cd

python3 -m venv env

source ~/env/bin/qhib

Qhov lus txib kawg ua rau lub davhlau ya nyob twg khiav hauv ib puag ncig virtual. Koj paub nws ua haujlwm yog tias koj pom (env) nyob rau hauv ntej ntawm lub davhlau ya nyob twg

kuj nruab cov tsev qiv ntawv:

pip nruab django

pip nruab RPi. GPIO

RPi. GPIO yuav tsum tau rov nruab dua yog tias koj nyob hauv (env)

Kauj ruam 3: Rub tawm Gpio Folder

Rub tawm gpio nplaub tshev los ntawm github hauv cov ntawv tais ceev tseg hauv tsev

GpioWebInterfaceProject_Click mus rau github thiab rub tawm cov ntawv

Kauj ruam 4: Khiav qhov Project

exetute ib txwm nyob hauv tib (env) davhlau ya nyob twg cov lus txib no:

cd ~/gpioWebInterface/gpio

nab hab sej tswj.py makemigrations

nab hab sej tswj.py migrate

nab hab sej tswj.py createuperuser (nkag mus rau tus neeg siv lub npe siv email thiab tus lej zais uas koj yuav siv los txuas txuas sib txuas rau GPIO pins)

nab hab sej tswj.py runerver 0: 8000

Kauj Ruam 5: Kev Xav Thaum Kawg

Koj tuaj yeem ua ob peb nrog apache lossis yam server uas koj xav tau. Kuv tsis pom nws tsim nyog raws li tsis muaj tsheb khiav los tham txog. Kuv khiav nws tom qab NAT nrog kev teeb tsa xa chaw nres nkoj thiab siv tsis-ip rau qhov hloov pauv dns sau npe yog li kuv tuaj yeem nkag mus tau los ntawm txhua qhov chaw.

Txhua yam koj xav tau rau nws kom khiav hauv qhov chaw nyob deb yog GSM Wifi nkag mus tau ntev li ntev tau koj siv qhov kev pom zoo Raspberry pi xoom w.

Txoj Haujlwm no nyob deb ntawm qhov ua tiav. Nws ua haujlwm tab sis tsis zoo nkauj thiab tseem tsis muaj kev nyab xeeb.

Pom zoo: