Cov txheej txheem:

Tsim Ib Lub Zos Blynk Server: 5 Kauj Ruam
Tsim Ib Lub Zos Blynk Server: 5 Kauj Ruam

Video: Tsim Ib Lub Zos Blynk Server: 5 Kauj Ruam

Video: Tsim Ib Lub Zos Blynk Server: 5 Kauj Ruam
Video: Наука о данных с Python! Анализ типов файлов от Avro до Stata 2024, Kaum ib hlis
Anonim
Tsim Ib Lub Zos Blynk Server
Tsim Ib Lub Zos Blynk Server

Hauv cov ntawv tshaj tawm no, peb kawm paub yuav tsim Blynk server hauv zos uas yuav txo qis tag nrho kev nyob qis qis uas qee zaum tam sim no thaum siv lub neej ntawd, cov neeg rau zaub mov nyob deb. Peb teeb tsa nws siv Pi Zero W thiab peb tseem tsim qhov project demo kom paub tseeb tias txhua yam ua haujlwm raug.

Kauj ruam 1: Saib Video

Cov vis dis aus saum toj no mus dhau txhua yam uas koj xav paub kom teeb tsa server. Thov saib qhov ntawd ua ntej txhawm rau nkag siab kom nkag siab tias txhua yam tuaj ua ke li cas.

Kauj ruam 2: Configure Pi

Kuv txiav txim siab siv lub desktop version ntawm Raspbian txawm hais tias koj tseem tuaj yeem siv Lite version thiab ua txhua yam siv lub davhlau ya nyob twg. Koj tuaj yeem siv qhov txuas hauv qab no rau cov lus qhia teeb tsa ua haujlwm tab sis kuv tau hais txog cov kauj ruam tseem ceeb hauv qab no:

github.com/blynkkk/blynk-server

Thaum koj muaj Raspberry PI teeb tsa, khiav cov lus txib hauv qab no rau nruab Java thiab tom qab ntawd rub tawm cov ntaub ntawv server:

  • sudo apt nruab openjdk-8-jdk openjdk-8-jre
  • wget "https://github.com/blynkkk/blynk-server/releases/download/v0.41.12/server-0.41.12-java8.jar"

Thaum qhov ntawd ua tiav, txhua yam peb yuav tsum tau ua yog siv crontab kom siv tus neeg rau zaub mov ntawm lub khau raj. Qhov ntawd tuaj yeem ua tiav los ntawm kev khiav cov lus txib hauv qab no los qhib crontab:

crontab -e

Nkag mus rau hauv qab ntawm cov ntawv thiab tom qab ntawv ntaus hauv qab no:

@reboot java -jar /home/pi/server-0.41.12-java8.jar -dataFolder/tsev/pi/Blynk &

Txuag cov ntaub ntawv los ntawm kev ntaus CTRL+X, tom qab ntawd Y, tom qab ntawd nyem ENTER qhov tseem ceeb. Blynk server xa email nrog daim ntawv pov thawj kev lees paub rau txhua qhov haujlwm. Txhawm rau ua qhov no, peb yuav tsum teeb tsa lub chaw xa ntawv los ntawm kev tsim cov ntaub ntawv tshiab. Qhov ntawd tuaj yeem ua tiav los ntawm kev khiav cov lus txib hauv qab no:

sudo nano mail.properties

Peb yuav tsum tau ntxiv email teeb tsa hauv cov ntaub ntawv no nrog rau cov ntsiab lus ntawm tus email account. Thov siv GitHub txuas kom tau txais cov kab uas xav tau ntxiv lossis xa mus rau daim vis dis aus kom paub meej ntxiv.

Kauj ruam kawg yog rov pib dua lub rooj tsavxwm uas tuaj yeem ua tiav los ntawm kev ua cov lus txib hauv qab no:

sudo rov pib dua

Kauj ruam 3: Kho lub App

Kho lub App
Kho lub App

Rub tawm Blynk app lossis tawm yog tias koj twb muaj nws lawm. Nyem qhov kev xaiv los tsim tus as khauj tshiab thiab tom qab ntawd nyem lub cim nyob hauv qab ntawm lub vijtsam kom nkag mus rau cov ntsiab lus rau server. Nyem qhov kev xaiv tshwj xeeb thiab sau tus IP chaw nyob ntawm koj tus raspberry Pi. Tom qab ntawd, muab email chaw nyob siv tau thiab nkag mus rau tus password los tsim tus as khauj ntawm koj lub server hauv zos.

Tam sim no koj tuaj yeem siv Blynk ib txwm tab sis ua qhov kev sim, tsim qhov project demo toggle pin D1 ntawm WeMos D1 mini board. Nov yog txhua yam koj yuav tsum tau ua ntawm no.

Kauj ruam 4: Kho lub Rooj Tswjhwm Saib

Kho lub Rooj Tswjhwm Saib
Kho lub Rooj Tswjhwm Saib

Koj yuav tau txais email nrog tus lej cim pov thawj rau koj qhov haujlwm. Qhib Arduino IDE, xyuas kom tseeb tias koj tau teeb tsa Blynk lub tsev qiv ntawv siv tus thawj tswj tsev qiv ntawv thiab tom qab ntawd qhib lub nodemcu piv txwv kos duab.

Ntxiv koj daim ntawv pov thawj kev lees paub, WiFi network cov ntsiab lus, thiab tom qab ntawd nco ntsoov tawm tswv yim tawm ntawm lub server txuas txuas tsis raug vim peb xav tau ntxiv cov neeg rau zaub mov IP chaw nyob raws li qhia hauv duab/yees duab. Tom qab ntawd, rub cov duab kos rau ntawm lub rooj tsavxwm thiab qhib qhov saib ua ntej kom pom qhov tso tawm. Nws yuav tsum xub ua tiav txuas rau koj li Wi -nkaus network thiab tom qab ntawd nws yuav txuas rau lub server thiab yog tias ua tiav, nws yuav muab koj cov lus "Npaj".

Kauj Ruam 5: Xeem Kev Teeb

Kuaj Cov Teeb
Kuaj Cov Teeb

Qhib lub app thiab nyem lub pob ua haujlwm. Tam sim no, koj yuav tuaj yeem tswj lub xeev GPIO siv lub pob.

Pom zoo: