Cov txheej txheem:

Nruab Node RED ntawm Koj Raspberry Pi: 4 Cov Kauj Ruam
Nruab Node RED ntawm Koj Raspberry Pi: 4 Cov Kauj Ruam

Video: Nruab Node RED ntawm Koj Raspberry Pi: 4 Cov Kauj Ruam

Video: Nruab Node RED ntawm Koj Raspberry Pi: 4 Cov Kauj Ruam
Video: Раскрытие тайны TPM 2.0: Руководство ИТ-администраторов по безопасности Windows 11 и Windows 10 2024, Kaum ib hlis
Anonim
Nruab Node RED ntawm Koj Raspberry Pi
Nruab Node RED ntawm Koj Raspberry Pi

Node-RED yog cov cuab yeej ua haujlwm raws li kev sib txuas ua ke cov cuab yeej kho vajtse, APIs thiab cov kev pabcuam online hauv txoj hauv kev tshiab thiab nthuav.

Hauv qhov kev qhia no kuv yuav qhia koj, yuav ua li cas rau nruab Node-RED ntawm koj li Raspberry Pi.

Khoom siv

Txhawm rau nruab Node-RED, koj xav tau cov cuab yeej hauv qab no:

  • Raspberry Pi
  • MicroSD Card nrog Raspbian
  • Ethernet Cable lossis WiFi Dongle (Pi 3 muaj WiFi inbuilt)
  • Hwj chim Adapter

Pom zoo:

  • Raspberry Pi Cov
  • Raspberry Pi Heatsink

Kauj ruam 1: Teeb

Yuav teeb tsa Raspberry Pi li cas?

Yog tias koj rub tawm thiab teeb tsa 'Raspbian Stretch nrog lub desktop thiab pom zoo software' ntawm koj Pi, Node-RED twb tau teeb tsa.

Koj tuaj yeem pom yuav pib li cas thaum kawg ntawm kev qhia.

Kauj ruam 2: Txheeb xyuas qhov hloov tshiab

Ntaus hauv qhov lus txib no txhawm rau txheeb xyuas qhov hloov tshiab:

sudo apt-tau hloov tshiab

Kauj Ruam 3: Rub tawm thiab Nruab NodeJS

Rub tawm thiab Nruab NodeJS
Rub tawm thiab Nruab NodeJS

Ua ntej koj yuav tsum paub qhov twg ntawm NodeJS koj xav tau. Ntaus cov lus txib no kom paub: tsis muaj npe -m Yog tias cov lus teb pib nrog armv6, tom qab ntawd koj yuav xav tau ARMv6 version. Txwv tsis pub, yog tias nws pib nrog armv7, koj yuav xav tau ARMv7 version.

  1. Luam qhov txuas ntawm qhov koj xav tau los ntawm NodeJS lub vev xaib
  2. Muab tshuaj txhuam nws tom qab koj ntaus ntawv 'wget' hauv lub console ntawm koj Piwget [YOUR_NODEJS_DOWNLOAD_LINK] piv txwv li. wget
  3. Nias nkag mus. NodeJS yuav tam sim no rub tawm
  4. Tom qab rub tawm tiav, rho tawm filetar xf [YOUR_DOWNLOADED_NODEJS_FILE] piv txwv. tar xf node-v10.16.0-linux-armv7l.tar.xz
  5. Nkag mus rau hauv cov ntawv rho tawm cd [YOUR_EXTRACTED_DIRECTORY] piv txwv. cd node-v10.16.0-linux-armv7l
  6. Luam tag nrho cov ntaub ntawv rau '/usr/local/' sudo cp -R */usr/local

Txheeb xyuas yog tias txhua yam tau teeb tsa ua tiav:

node -v

npm -v

Cov lus txib tam sim no yuav tsum xa rov qab version ntawm node thiab npm. Yog tias lawv tsis ua qhov ntawd, tej zaum koj tau rub tawm qhov tsis raug NodeJS version.

Kauj Ruam 4: Nruab thiab Pib Node-RED

Nruab Node-RED ntawm Node Package Manager:

sudo npm nruab -g-tsis muaj kev nyab xeeb-perm node-liab

Tom qab Node-RED tau teeb tsa, koj tuaj yeem pib nws nrog cov lus txib no:

node-liab

Cov lus teb yuav tsum yog ib yam zoo li no:

Txais tos rau Node-RED ===================

25 Mar 22:51:09 - [info] Node -RED version: v0.20.5

25 Mar 22:51:09-[info] Node.js version: v10.15.3 25 Mar 22:51:09-[info] Loading palette nodes 25 Mar 22:51:10-[ceeb toom] ------ ------------------------------------ 25 Mar 22:51:10-[ceeb toom] [rpi- gpio] Cov ntaub ntawv: Tsis quav ntsej Raspberry Pi tshwj xeeb ntawm 25 Mar 22:51:10-[ceeb toom] ------------------------------ ------------ 25 Mar 22:51:10-[info] Cov chaw teeb tsa: /home/nol/.node-red/settings.js 25 Mar 22:51:10-[info] Cov ntsiab lus khw: 'default' [module = localfilesystem] 25 Mar 22:51:10 - [info] Cov neeg siv phau ntawv teev npe: /home/nol/.node-red 25 Mar 22:51:10 - [ceeb toom] Cov haujlwm xiam oob qhab: teeb editorTheme.projects.enabled = muaj tseeb kom pab tau 25 Mar 22:51:10 - [info] Tam sim no neeg rau zaub mov khiav ntawm https://127.0.0.1:1880/25 Mar 22:51:10 - [info] Tsim cov ntaub ntawv tshiab ntws: ntws_noltop.json 25 Mar 22:51:10 - [info] Pib ntws 25 Mar 22:51:10 - [info] Pib ntws

Qhov chaw nyob ntawm tus neeg rau zaub mov yuav tshwm nyob rau hauv cov lus teb. (nws ua siab tawv hauv cov lus teb piv txwv no)

Node-RED tam sim no muaj nyob ntawm: https:// [IP_OF_YOUR_PI]: 1880/

Pom zoo: