Cov txheej txheem:

Tua Koj Cov Duab Nyiaj so koobtsheej Slideshow Nrog Kov ntawm Khawv koob!: 9 Kauj Ruam (nrog Duab)
Tua Koj Cov Duab Nyiaj so koobtsheej Slideshow Nrog Kov ntawm Khawv koob!: 9 Kauj Ruam (nrog Duab)

Video: Tua Koj Cov Duab Nyiaj so koobtsheej Slideshow Nrog Kov ntawm Khawv koob!: 9 Kauj Ruam (nrog Duab)

Video: Tua Koj Cov Duab Nyiaj so koobtsheej Slideshow Nrog Kov ntawm Khawv koob!: 9 Kauj Ruam (nrog Duab)
Video: TXIV COV LUS - Dang Thao Official Music Video 2024, Hlis ntuj nqeg
Anonim
Tua Koj Cov Duab Hnub So Slideshow Nrog Kov ntawm Khawv koob!
Tua Koj Cov Duab Hnub So Slideshow Nrog Kov ntawm Khawv koob!
Tua Koj Cov Duab Hnub So Slideshow Nrog Kov ntawm Khawv koob!
Tua Koj Cov Duab Hnub So Slideshow Nrog Kov ntawm Khawv koob!

Ntau xyoo dhau los, Kuv tau tsim tus cwj pwm coj me me cov duab nrog kuv thaum mus ncig: Kuv nquag yuav me me, tsis muaj dab tsi (zoo ib yam hauv daim duab) thiab pleev xim kom phim tus chij thiab ntsiab lus ntawm lub tebchaws Kuv ' m mus ntsib (hauv qhov no, Sicily).

Lub tswv yim yog tom qab ntawd thaij cov duab ntawm lub ntsej muag lossis lub ntsej muag nto moo los ntawm lub tebchaws hais tias: Kuv pom nws lom zem dua li muaj cov duab nrog tsuas yog lub monument nws tus kheej (muaj Google rau qhov ntawd thiab nws pheej yig dua) tab sis tseem yooj yim dua li muaj kom nyob ntawm txhua daim duab kuv tus kheej (tsis yog tus kiv cua, ua siab ncaj)

Raws li nws ib txwm muaj kev lom zem los sib sau cov neeg koj tau mus rau hnub so nrog ob peb hnub tom qab rov qab los saib cov duab, Kuv xav tias nws yuav zoo yog tias txhua tus duab puab tuaj yeem ua li cas thiaj li tso qhov swb ntawm cov duab los ntawm kev mus ncig uas lawv tau ua rau.

Cov lus qhia no yuav piav qhia tias kuv tau ua li cas, siv NFC, raspberry pi, nodejs thiab osmc

Kauj ruam 1: Txheej txheem cej luam ntawm Cov Tshuaj

Txheej txheem cej luam ntawm Cov Tshuaj
Txheej txheem cej luam ntawm Cov Tshuaj
Txheej txheem cej luam ntawm Cov Tshuaj
Txheej txheem cej luam ntawm Cov Tshuaj

Txij li tag nrho cov teeb tsa suav nrog qee yam, ntawm no yog qhov dav dav ntawm qhov kev koom tes los pab koj nkag siab txhua yam raws li hauv qab no:

Kho vajtse

- cov duab yog ua hauv tsev: txij li thaum kuv sau cov lus qhia no kom raug nyob nruab nrab ntawm kev mus ncig ib lub lim tiam hauv Copenhagen/Oslo/Stockholm/Helsinki, Kuv yuav suav nrog qee qhov kev txhaj tshuaj ntawm cov duab uas tau ua rau qhov kev mus ncig no

- hauv qab txhua daim duab yog NFC nti: Kuv tab tom siv cov ntawv nplaum uas kuv tuaj yeem haum hauv qab txhua tus duab tab sis koj tuaj yeem siv lwm daim ntawv foos - tsuas yog nco ntsoov tias cov nti uas koj siv tau sib xws nrog koj tus nyeem ntawv

- kom tso saib cov duab, Kuv yuav siv raspberry pi nrog OSMC teeb tsa: nws yog kuv li media player xaiv rau TV qhia thiab tsos yog li nws twb txuas nrog kuv lub TV

- txhawm rau raspberry pi nyeem NFC cim npe, Kuv ntxiv NFC nyeem ntawv - qhov kuv siv yog Tshawb -NFC los ntawm NXP, muaj nyob ntawm ntau lub vev xaib: nws ntsaws rau Pi thiab ua raws li daim thaiv

Software

Ntawm Raspberry Pi, NodeJS tsab ntawv tos rau NFC lossis kom nyeem: ib zaug ua tiav, tsab ntawv txheeb xyuas nws tus lej tiv thaiv tus nqi/khub npe nrog txhua daim nplaub tshev los ntawm cov duab los ntawm OSMC thiab NFC ID raws li teeb tsa los ntawm tus neeg siv.

Thaum tag lossis nyeem, yog tus lej ID nyob hauv cov npe, Node tsab ntawv qhia OSMC kom qhib lub swb rau lub nplaub tshev tshwj xeeb. scans rau txhua cov npe hauv "Duab" qhov chaw ntawm OSMC (siv JSON-RPC API uas Kodi muab) thiab ntxiv nws rau hauv cov npe uas tom qab ntawd tau khaws tseg ntawm disk. Los ntawm kev kho cov ntawv no ncaj qha, tus neeg siv tom qab ntawd tuaj yeem ntxiv qhov sib xws NFC ID rau txhua qhov nkauj.

Kauj Ruam 2: Tsim Daim Duab

Tsim lub Figurine
Tsim lub Figurine
Tsim lub Figurine
Tsim lub Figurine
Tsim lub Figurine
Tsim lub Figurine
Tsim lub Figurine
Tsim lub Figurine

Koj tuaj yeem siv txhua yam zoo nkauj uas koj nyiam rau koj cov duab: Kuv nyiam siv cov yas yas khoom ua si vim tias lawv yog - tus - yooj yim los kos rau txawm tias ib tus neeg zoo li kuv uas tsis nyiam kos, thiab yooj yim rau nqa. Kuv xaj lawv hauv lawv daim ntawv dawb, DIY version, hauv qhov me me lawv tuaj nws, thiab kos rau lawv siv Posca cov cim. Ntawm no koj tuaj yeem pom tus uas kuv tau ua rau qhov kev mus ncig no, nrog tus chij ntawm plaub lub tebchaws uas peb tau mus xyuas - lawv tau tshwm sim zoo ib yam txaus rau kuv los ua ke lawv ib sab. Koj tuaj yeem siv ntau lub tsho xim ntev npaum li koj tau cia txhua tus qhuav ua ntej pleev xim rau tom ntej. Tom qab kuv ua tiav cov xim, Kuv nyiam siv rab phom kub ntawm cov xim rau ob peb feeb, raws li kuv tau nyeem tias nws yog qhov kub tiag tiag uas pab Posca xim txheej.

Hauv daim duab kawg koj tuaj yeem pom Sven - Kuv ib txwm muab lawv lub npe - so hauv Oslo tom qab sawv ntxov ntev. Nws tsis muaj lub taub hau los ntawm cov khoom ua si qub, txij li kuv tau tswj hwm qhov ntawd ib feeb ua ntej tawm mus: Kuv yuav tsum tau muab cov khoom ua si yav dhau los los siv nws lub taub hau xwb. Kuv tsis tuaj yeem hais tias tsis tau tshwm sim ua ntej …

Kauj ruam 3: Nruab OSMC

Nruab OSMC
Nruab OSMC

Thawj qhov uas kuv tau ua yog teeb tsa OSMC ntawm daim npav micro SD rau Raspberry Pi: hauv peb teeb tsa, nws yuav ua tus tshaj tawm xov xwm los saib koj cov duab. Kuv yuav tsis nkag mus rau ntau yam ntawm qhov no vim tias nws tau sau tseg zoo (muaj ob peb Cov Lus Qhia muaj yog tias koj xav tau kev pab). Tsuas yog rub tawm lub installer ntawm koj lub computer thiab ua raws cov lus qhia. Thaum kuv ua tiav, Kuv tsuas yog ntsaws rau hauv cov keyboard thiab nas thiab ntsaws lub HDMI rau TV thiab ua raws tus txheej txheem teeb tsa los teeb tsa lub sijhawm sijhawm thiab lwm yam.

Thaum kawg, kuv tau ntxiv cov npe uas kuv khaws kuv cov duab rau hauv cov peev txheej: hauv kuv cov ntaub ntawv lawv tau khaws cia ntawm NAS nrog IP ruaj khov ntawm tib lub network, tab sis koj tseem tuaj yeem khaws lawv ntawm USB tsav lossis ntawm lub tsev nplaub tshev nws tus kheej, muab tias koj micro SD loj txaus.

Thaum ntxiv lub hauv paus, koj yuav hais kom nkag mus rau lub npe rau nws: koj tuaj yeem tso qhov tsis raug lossis hloov pauv tab sis nco ntsoov sau nws vim tias peb yuav xav tau nws tom qab. Hauv kuv qhov xwm txheej kuv hu nws "MyPictures"

Tam sim no koj yuav tsum pom cov ntsiab lus ntawm cov npe uas koj tau ntxiv thiab xaub koj cov duab: hauv kuv qhov xwm txheej, kuv muaj cov npe me me rau txhua qhov kev mus.

Nrog koj zoo siab, tam sim no koj muaj lub chaw tshaj xov xwm nrog koj cov duab rau ntawm nws thiab tuaj yeem nthuav tawm cov duab swb rau ib daim nplaub tshev tshwj xeeb (raws li qhov tau txais txiaj ntsig, koj kuj tseem tuaj yeem siv nws los ua koj li vis dis aus lossis nkauj)

Kauj Ruam 4: Kho Tus Neeg Nyeem Ntawv

Rau qhov seem ntawm kev qhia, peb yuav txuas rau Pi siv kab hais kom ua hla SSH. Txhawm rau ua qhov ntawd, tsuas yog txuas Pi rau koj lub network siv Ethernet cable thiab siv lub davhlau ya nyob twg lossis cov khoom siv tshwj xeeb los txuas rau Pi. Ntawm Mac OS thiab Linux, cov lus txib yog

ssh [email protected]

Koj yuav raug nug kom nkag mus rau tus password, nws yog osmc dua

Rau tus nyeem ntawv kom muaj peev xwm ua haujlwm, SPI yuav tsum tau qhib: hauv feem ntau kev faib khoom xws li Raspbian qhov no tuaj yeem ua tiav los ntawm kev siv raspi-teeb tsa, cov cuab yeej teeb tsa uas tso cai rau koj hloov qee qhov kev teeb tsa.

OSMC, txawm li cas los xij, tsis suav nrog raspi-teeb tsa, rau koj tus kheej kev nyab xeeb thaum siv nws. Hloov chaw, kaw Raspberry, tshem daim npav micro SD thiab tsuas yog rub nws mus rau koj lub khoos phis tawj: qhov "khau raj" muab faib yuav tsum pom tam sim no. Muaj, ntawm lub hauv paus ntawm qhov ntim, koj yuav pom cov ntawv hu ua "config.txt" - tsuas yog qhib nws thiab ntxiv kab no thaum kawg:

"dtparam = spi = rau"

Tam sim no koj tuaj yeem khaws cov ntawv, rov pib dua thiab SPI yuav tsum tau qhib.

Tom qab ntawd, koj yuav tsum rub cov ntawv ZIP uas txuas nrog thiab unzip nws ntawm raspberry - Kuv pom zoo kom tsim Cov Ntawv Teev Npe thiab unzipping nws nyob ntawd. Txhawm rau ua qhov ntawd, koj tuaj yeem txuas nrog Raspberry siv FTP hla SSH (Kuv siv CyberDuck los ua qhov ntawd) lossis muab cov ntawv tso rau ntawm USB Drive thiab siv Kodi tus thawj tswj ntaub ntawv los theej nws ntawm Raspberry Pi.

Ua li cas los xij, ib zaug koj tau theej cov ntawv zip rau Pi, koj tuaj yeem nkag mus rau lub nplaub tshev uas koj tau theej nws mus thiab unzip nws, txav mus rau lub nplaub tshev uas tau tshwm sim thiab teeb tsa pob:

unzip SW2827.zipcd SW2827sudo dpkg -i libneardal0_0.14.3-1_armhf.deb neard-explorenfc_1.2-1_armhf.deb

Yog tias txhua yam mus zoo koj yuav tsum tuaj yeem ntsaws rau hauv tus nyeem ntawv, rov pib dua thiab tom qab ntawd nkag mus

explorenfc-pib

Yog tias koj mus txog NFC nti rau tus nyeem ntawv nws yuav tsum tam sim no nthuav tawm cov ntaub ntawv los ntawm cov nti (ntawm lwm yam, nws tus lej)

Kauj Ruam 5: Nruab Node thiab Tsim Qhov Project

Tom ntej no, peb yuav nruab NodeJS ntawm raspberry los sau peb lub app.

Peb xav kom nruab nodejs tab sis cov version ntawm lub chaw cia khoom qub yog qub qub, yog li koj yuav tsum mus dhau thawj kauj ruam ua ntej: hauv kab hais kom ua interface, ntaus

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E tsoo -

Koj tuaj yeem ntaus ntawv

sudo apt nruab nodejs

txhawm rau txhim kho qhov tseeb version ntawm nodejs thiab npm muaj.

Txhawm rau tswj KODI los ntawm hauv nodejs, peb tab tom yuav siv npm pob hu ua kodi-ws.

Cia peb pib los ntawm kev tsim txoj haujlwm tshiab: tsuas yog ntaus cov lus txib

npm pib

Koj yuav raug nug ib tus lej ntawm cov lus nug: rau feem ntau ntawm lawv koj tuaj yeem tawm ntawm lub neej ntawd, tsuas yog xaiv lub npe rau koj li app thiab sau koj tus kheej lub npe thaum kawg. Thaum nug txog qhov pib tsuas yog tawm ntawm index.js

Qhov no yuav tsim pob ntawv.json uas yuav suav nrog cov yam ntxwv ntawm koj pob, xws li nws qhov kev cia siab.

Tam sim no koj tuaj yeem nkag mus

sudo npm nruab kodi-ws sudo npm nruab jsonfilesudo npm nruab cronsudo npm nruab child_process

Yog tias koj qhib pob.json tom qab ntawd, koj yuav nco ntsoov tias txhua pob ntawv tau ntxiv rau qhov kev cia siab.

Kauj Ruam 6: Txoj Cai, Piav

Txoj Cai, Piav Qhia
Txoj Cai, Piav Qhia

Txuas nrog cov kauj ruam no yog tus lej rau app.

Kuv tau tso qhov kev txiav txim ncaj ncees uas tuaj yeem tsis suav nrog txhawm rau nkag siab tsab ntawv tab sis nws tau tawg nws ua ke.

Koj yuav pom tias txawm hais tias txhua txoj haujlwm tshaj tawm, txoj cai tsuas yog ua ob peb yam thaum xub thawj:

kodi ('localhost', 9090). ces (muaj nuj nqi (kev sib txuas) {

Tsab ntawv sim txuas rau OSMC JSON-RPC API. Thaum nws ua tiav (thiab tsuas yog tom qab ntawd), nws txuas ntxiv nrog cov ntawv tas.

Yog tias yog vim li cas koj thiaj tsis khiav qhov no los ntawm koj li Raspberry Pi, hloov localhost rau koj tus IP chaw nyob. Tsis tas li nco ntsoov tias hauv cov kev pabcuam teeb tsa sab hauv OSMC (Chaw/Kev Pabcuam) lub npov "Tso cai tswj chaw taws teeb los ntawm cov ntawv thov ntawm lwm lub tshuab" (saib daim duab)

Tus so ntawm cov ntaub ntawv feem ntau tshaj tawm cov haujlwm uas peb yuav siv tom qab: ob txoj haujlwm uas tau pib tiag los ntawm no yog (kab 172/173)

scanAndSetCron (); mloogForTag ();

Hauv scanAndSetCron:

- scanPictures muaj nuj nqi tau pib. Hauv nws, peb tshawb xyuas yog qhov hloov pauv "mypicturedirectory", uas yuav tuav txoj hauv kev rau peb cov duab, tsis muaj dab tsi. Yog tias yog, peb thov OSMC muab rau peb txhua qhov chaw uas nws muaj rau cov ntsiab lus duab (sab hauv getPictureDirectory muaj nuj nqi, kab 11):

var piclist = tos tos kev sib txuas Files. GetSources ("duab");

OSMC muab peb cov khoom xa rov qab: rau txhua qhov khoom, peb tshawb xyuas yog tias lub hauv paus lub npe suav nrog "Kuv": yog qhov xwm txheej peb khaws nws raws li peb daim duab (kab 16 thiab hauv qab no). Nov yog qhov uas koj yuav xav hloov txoj hlua ntawm "Kuv" mus rau qhov koj tau nkag los yav dhau los raws li lub npe rau koj cov duab qhov chaw

yog (piclist.sources .label.includes ("Kuv")) {console.log (">>> Pom cov npe" + piclist.sources .file); mypicturedirectory = piclist.sources .file; }

Tam sim no peb muaj txoj hauv kev mus rau qhov chaw (qhov tseem ceeb hauv cov ntawv tais ceev tseg rau peb cov nkauj), peb thov OSMC txhawm rau tshuaj xyuas nws thiab ntxiv txoj hauv kev rau txhua daim nplaub tshev rau kab ntawv hu ua album_directories (yog tias nws tsis tau muaj). Txij li txoj haujlwm no yuav ua haujlwm txhua X vib nas this, peb tshawb xyuas tias phau ntawv teev npe tsis tau nyob hauv cov npe ua ntej muab nws ntxiv, nrog NFC ID teeb tsa rau txoj hlua khoob - txoj kev ntawd, txhua daim nplaub tshev tshiab uas koj ntxiv rau koj cov duab yuav raug txiav ntxiv - kab 46

rau (var j = 0; j <directories.length; j ++) {if (directory [j].filetype.includes ("directory")) {if (searchDirectory (directories [j].file, album_directories)) {console. log (phau ntawv teev npe [j].file +"twb muaj lawm"); } lwm tus {console.log (">> Ntxiv dir" + phau ntawv teev npe [j].file); album_directories.push ({directory: phau ntawv teev npe [j].file, nfc: ""}); }}}

Thaum kawg, peb khaws cov album_directories array rau json cov ntaub ntawv ntawm Pi, uas peb sim ua kom thauj khoom txhua lub sijhawm ua haujlwm tau ua tiav: qhov no tshwm sim thaum kawg ntawm scanAndSetCron ua haujlwm qhov twg peb siv pob zoo li pob kom ntseeg tau tias peb ua haujlwm tau zoo txhua txhua 15 vib nas this.

JSON cov ntaub ntawv uas peb tsim tawm, album_directories.json, tuaj yeem qhib siv ib qho app notepad. Thaum koj ua li ntawd, koj yuav raug nthuav tawm nrog cov npe ntawm koj daim duab albums, txhua qhov nrog qhov tsis muaj "nfc" teb:

[{"directory": "/home/osmc/Pictures/Mada 2016/", "nfc": ""}, {"directory": "/home/osmc/Pictures/NewFolder/", "nfc": "" }, {"directory": "/home/osmc/Duab/Test/", "nfc": ""}]

Hauv daim teb no, tam sim no koj yuav tsum muab tus ID cim npe uas koj xav koom nrog cov nkauj no. Txhawm rau kom tau tus lej no, tsuas yog mus rau SW2827 nplaub tshev, khiav explorenfc-theem pib thiab luam theej duab koj xav siv. Hauv cov ntawv tso tawm uas koj tau txais, tsuas yog saib rau tus nqi ib sab ntawm ISO14443A UID. Luam nws mus rau album koj xav teeb tsa. Hauv kuv rooj plaub, piv txwv li,

[{"directory": "/home/osmc/Pictures/Mada 2016/", "nfc": "040A12EAFC3881"}, {"directory": "/home/osmc/Pictures/NewFolder/", "nfc": " "}, {" directory ":"/home/osmc/Duab/Test/"," nfc ":" "}]

Txuag cov ntaub ntawv thiab nws cov ntsiab lus yuav raug thauj khoom thaum koj tso lub app tom ntej.

Hauv kev ua haujlwm mloogForTag, peb tsuas yog ua li ntawd: txij li tsis zoo li yog qhov chaw tshwj xeeb ntawm chaw nyeem ntawv rau NodeJS, peb cia siab rau cov txheej txheem menyuam yaus los tsim lub binary rau tus nyeem ntawv:

var spawn = require ('child_process'). spawn, child = spawn ('/usr/bin/explorenfc-basic', );

Peb vam khom tus neeg teev npe kom tau txais cov txiaj ntsig los ntawm qhov ua tiav no: sab hauv kev hu rov qab rau child.stdout.on ('cov ntaub ntawv', ua haujlwm (cov ntaub ntawv), peb cais cov txiaj ntsig ntawm cov lus txib no siv kev tshuaj xyuas ua haujlwm tawm: peb tab tom nrhiav rau kab ntawv uas peb tau pom ua ntej, pib nrog "ISO14443A UID:", txij li qhov ntawd yog tus lej ID rau daim ntawv uas peb tau tshuaj xyuas tau muab khaws cia. thawj).

Thaum kawg, peb sim ua tus ID no rau tus ID uas peb nkag mus rau hauv album_directories array ntawm cov khoom (thauj los ntawm album_directories.json file). Yog tias muaj kev sib tw pom, peb qhia OSMC kom tso cov duab swb rau cov ntawv tshwj xeeb ntawd:

var nfcid = analyseOutput (cov ntaub ntawv); console.log ("nfcid yog" + nfcid.id); var sib haum album = searchTag (nfcid.id, album_directories); yog (sib xws album) {console.log ("Pom album" + JSON.stringify (sib thooj rau album) + "rau daim ntawv no"); var args = [{'txoj kev': sib xws ntawm cov nkauj.directory}]; connection.run ('Player. Open', args); } mloogForTag ();

Koj pom li cas qhov kawg ntawm txoj haujlwm, peb tso tawm listenForTag dua? Nov yog qhov kev daws teeb meem nkaus xwb uas kuv tau pom los ua lub app ua haujlwm: explorenfc-yooj yim yuav los ntawm kev tos tos rau ib qho, nyeem nws, tom qab ntawd tawm mus. Lub app muaj hom txuas mus ntxiv uas peb tuaj yeem hu siv explorenfc -basic -k tab sis nyob rau hauv hom no, cov menyuam yaus ua haujlwm yeej tsis tso tawm cov ntsiab lus tag vim nws tsis tau xaus (hauv lwm lo lus child.stdout.on ('cov ntaub ntawv') yeej tsis raug rho tawm). Raws li kuv tsis tau pom dua lwm txoj hauv kev los siv tus nyeem ntawv no, qhov peb tab tom ua ntawm no yog pib ua haujlwm explorenfc-yooj yim hauv ib hom nkaus nkaus xwb, thiab thaum twg tag tau nyeem, peb tso listenForTag thiab yog li rov pib dua explorenfc-pib.

Yog tias kuv yuav tsum rov qab (thiab kuv xav tias kuv yuav), Kuv yuav xaiv NFC nyeem ntawv uas muaj ntau txoj hauv kev xaiv: piv txwv li, Adafruit (koj yuav tau pom tias kuv nyiam lawv heev) muaj tus nyeem ntawv no https:// www.adafruit.com/khoom/789 uas tau sib xws nrog libnfc, uas kuv ntseeg tias txhais tau tias tus nyeem ntawv yuav huv dua los cuam tshuam nrog ntau dua li hu rau tus txheej txheem menyuam yaus los ntawm hauv node thiab cais tawm stdout!

Kauj ruam 7: Sim nws

Txhawm rau qhib lub app, tsuas yog mus rau lub nplaub tshev ntawd thiab ntaus "node index.js" (lossis npm pib txij li peb tau teeb tsa nws ua ntej hauv pob.json). Hauv cov cav koj yuav tsum pom lub app txuas rau OSMC/Kodi thiab luam tawm thawj zaug. Tom qab ob peb feeb cov ntaub ntawv album_directories.json yuav raug tsim sab hauv cov phiaj xwm phiaj xwm; Tom qab ntawd koj tuaj yeem nkag mus rau NFC daim npav ID raws li tau piav qhia ua ntej thiab koom nrog lawv nrog cov nkauj uas koj xav tau.

Kauj Ruam 8: Tua Tawm Tuaj

Txhawm rau suav nrog, peb tau tsim Node app uas (1) ntsuas rau koj lub tsev qiv ntawv duab KODI thiab sim nrhiav daim nplaub tshev uas koj khaws koj cov duab hnub so, (2) mloog rau NCF cim npe los ntawm kev cia siab rau explorenfc-yooj yim thiab tom qab ntawd (3) xa cov nkauj cuam tshuam nrog NFC ID no.

Txhawm rau ua kom tag nrho cov txheej txheem khiav hauv keeb kwm yav dhau, peb yuav siv PM2, tus thawj tswj txheej txheem rau ntawm.

Hauv kab hais kom ua, mus rau koj cov phiaj xwm phiaj xwm (qhov twg koj qhov index.js cov ntaub ntawv nyob) thiab ntaus cov kab hauv qab no:

sudo npm nruab pm2 -gpm2 pib index.js

Tam sim no koj lub app tau tshuaj xyuas los ntawm PM2 thiab yuav rov pib ua dua tshiab! Kom paub tseeb tias nws tau tshaj tawm tiag tiag, ntaus cov npe pm2 thiab koj yuav tsum pom nws hauv cov npe. Yog tias koj xav pom cov cav, tsuas yog ntaus ntawv pm2.

Pom zoo: