Cov txheej txheem:

Pi Bird: 5 Kauj Ruam
Pi Bird: 5 Kauj Ruam

Video: Pi Bird: 5 Kauj Ruam

Video: Pi Bird: 5 Kauj Ruam
Video: leej twg tej ntxhai - Mang Vang [ Official MV ] 2024, Kaum ib hlis
Anonim
Pi Noog
Pi Noog

Nws ua dab tsi: thaij duab noog thaum lub koob yees duab pi hnov qhov kev hloov pauv loj hauv daim duab pixels.

Peb yuav xav tau dab tsi

  • Raspberry Pi nrog daim npav SD ib txwm
  • Pi lub koob yees duab module
  • Cas cas
  • Noog feeder
  • Teeb ntawm lo ntsiab muag macro (xaiv tau)
  • 5V powerbank (yeem)
  • USB wifi dongle (yeem)

Peb yuav ua dab tsi

  • Nruab cov pob khoom xav tau ntawm daim duab tshiab
  • Thawb ib tsab ntawv los tshuaj xyuas lub koob yees duab rau cov khoom hla
  • Teeb tsa lub vev xaib yooj yim los xauj cov duab
  • Fiddle nrog tus noog noj thiab lo ntsiab muag kom ua kom pom tseeb

Kauj Ruam 1: Txhim Kho Cov Duab Tshiab thiab Pab Kom Lub Koob Yees Duab

Lob daim npav SD thiab teeb tsa koj cov duab nyiam. Cov ntaub ntawv hauv kab ntawv no yog ua raws li Raspbian-based faib tab sis yuav tsum ua haujlwm rau lwm tus nrog qee qhov kho.

Kuv tau xaiv Raspian Jessie Lite vim tsis xav tau lub desktop ib puag ncig ntawm txoj haujlwm no. Tej zaum koj yuav xav hloov kho qhov faib khoom thiab hloov tus password tsis raug. Tom qab ntawd:

  • pab lub koob yees duab module los ntawm kev xa tawm raspi-teeb tsa los ntawm kab hais kom ua.
  • lov tes taw lub koob yees duab liab LED los ntawm kev ntxiv disable_camera_led = 1 rau /boot/config.txt file: sudo echo "disable_camera_led = 1" >> /boot/config.txt
  • nruab Python Image Library (PIL): sudo apt-tau nruab -y python-imaging-tk
  • nruab pob khoom txhawb nqa lub teeb web server; muaj ntau txoj kev xaiv, piv txwv li: sudo apt-get install -y apache2 mysql-server php5 php5-mysql

Kauj Ruam 2: Teeb tsa Tsab Ntawv Tshawb Fawb Tsab Ntawv

Hauv txoj haujlwm no, lub koob yees duab tsis yog tsuas yog siv los kaw cov duab tab sis tseem txhawm rau txheeb xyuas thaum twg yuav tsum thaij duab. Qhov no ua tiav los ntawm kev siv cov duab daws teeb meem qis ntawm lub sijhawm tsis tu ncua thiab sib piv nws, pixel los ntawm pixel, nrog daim duab yav dhau los. Yog tias ob daim duab sib txawv sib txawv, daim duab puv loj raug coj los.

Qhov no ua tiav los ntawm tsab ntawv nab nab uas tuaj yeem rub tawm nrog wget https://www.fasyl.com/rpi/PiBird_motion_pic.py; chmod +x PiBird_motion_pic.py

Tsab ntawv no tau hloov kho los ntawm tsab ntawv thawj los ntawm cov paj hlwb ntawm kab lus no rapsberrypi.org.

Koj tuaj yeem kho kab #25 kom txuag tau cov duab rau lwm qhov chaw.

Txhawm rau khiav cov ntawv sau cia thaum pib, ntxiv txoj haujlwm cron. Yog tias koj tsis paub yuav ua li cas, khiav: sudo sh -c 'crontab -l> 2del && echo "@reboot` pwd`/PiBird_motion_pic.py ">> 2del && crontab 2del && rm 2del'.

Kauj ruam 3: Teeb Web Server

Muaj ntau txoj hauv kev kom txaus siab rau cov duab, koj tuaj yeem hloov lawv los ntawm SSH lossis khaws cia rau ntawm USB tsav. Kuv txiav txim siab tshuaj xyuas lawv los ntawm lub vev xaib yooj yim thiab rub tawm cov uas kuv nyiam los ntawm kuv tus browser.

Txhawm rau teeb tsa qhov web interface yooj yim, ntaus: wget -O /var/www/index.php https://www.fasyl.com/rpi/PiBird_list_pics.php; rm /var/www/index.html

Qhov no ua haujlwm zoo tshaj plaws los ntawm kev nkag mus rau lub web server los ntawm WiFi. Txhawm rau ua qhov no, koj yuav tsum teeb tsa lub wireless interface. Muaj ntau txoj hauv kev los ua qhov ntawd nyob ntawm Pi thiab dongle koj siv.

Kauj Ruam 4: Muab tag nrho ua ke

Muab Tso Ua Ke
Muab Tso Ua Ke

Zoo, Raspberry Pi yog tam sim no npaj txhij rau snap duab. Cias khiav./PiBird_motion_pic.py thiab ntaus ob peb yam. Tam sim no, yog tias koj xaub mus rau koj tus IP tus IP, koj yuav tsum pom koj cov duab thawj zaug.

Nws yog lub sijhawm los muab txhua yam tso ua ke. Koj yuav zoo li yuav tsum hloov kho qhov no raws li koj lub cuab yeej siv tiag.

Txhawm rau tiv thaiv Pi tiv thaiv tshav ntuj thiab nag, koj yuav tsum muab nws tso rau hauv rooj plaub thiab kaw ib qho qhib loj nrog daim kab xev, thiab lwm yam.

Kuv siv tus noog noj no nrog ob sab qhib, yooj yim heev thauj lub koob yees duab ntawm ib sab thiab cia cov noog tuaj thiab pub los ntawm lwm qhov.

Txhawm rau kom ua kom pom tseeb ntawm qhov chaw raug thiab thav duab kom zoo, Kuv tau siv lub koob yees duab lub hauv paus macro lens txuas rau lub khob yogurt nrog nws cov hauv qab txiav-deb. Me ntsis hacky tab sis nws ua haujlwm zoo. Koj tuaj yeem tau txais txiaj ntsig zoo siv qee lub xov tooj pheej yig lub koob yees duab lo ntsiab muag.

Muaj cov ntaub ntawv tawm muaj txog yuav ua li cas txhawm rau kho lub koob yees duab kom pom tseeb los ntawm kev tig lub lens teeb tsa; nws tsis ua haujlwm rau kuv: qhov nyuaj heev kom khov kho mus rau lub cev me me thiab tig nws.

Nws yuav siv qee qhov kev sim kom tau txais cov kab thiab tsom mus rau qhov yog; thaum fiddling, koj tuaj yeem yooj yim snap daim duab xeem nrog raspistill -o test.jpg.

Thaum kawg, koj yuav tsum txiav txim siab yuav ua li cas muab lub zog rau koj Pi; pob 5V roj teeb tej zaum yog qhov kev xaiv zoo tshaj plaws.

Kauj Ruam 5: Cia Snap Qee Cov Noog

Cia Snap Qee Cov Noog
Cia Snap Qee Cov Noog

Zoo, tag nrho cov teeb.

Nws yog lub sijhawm los txhawm rau txhua yam sab nraud, thauj cov khoom noj nrog cov noob thiab tos kom cov neeg tuaj ya ya tuaj.

Muaj kev lom zem!

Pom zoo: