Cov txheej txheem:

Raspberry Pi HomeLab thiab Leej Twg Yog Tsev: 11 Kauj Ruam
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev: 11 Kauj Ruam

Video: Raspberry Pi HomeLab thiab Leej Twg Yog Tsev: 11 Kauj Ruam

Video: Raspberry Pi HomeLab thiab Leej Twg Yog Tsev: 11 Kauj Ruam
Video: My Mobile HomeLab! (Travel Router with Proxmox, Docker, and OpenWRT) 2024, Hlis ntuj nqeg
Anonim
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev
Raspberry Pi HomeLab thiab Leej Twg Yog Tsev

Nov yog kuv thawj qhov tsis tsim nyog, Tab sis phau ntawv qhia no muaj ob lub ntsej muag.

faze ib: tab tom teeb tsa pi los ua haujlwm raws li chav ua haujlwm hauv tsev rau IOT ua haujlwm rau pab pawg ntawm cov tub ntxhais kawm tsim tawm.

faze ob: yog siv cov txheej txheem rau kev txhim kho, los ntawm kev ua qauv qhia siv peb tus uas yog qhov haujlwm hauv tsev.

los ntawm qhov kawg ntawm qhov no koj yuav muaj lub ntsej muag nkag tsis tau taub hau pi uas tuaj yeem siv los ntawm cov tib neeg rau kev ua haujlwm nyob deb thiab ua haujlwm ntawm IOT cov cuab yeej.

tam sim no kuv ceeb toom, tias los ntawm kev qhib koj tus pi rau pej xeem yam tsis muaj kev ruaj ntseg koj qhib koj tus kheej kom muaj kev pheej hmoo ntawm kev muaj koj lub tsev network sib ntaus.

peb yuav hla thawj qhov faze hauv cov kauj ruam hauv qab no, tab sis qhov no yog qhov txuas rau qee cov ntaub ntawv ntawm peb lub club thiab leej twg yog tus ua haujlwm hauv tsev.

github.com/ValenciaRobotics/embeddedclub

WhoIsHome

tus Who Is home project ua cov hauv qab no: sau cov ntawv nab nab uas tshawb xyuas mac chaw nyob ntawm cov khoom siv txuas nrog koj lub network. nws siv Nmap rau qhov no. nws khiav cov chaw nyob ntawd tawm tsam cov npe chaw nyob thiab yog tias qhov chaw nyob muaj nyob tam sim no nws xa tus lej mus rau arduino los ntawm kev siv kev sib txuas lus. cov arduino tswj hwm ib txoj hlua LED thiab thaum nws tau txais daim npav nws muaj cov xim sib xws rau cov cuab yeej ntawd thiab nws teeb lub LEDs rau tus neeg ntawd raws li lawv nyob tam sim no.

peb cov kev faib tawm

sites.google.com/view/valencia-robotics

sites.google.com/view/valencia-robotics/cl…

peb qhov chaw sib tw

sites.google.com/view/valenciatechclub

Python Script tau muab los ntawm: Jonathan De La Cruz

www.linkedin.com/in/jonathandelacruz96/

Arduino Script thiab taug kev hla thiab teeb tsa lub tsev kuaj ntshav hauv tsev tau ua los ntawm: Dylan Poll

www.linkedin.com/in/dylan-poll-4a324a1a2/

Kuv yog Dylan Poll, Kuv yog tus thawj tswj hwm tam sim no ntawm lub koom haum thev naus laus zis ntawm peb lub tsev kawm qib siab thiab kuv kuj yog cov txheej txheem ua hauv paus.

Khoom siv

Ib pi

Ib arduino

Ib daim ntawv qhia zaub mov

jumper cov xov hlau

Ib lub webcam

tus kheej tuaj yeem hais qhia RGB LED Sawb

lub hwj chim muab rau koj pi, keyboard nas, computer kom ua thawj zaug teeb tsa.

Kauj ruam 1: Rub tawm thiab Txhim Kho Cov Ntaub Ntawv Pib Ua Haujlwm

rub tawm thiab teeb tsa putty (windows)

www.putty.org

download rufus thiab nruab

rufus.ie

download raspbian puv buster thiab pom zoo software (.zip)

www.raspberrypi.org/downloads/raspbian/

rho tawm cov ntsiab lus hauv.zip qhov no yuav yog koj [duab duab].

nqa daim npav micro sd, thiab siv cov khoom ntsaws lossis microsd rau usb ntaus ntawv thiab ntsaws nws rau hauv koj lub computer hom koj daim npav SD

Kauj Ruam 2: ntu Ob: Nruab Raspbian Siv Rufus

Ntu Ob: Nruab Raspbian Siv Rufus
Ntu Ob: Nruab Raspbian Siv Rufus

khiav rufus xaiv koj daim npav SD hauv thawj daim ntawv xaiv cov duab raspbian rau.iso/.img xaiv pib thiab tos kom nws ua tiav.

Kauj Ruam 3: ntu Peb: Txuas rau Pi

tom qab ua tiav rub tawm daim npav SD, muab tso rau hauv daim npav sd daim npav ntawm tus pi, nws nyob ntawm "hauv qab" ntsaws rau hauv HDMI qaum rau pi ua ntej, dua li cov keyboard thiab nas, thiab lub zog txuas kawg. yog tias koj ntsaws rau hauv hwj chim ua ntej nws yuav tsis sau npe koj lub monitor/tv.

Kauj ruam 4: ntu plaub: Teeb Koj Li Nyiaj

nkag mus rau pi! ua thawj qhov teeb tsa! tsis txhob hla nws! xaiv Tebchaws Asmeskas cov keyboard lossis koj yuav tsis pom koj tus cim @ tom qab… yog tias koj tsis yog koj tus cim @ yog qhov twg koj yog "nkag mus rau hauv koj lub wifi ntawm pi tsis hloov tshiab. Kuv muaj qhov laj thawj. ntaus" windows keyboard "thiab mus rau qhov nyiam, mus rau pi teeb tsa. mus rau ntu cuam tshuam.

pab VNC…. thiab txhua tsav txhua yam tsis reboot.

Kauj Ruam 5: Ntu Tsib: Teeb Koj Li Pi Li Lub Taub Hau (Qhov Zoo Tshaj Plaws)

Ntu Tsib: Teeb Koj Li Pi Li Headless (Qhov Zoo Tshaj Plaws)
Ntu Tsib: Teeb Koj Li Pi Li Headless (Qhov Zoo Tshaj Plaws)

saib rau sab xis saum toj ntawm koj lub vijtsam. koj yuav pom lub logo dub thiab xiav VNC. qhib ntawd. ntaus nkag rau hauv, ua thiab tus account. add pib. ntawm koj lub desktop/laptop qhib browser tshawb hauv google VNC tus saib download rub tawm nruab. nkag mus rau hauv koj tus account. txheeb xyuas koj tus email rau kev nkag mus thiab tso cai rau koj tus kheej. txuas rau koj tus pi (ntaus tus lej pi ntawm tus lej nkag mus thib ob) yog tias nws ua haujlwm tua koj tus pi. unplug koj pi thiab txhua yam. muab tus pi tso rau hauv kaum tsev hauv koj chav thiab tsuas yog siv lub hwj huam txuas rau nws. koj tuaj yeem txuas rau pi siv VNC tus saib. tam sim no koj muaj "headless" pi. koj tseem tuaj yeem SSH rau nws. (saib SSH cov ntaub ntawv hauv ntu khoom txias)

Kauj Ruam 6: ntu Rau: Txhim Kho Txhua Qhov Cuab Yeej Cuab Yeej rau Kev Tsim Kho ntawm Pi

Ntu Rau: Txhim Kho Txhua Qhov Cuab Yeej Cuab Yeej rau Kev Tsim Kho ntawm Pi
Ntu Rau: Txhim Kho Txhua Qhov Cuab Yeej Cuab Yeej rau Kev Tsim Kho ntawm Pi

siv SSH lossis VNC (lossis yog tias koj txiav txim siab tsis txias thiab teeb nws lub taub hau) ua cov hauv qab no. qhib davhlau ya nyob twg (ntu tom ntej no yuav siv sijhawm me ntsis….) khiav cov lus txib no ib zaug tom qab txhua tus ua tiav.

sudo apt-tau hloov tshiab; sudo apt-tau hloov kho txhim kho ffmpeg {sudo apt-tau nruab ffmpeg

Kauj Ruam 7: ntu Xya: Txhim Kho Adafruit WebIDE

Ntu Xya: Txhim Kho Adafruit WebIDE
Ntu Xya: Txhim Kho Adafruit WebIDE

curl https://raw.githubusercontent.com/adafruit/Adafruit-WebIDE/master/scripts/install.sh | sudo sh qhib qhov browser ntawm koj lub desktop loj. taw tes koj tus browser URL rau "https://***.*.*.***: 8080" hloov qhov "*" nrog koj Pi tus IP chaw nyob. ua tus username thiab dhau. koj tam sim no muaj adafruit webIDE teeb tsa.

Kauj Ruam 8: ntu Yim: Hloov Kho Node-liab thiab Node.js

hloov tshiab-nodejs-thiab-nodered tus lej tom ntej yuav ua rau nodered khiav ntawm kev pib ib yam li adafruit webIDE, qhov no yog qhov tseem ceeb yog tias koj xav txhim kho ntawm cov no. sudo systemctl pab kom nodered.service rov pib dua Pi

Kauj Ruam 9: ntu cuaj: Txhim Kho Arduino IDE

Ntu cuaj: Txhim Kho Arduino IDE
Ntu cuaj: Txhim Kho Arduino IDE

koj tuaj yeem ua nws ntawm kab hais kom ua tab sis…. nws yuav tsis yog tag nrho version.. lub ntsiab lus koj tsis tuaj yeem siv lub tsev qiv ntawv ntshuam/tshawb cov cuab yeej, txhawm rau txhim kho tag nrho cov version koj yuav tsum mus rau arduino lub vev xaib thiab rub tawm cov ntawv rau koj tus qauv pi. nws yuav yog ARM32bit rau pi3, tau txais kev tso tawm ruaj khov. qhib lub davhlau ya nyob twg. (hloov *nrog cov ntaub ntawv tso tawm) khiav cov lus txib no.

www.arduino.cc/en/Main/Software

cd Rub tawm/tar -xf arduino-1.*.*-linuxarm.tar.xz sudo mv arduino-1.*.*/opt sudo /opt/arduino-1.*.*/install.sh

Kauj ruam 10: Tshooj Kaum: Ffmpeg

Ntu Kaum: Ffmpeg
Ntu Kaum: Ffmpeg

1x webcam logitech

(cov khoom tom ntej no tsis suav nrog yam koj xav tau los ua 24/7 kwj) 1x daim ntawv qhia zaub mov thib ob raspberry pi qauv 3 b (nrog daim npav SD) tus kheej tuaj yeem hais qhia LED sawb. arduino nano jumper hlau pab VNC tus saib ntawm ob tus Pi (s)

pi nyiam, pab vnc ua tus lej nrog VNC tus saib TSEEM CEEB: ntawm tus pi koj npaj yuav siv los ua pej xeem ua haujlwm raug tshem tawm, mus rau vnc server chaw teeb tsa, xaiv, tus kws tshaj lij tab, thiab ua haujlwm tsis ua haujlwm: 0 vib nas this, nws tau teeb tsa kom kaw Vnc saib yog tsis ua haujlwm tom qab ib teev, ua qhov no yuav nres koj lub qhov rais los ntawm kaw nruab nrab kwj nruab vnc saib ntawm streamer pi hauv davhlau ya nyob twg.

sudo apt-tau nruab vnc-java y

ntsaws rau hauv koj lub webcam thiab.. nruab koj lub webcam.

sudo apt nruab fswebcam

nruab ffmpeg sudo apt-tau nruab ffmpeg y

qhov no yog qhov uas koj tus kheej xaiv los ua si. hauv davhlau ya nyob twg, khiav cov ntawv no kom qhib lub qhov rai ntawm koj lub kwj deg lub desktop rau koj lub vev xaib.

ffplay -window_title "pi -cam" /dev /video0 -video_size 1920x1080 -vf qoob loo = 400: 500: 300: 50 -framerate 20 ffplay yuav tso cai rau koj pom qhov no hauv lub qhov rais npe pi -cam, lub webcam nws qhia koj yog ntawm qhov chaw dev/video0 thiab nws qhov loj me yog 1920x1080. Kuv tsuas xav pom cov qoob loo = dav: qhov siab: topleft_X: topleft_Y thiab tus lej 20 yog txaus rau kuv. tus lej tom ntej yuav ntws rau twitch.

ffmpeg -f x11grab -video_size 1280x1024 -framerate 24 -i $ DISPLAY -f alsa -vf scale = 1280x720 -c: v h264 -g 24 -b: v 2M -preset ultrafast -c: aac -pix_fmt yuv420p -f flv " rtmp: //live-lax.twitch.tv/app/ (insertyourstreamkeyhere)"

-f x11grab yog siv los tuav koj lub vijtsam. kuv lub vijtsam daws teeb meem tau teeb tsa rau 1280x1024 Kuv xav pom qhov ntawd hauv 1280x720 yog li -vf video hom ntawv.

2m = 2mgb upload tus nqi. -f flv yog los teeb tsa cov vis dis aus rau hauv.flv yog li twitch tuaj yeem siv nws.

tam sim no koj tuaj yeem muab koj pab pawg koj li VNC daim ntawv pov thawj rau lub chaw ua haujlwm Pi thiab lawv tuaj yeem pom qhov kev hloov pauv ntawm cov coj coj los nyob deb. Shout-out rau tus txiv neej no ~! nws cov vis dis aus pab kuv taug kev, Kuv tseem yuav tsum txiav txim siab yuav ua li cas pop hauv kuv lub vev xaib txawm hais tias… thiab paub txog ffmpeg X/

Arthur Reeder https://www.youtube.com/embed/kb_5_9GkwZc NCO TSEG: Kuv tsis yog tus neeg paub tshaj plaws, qhov no yooj yim ua haujlwm rau kuv cov kev xav tau, yog tias leej twg muaj cov lus qhia tsim nyog kuv xav hnov nws tab sis thov tsis txhob txhais tau tias yog ib txoj hauv kev uas yuav ua tau txuas ntxiv mus no, yuav yog siv cov kws kho tshuab los ua qhov no, thiab siv lwm tus pi thiab chrome txuas ntxiv lub teeb kom mus nqa cov dej ntawd thiab dua li pub lub webcam rau hauv lossis lwm txoj hauv kev. https://www.youtube.com/embed/kb_5_9GkwZc ALSO: yog tias koj xav ntxiv hauv suab, raws li pom hauv tus txiv neej youtube video, koj tuaj yeem siv txoj hlua no, Kuv tsis xav kom kuv lub tsev raug kaw thiab xa mus rau twitch, qhov no tau zaum hauv kuv chav yog li kuv tsis tso cov suab, nws kuj tseem pab txo lub nra ntawm pi.

ffmpeg -f x11grab -video_size 1280x1024 -framerate 24 -i $ DISPLAY -f alsa -i default -af acompressor = threshold = 0.089: ratio = 9: attack = 200: release = 1000 -vf scale = 1280x720 -c: v h264 - g 24 -b: v 2M -preset ultrafast -c: aac -pix_fmt yuv420p -f flv "rtmp: //live-lax.twitch.tv/app/ (insertyourstreamkeyhere)"

Kauj ruam 11:

Duab
Duab
Duab
Duab
Duab
Duab
Duab
Duab

tam sim no mus rau qhov kawg ncab, siv arduino thiab pi kev sib txuas lus txuas nrog nab hab sej.

--- leej twg yog lub tsev project --- Txoj haujlwm siv cov ntawv nab nab uas ua haujlwm nmap hauv davhlau ya nyob twg, luam cov ntsiab lus ntawm qhov ntawd, txheeb tawm cov ntawv peb tsis xav tau, thiab sib piv cov mac chaw nyob ntawm lub network tiv thaiv cov npe mac chaw nyob thiab yog tias muaj kev sib tw uas tus neeg ntawd nyob hauv tsev. cov chaw nyob mac tau pom los ntawm kev tshawb nrhiav haujlwm ntawm lub router, tab sis lub cuab yeej nmap muab cov ntaub ntawv rau koj txog cov khoom siv hauv cov ntawv uas tau tsim los ntawm txoj cai. yog tias tus neeg siv nyob tam sim no, nws xa tus cim rau arduino, thiab arduino tos kom txog thaum daim ntawv teev npe ua tiav, thiab teeb LEDs sib xws rau cov ntaub ntawv teev tseg rau mac chaw nyob ntawm cov khoom siv tam sim no. koj tuaj yeem ntxiv lwm yam, xws li muaj kev tsis sib haum xeeb bots khiav cov lus txib thaum tib neeg tuaj lossis mus nrog tib txoj cai no los ntawm kev siv tus txheej txheem txheej txheem los ua cov lus txib dav dav hauv koj li ntawv nab npawb. yog li ua ntej peb nruab nmap sudo apt-tau nruab nmap. tom ntej no koj yuav xav rub cov ntaub ntawv ntawm peb cov koom haum Git-Hub.

github.com/ValenciaRobotics/embeddedclub

rau tus nab npawb nab npawb, kev teeb tsa raspbian los nrog txhua yam siv hauv tus lej no, yog li koj tsis xav tau dab tsi ntxiv teeb tsa. peb siv ntshuam re, ntshuam cov txheej txheem, lub sijhawm ntshuam, ntshuam nws tseem ceeb heev uas yuav tsum nco ntsoov tias nab hab sej siv qhov kev nkag mus rau cais tawm cov lej thaiv, yog li yuav tsum paub txog qhov ntawd yog tias koj txiav txim siab hloov txoj kev sau ntawv:) lub py los nrog thonny lub tswv yim thiab ob peb lwm txoj kev xaiv, kuv pom tias kev sau cov ntawv hauv thonny yog ncaj nraim rau tom ntej, yog tias koj nyem rau ntawm cov ntawv thiab sim ua kom tiav nws, nws tau qhia lossis xav tias thonny yog yam koj xav siv. ua ntej koj pib qhov program, koj yuav tsum tau kho cov hauv qab no. kab 14: cov cim * tau siv los npog kuv tus kheej cov ntaub ntawv router, koj yuav tsum hloov qhov ntawd nrog koj tus kheej lub ip. nws yuav zoo ib yam li qhov koj siv los txuas rau koj lub router. kab 28, 38, 48, 58: tag nrho cov no siv lub cim * los npog lub cuab yeej mac chaw nyob uas tau teev tseg los ntawm kuv lub network, koj yuav tsum hloov cov ntawd mus rau mac chaw nyob ntawm cov khoom siv ntawm koj tus kheej lub network txhawm rau txheeb xyuas kev sib txuas. vim li cas mac chaw nyob? vim tias tsis muaj chaw tshwj tseg rau koj lub cuab yeej, lawv paub tseeb tias yuav nyob zoo ib yam tshwj tsis yog tias ib tus neeg dag. teeb meem nrog cov cai no, nws yuav tsuas pom thaum qhov kev sib txuas tau nquag siv internet, yog li nws yuav tsis pom txawm tias muaj tus neeg siv tam sim no. hauv cov lej arduino, koj yuav xav hloov cov hauv qab no. ua ntej, koj yuav xav mus rau cov cuab yeej tab, xaiv tus thawj tswj tsev qiv ntawv, thiab tshawb rau "fastLED" thiab nruab lub tsev qiv ntawv rau "fastLED". tom ntej no koj yuav tsum tau thauj tus "leej twg yog tsev".ino code los ntawm nplooj ntawv github thiab hloov cov hauv qab no raws li koj xav tau. kab 86: hloov xim raws li qhov koj xav kom koj cov neeg siv txuas nrog:)

// qhib qhov koj xav tau

yog (d == 1) {leds [0] = 0xdd8bff; // ntshav liab [1] = 0xdd8bff;}

yog (l == 1) {leds [2] = CRGB:: Green; leds [3] = CRGB:: Ntsuab;}

yog (k == 1) {leds [4] = CRGB:: Liab; leds [5] = CRGB:: Liab; }

yog (j == 1) {leds [6] = CRGB:: Blue; leds [7] = CRGB:: Blue;}

FastLED.show (); ncua (30000); // 10 thib ob tos ntawm cov ntaub ntawv hloov pauv piav qhia luv luv yuav ua li cas ntxiv cov neeg siv ntau dua yog cov hauv qab no

void voj () {

yog (Serial.available ()> 0) {

Serial.println ();

tus neeg = Serial.read ();

ncua (1000);

hloov (neeg) {

case'D ': d = 1;

tus neeg = 'F';

suav = suav+1;

tawg;

cas ':

d = 0;

tus neeg = 'F';

suav = suav+1;

tawg;

lub D loj yog qhov tau txais los ntawm tus nab npawb tsab ntawv, yog li nws paub tias tus neeg siv tam sim no vim tias tsab ntawv tau txais yog tus ntawv D, yog li nws hloov tus nqi ntawm INTEGER d rau 1, yog tias nws yog tus ntawv tsawg dua nws paub lawv tsis tuaj yeem yog li INTEGER tau teeb tsa 0. qhov xwm txheej rau teeb pom kev zoo hauv kab ntawv los ntawm ua ntej siv nqe lus hais tias YOG d yog 1 dua li nws yuav ua rau lub teeb coj, tab sis yog tias nws tsis yog qhov uas nyob qis qis li "dub" lub ntsiab lus tsis zoo. txoj cai no siv lub tsev qiv ntawv "fastLED" thiab muaj ntau cov ntaub ntawv hais txog qhov no. nco ntsoov tias yog tias koj hloov cov cim, ntxiv cov cim lossis tshem cov cim koj yuav tau hloov cov ntawv sej kom rov qab cov uas koj tau hloov lawv ib yam, koj tseem yuav tau hloov qhov xwm txheej hauv lub voj void. yog (suav == 4) {holdup ();}} suav yuav tsum muaj kev cuam tshuam tus naj npawb ntawm cov cuab yeej koj "taug qab". hauv kuv qhov xwm txheej nws yog 4, yog li nws tos kom txog thaum 4 lub cuab yeej tau tshaj tawm tias tam sim no lossis tsis tuaj thiab tom qab ntawd nws hloov kho cov kab hluav taws xob LED. nyob rau hauv nab hab sej kab, kab 31, 34, 41, 44, 51, 54, 61, 64 muaj cov kab hauv qab no.write (b ' *') #xa cov ntawv pov thawj raws li byte hla ntu qhov twg * yog tus cim nws yog xa mus rau arduino. hloov qhov no yog tias koj hloov cov cai hauv arduino lossis hloov pauv:)

Ib zaug ntxiv, raws li cov lus tshaj tawm, Kuv xav muab credit rau kuv tus phooj ywg pab pawg Jon, nws tau ua haujlwm zoo ntawm kev khaws cov slack thaum peb xav tau.

nws Python Script tau muab los ntawm: Jonathan De La Cruzh

Arduino Script thiab taug kev hla thiab teeb tsa lub tsev kuaj ntshav tau ua los ntawm: Dylan Poll

www.linkedin.com/in/dylan-poll-4a324a1a2/

Vam tias peb yeej tsawg kawg yog lub tsho tshaj sab! Kuv yuav hloov kho qhov no nrog lub plhaub lus txib kom pib rub tawm thiab teeb tsa feem ntau ntawm qhov no, peb cov koom haum lub vev xaib tau muaj cov ntawv rub tawm plhaub los ua cov haujlwm ffmpeg.

Txoj haujlwm no siv sijhawm ntau, Kuv tau tsim qhov kev sib faib ntawm cov sibntsib los hauv av yog li kuv tuaj yeem hais khov kho lub sijhawm no ua rau kuv muaj kev xyiv fab ntau.:) ua tsaug rau koj lub sijhawm, peb muaj lub platform ua haujlwm los txhim kho tam sim no hauv kuv lub club vim yog txoj haujlwm no.

Pom zoo: