Cov txheej txheem:

Yooj Yim Lub Sijhawm Lapse Lub Koob Yees Duab Siv Raspberry Pi: 3 Kauj Ruam
Yooj Yim Lub Sijhawm Lapse Lub Koob Yees Duab Siv Raspberry Pi: 3 Kauj Ruam

Video: Yooj Yim Lub Sijhawm Lapse Lub Koob Yees Duab Siv Raspberry Pi: 3 Kauj Ruam

Video: Yooj Yim Lub Sijhawm Lapse Lub Koob Yees Duab Siv Raspberry Pi: 3 Kauj Ruam
Video: ua dej poob tsag zoo nkauj heev hauv iclone yooj yooj yim 2024, Kaum ib hlis
Anonim
Yooj Yim Sijhawm Lapse Lub Koob Yees Duab Siv Raspberry Pi
Yooj Yim Sijhawm Lapse Lub Koob Yees Duab Siv Raspberry Pi

Cov ntawv tshaj tawm no yuav qhia koj yuav ua li cas koj tuaj yeem tsim lub koob yees duab lub sijhawm yooj yim siv Raspberry Pi. Kev daws teeb meem, sijhawm thiab sijhawm tuaj yeem hloov kho tau yooj yim hauv tsab ntawv. Peb tau tsim qee yam zoo sib xws siv ESP32-CAM pawg thawj coj tab sis Raspberry Pi lub koob yees duab zoo dua li qhov ntawd thiab yog li cov txiaj ntsig kuj tseem zoo dua li qhov ua ntej.

Cov vis dis aus saum toj no muab cov ntsiab lus ntawm yuav ua li cas txhua yam tuaj ua ke. Kuv yuav pom zoo saib nws ua ntej kom nkag siab zoo tias koj tuaj yeem ua thiab hloov kho qhov haujlwm no li cas.

Kauj Ruam 1: Npaj Raspberry Pi

Npaj Raspberry Pi
Npaj Raspberry Pi
Npaj Raspberry Pi
Npaj Raspberry Pi
Npaj Raspberry Pi
Npaj Raspberry Pi

Koj tsis xav tau zaub rau qhov haujlwm no tab sis kuv txiav txim siab siv ib qho los qhia koj li cas cov ntawv sau ua haujlwm. Kuv kuj tseem yuav siv Raspberry Pi 3 hauv qhov piv txwv no, tab sis qhov no yuav ua haujlwm nrog txhua yam sib txawv uas txhawb nqa siv lub koob yees duab.

Thawj qhov koj yuav tsum tau ua yog rub cov duab Raspbian. Kuv siv Raspbian Desktop version raws li kuv xav nkag mus rau Raspberry desktop los qhia koj cov ntaub ntawv thiab xws li. Yog li yog tias koj npaj yuav siv cov zaub tom qab ntawd kuv xav kom rub tawm qhov ntawd ib yam. Tom ntej no, koj yuav tsum nyem cov duab mus rau daim npav microSD haum thiab rau qhov no, Kuv xav kom siv Etcher. Kuv txiav txim siab siv WiFi hloov chaw ntawm Ethernet txuas thiab kuv kuj txiav txim siab SSH rau hauv pawg thawj coj los tswj nws. Hloov chaw ua qhov no, koj tseem tuaj yeem txuas cov keyboard rau Raspberry Pi thiab ua tiav txhua cov lus txib ncaj qha los ntawm lub davhlau ya nyob twg. Qhov kev xaiv yog koj li.

Yog tias koj npaj yuav siv SSH hla WiFi, tom qab ntawd koj yuav tsum tsim cov ntaub ntawv nrog cov ntsiab lus hauv network. Koj tuaj yeem rub tawm cov ntawv ua piv txwv los ntawm qhov txuas hauv qab no kom pib. Tsuas qhib nws siv cov ntawv sau zoo li notepad ++ lossis Sublime Text thiab tom qab ntawd sau koj lub teb chaws tus lej, lub npe network thiab tus password. Thaum ua tiav, khaws cov ntawv thiab luam nws mus rau khau raj tsav ntawm Raspberry Pi. Txhawm rau pab SSH, koj tsuas yog yuav tsum tsim cov ntaub ntawv uas tsis muaj lub npe ssh thiab muab tso rau hauv lub khau raj tsav. Koj tsis tas yuav ntxiv ib qho txuas ntxiv. Thaum ua tiav, koj tuaj yeem ntxig daim npav microSD, txuas txhua yam thiab khau raj Raspberry Pi.

WPA Template File:

Raws li tuaj yeem pom hauv cov vis dis aus, cov lus daws teeb meem thaum pib tsis raug thiab kuv yuav tsum ntxiv qhov teeb meem HDMI kom raug kom nws ua haujlwm. Qhov no nyob ntawm cov zaub koj siv yog li kuv yuav tsis sau cov lus ntawm no, tab sis koj tuaj yeem xa mus rau cov vis dis aus thiab cov duab yog tias koj txaus siab.

Qhov txuas ntxiv peb yuav tsum tau ua yog qhib lub davhlau ya nyob twg ntawm koj lub computer thiab SSH rau hauv pawg thawj coj los ntawm kev siv nws tus IP chaw nyob. Koj tuaj yeem siv software zoo li AngryIP scanner kom tau txais pawg thawj coj saib IP chaw nyob. Tom qab ntawd, qhib lub davhlau ya nyob twg thiab ntaus "ssh [email protected]" tab sis nco ntsoov hloov tus IP chaw nyob kom haum rau ib qho rau koj pawg thawj coj. Koj yuav tsum nkag mus rau tus password thiab tus password tsis raug yog "raspberry". Tom qab ntawd, peb yuav tsum qhib lub koob yees duab thiab qhov no tuaj yeem ua tiav los ntawm kev khiav "sudo raspi-config" hais kom ua. Lub koob yees duab xaiv tau teev nyob hauv qab cov kev xaiv cuam tshuam thiab ib zaug ua haujlwm, koj yuav tsum rov pib dua lub rooj tsavxwm.

Kauj Ruam 2: Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv

Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv
Kuaj Lub Koob Yees Duab thiab Sau Tsab Ntawv

Ua ntej peb sau tsab ntawv, nws raug nquahu kom paub tseeb tias lub koob yees duab ua haujlwm li cas. Txhawm rau ua qhov no, tsuas yog SSH rov qab rau hauv pawg thawj coj saib thiab tom qab ntawv ua haujlwm "raspistill -o test.jpg". Qhov no yuav ntes cov duab thiab khaws cia rau hauv phau ntawv teev npe tam sim no nrog lub npe test.jpg. Tom qab ntawd koj tuaj yeem ua haujlwm "ls" hais kom ua yog tias cov ntaub ntawv raug tsim. Khiav cov lus "ls" yuav teev tag nrho cov ntaub ntawv thiab cov ntawv tais ceev tseg uas muaj nyob hauv phau ntawv teev npe tam sim no. Yog tias muaj cov ntaub ntawv nyob ntawd koj tuaj yeem paub tseeb tias lub koob yees duab ua haujlwm tau raug.

Tom ntej no, peb yuav tsum sau tsab ntawv thiab qhov no tuaj yeem ua tiav los ntawm kev khiav "sudo nano time-lapse.sh" hais kom ua, uas yuav qhib cov ntawv sau. Tom qab ntawd koj yuav tsum ntaus hauv qab no raws li qhia hauv daim duab:

#!/bin/tsoo

raspistill -t 20000 -tl 1000 -w 1920 -h 1080 -o /home/pi/images/img%05d.jpg

Qhov no ua rau pawg thawj coj saib xyuas cov duab txuas ntxiv mus rau 20 vib nas this (20000ms), ntawm ib ntus ntawm 1 thib ob (1000ms). Nws tseem piav qhia qhov kev daws teeb meem ntawm 1920x1080 thiab tseem qhia txog qhov chaw uas cov duab yuav tsum khaws cia. Qhov "%05d" qhia meej tias cov npe duab yuav tsum muaj tag nrho 5 tus lej nrog tus lej zeros. Thaum ua tiav, tsuas yog khaws cov ntawv los ntawm nias "CTRL+X", tom qab ntawd "Y" thiab tom qab ntawd "Enter" qhov tseem ceeb.

Tom qab ntawd peb yuav tsum ua tsab ntawv ua haujlwm uas tuaj yeem ua tiav los ntawm kev khiav "sudo chmod +x time-lapse.sh" hais kom ua. Ua ntej peb tuaj yeem sau tsab ntawv, peb yuav tsum tsim cov npe kab ntawv, thiab qhov no tuaj yeem ua tiav los ntawm kev khiav "mkdir dluab '. Tom qab ntawd koj tuaj yeem kuaj cov ntawv los ntawm kev khiav"./time-lapse.sh "hais kom ua. tom qab ntawd yuav ntes 20 cov duab thiab khaws cia rau hauv daim nplaub tshev duab.

Tom ntej no, peb yuav tsum siv tsab ntawv rau qhov no, peb yuav siv cov txheej txheem systemd peb tau siv hauv cov ntawv dhau los uas peb tsim lub koob yees duab IP. Peb xub yuav tsum tau ua cov lus txib hauv qab no "sudo nano /etc/systemd/system/time-lapse.service" uas yuav qhib cov ntawv sau. Tom qab ntawd koj yuav tsum tau ntaus hauv qab no tab sis kuv xav kom yooj yim luam nws dua.

[Chav]

Kev piav qhia = sijhawm dhau mus

Tom qab = ntau-user.target

[Kev pabcuam]

Hom = yooj yim

ExecStart =/tsev/pi/sijhawm-lapse.sh

User = pib

WorkingDirectory =/tsev/pi

Rov pib dua = ntawm-ua tsis tiav

[Nruab]

WantedBy = ntau-user.target

Tom qab ntawd, koj tsuas xav tau khaws cov ntawv zoo li ua ntej thiab tom qab ntawd ua kom cov kev pabcuam los ntawm kev khiav "sudo systemctl pab lub sijhawm-lapse.service". Peb mam li rov pib dua cov ntawv. Thaum lub rooj tsavxwm khau raj, koj yuav pom nws ntes cov duab thiab khaws cia rau hauv qhov chaw.

Kauj Ruam 3: Kho Cov Ntawv Sau kom ntes tsis tau tas thiab txuag rau USB

Kho kom raug Tsab ntawv kom ntes tsis muaj hnub kawg thiab txuag rau USB
Kho kom raug Tsab ntawv kom ntes tsis muaj hnub kawg thiab txuag rau USB
Kho kom raug Tsab ntawv kom ntes tsis muaj hnub kawg thiab txuag rau USB
Kho kom raug Tsab ntawv kom ntes tsis muaj hnub kawg thiab txuag rau USB
Kho kom raug Tsab ntawv kom ntes tsis muaj hnub kawg thiab txuag rau USB
Kho kom raug Tsab ntawv kom ntes tsis muaj hnub kawg thiab txuag rau USB

Tsab ntawv tam sim no tsuas yog ntes cov duab rau thawj 20 vib nas this thiab yog tias peb xav tau kho nws kom nws ntes cov duab tas mus li. Txhawm rau ua qhov no, SSH rov qab rau hauv pawg thawj coj, tom qab ntawd nres qhov kev pabcuam los ntawm kev khiav "sudo systemctl nres lub sijhawm-lapse.service". Tom qab ntawd, qhib cov ntawv sau los ntawm kev khiav "sudo nano time-lapse.sh". Dhau tus nqi 0 mus rau tus chij "-t" vim qhov no yuav ua rau nws ntes cov duab tas mus li. Kuv kuj tau mus tom ntej thiab xiam cov duab saib ua ntej los ntawm kev ntxiv "-n" tus chij raws li tuaj yeem pom hauv daim duab. Tom qab ntawd koj yuav tsum khaws tsab ntawv thiab pib nws los ntawm kev khiav "sudo systemctl start time-lapse.service".

Koj tseem tuaj yeem hloov kho qhov chaw khaws cia rau USB drive. Ua ntej tshaj, ntsaws rau hauv USB tsav thiab qhib nws hauv Tus Thawj Tswj Ntaub Ntawv. Sau ntawv ceeb toom ntawm qhov chaw uas yuav tsum zoo ib yam li "/media/pi/USB_DRIVE_NAME". Tom qab ntawd, tsuas yog nres qhov kev pabcuam zoo li saum toj no thiab qhib nws los kho nws. Koj tuaj yeem hloov qhov chaw cia khoom. Xyuas kom tseeb tias daim nplaub tshev uas koj hais qhia muaj, yog tias tsis yog, tsim nws los ntawm kev siv mkdir hais kom ua. Thaum ua tiav, pib tsab ntawv dua thiab rov pib dua lub rooj tsavxwm. Nws yuav ntes thiab khaws cov duab rau qhov chaw tshiab.

Thaum koj tau txais cov duab, koj tuaj yeem siv ob peb daim ntawv thov sib txawv los hloov qhov no rau hauv video. Lub Sijhawm Lapse Tus Tsim yog ib daim ntawv thov uas tuaj yeem siv tau.

Yog li ntawd nws yooj yim npaum li cas los tsim lub koob yees duab lub sijhawm siv lub Raspberry Pi. Yog tias koj nyiam txoj haujlwm no, tom qab ntawv thov txiav txim siab txhawb nqa peb los ntawm kev sau npe rau peb YouTube channel.

YouTube:

Ua tsaug rau koj nyeem.

Pom zoo: