Cov txheej txheem:

Kas Fes Tshuab Tracker Nrog Raspberry Pi thiab Google Ntawv: 5 Kauj Ruam
Kas Fes Tshuab Tracker Nrog Raspberry Pi thiab Google Ntawv: 5 Kauj Ruam

Video: Kas Fes Tshuab Tracker Nrog Raspberry Pi thiab Google Ntawv: 5 Kauj Ruam

Video: Kas Fes Tshuab Tracker Nrog Raspberry Pi thiab Google Ntawv: 5 Kauj Ruam
Video: Часы G-Shock до 250 долларов-15 лучших часов Casio G до 250 доллар... 2024, Hlis ntuj nqeg
Anonim
Image
Image
Kas Fes Tshuab Tracker Nrog Raspberry Pi thiab Google Ntawv
Kas Fes Tshuab Tracker Nrog Raspberry Pi thiab Google Ntawv

Cov lus qhia no yuav qhia koj yuav ua li cas tsim Raspberry Pi-based tracker rau lub tshuab kas fes sib koom hauv koj qhov chaw ua haujlwm. Siv tus tracker OLED zaub thiab cov khoom siv hloov pauv, cov neeg siv tuaj yeem teev npe lawv cov kas fes noj, pom lawv cov nyiaj tshuav thiab sau npe lawv cov nyiaj.

Koj qhov system yuav tuaj yeem ua tau

  • nyeem/sau cov ntaub ntawv los ntawm/rau Google Daim Ntawv
  • tso saib cov npe neeg siv
  • sau cov kas fes noj ntawm cov neeg siv
  • sau cov nyiaj them ntawm cov neeg siv
  • qhia qhov sib npaug ntawm cov neeg siv

Khoom siv

  • (1x) Raspberry Pi Zero W (Wireless)
  • (1x) Micro USB Cable
  • (1x) 8GB Micro SD Memory Card
  • (1x) 128x64 Monochrome OLED Graphic Display
  • (1x) 2x20 Poj Niam Headers (2.54)
  • (3x) Mechanical Keyboard Hloov
  • (3 x) Keycap
  • (1x) Custom-built PCB (Koj tuaj yeem pom cov qauv thiab PCB tsim ntawm no.)

Kauj Ruam 1: Sib dhos Cov Khoos Phis Tawj

Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse

Tom qab tau txais tag nrho cov khoom tau teev tseg hauv ntu dhau los, koj npaj tau los sib sau koj cov cuab yeej. Hauv cov kauj ruam no, koj yuav ua qee yam soldering.

  • Solder tus 2x20 tus pin rau qhov kev cai tsim ua PCB.
  • Muab cov OLED tso rau ntawm PCB uas tau tsim.
  • Solder cov khoom siv hluav taws xob hloov pauv mus rau PCB kev cai tsim.
  • Yog tias koj lub Raspberry Pi tsis muaj lub taub hau, koj kuj tseem yuav xav tau txuas 2x20 Txiv neej lub taub hau rau koj Raspberry Pi.

Thiab, koj tau ua tiav nrog kho vajtse!

Kauj Ruam 2: Kho Koj Tus Raspberry Pi

Kho koj li Raspberry Pi
Kho koj li Raspberry Pi

Hauv qib no, koj yuav teeb tsa koj li Raspberry Pi. Peb yuav ua raws li kev teeb tsa tsis muaj lub taub hau, txhais tau tias koj yuav tsis xav tau tus saib xyuas/keyboard/nas teeb rau Rasberry Pi.

  • Rub tawm thiab sau cov duab Rasbian rau koj daim npav Micro SD. Koj tuaj yeem pom cov lus qhia ntxiv ntawm no.
  • Pab kom SSH ntawm koj Rasberry Pi. Ntawm no, koj tuaj yeem pom yuav ua li cas hauv kev teeb tsa lub taub hau.
  • Txuas koj lub taub hau Raspberry Pi rau koj li WiFi siv qhov txuas no.

Txij ntawm no mus, koj yuav tsum muaj peev xwm SSH rau hauv koj li Raspberry Pi. Txawm li cas los xij, koj yuav tsum txheeb xyuas tus IP chaw nyob ntawm koj tus Raspberry Pi, uas koj tuaj yeem pom siv koj lub router lub vev xaib.

Yog tias koj tsis paub nrog SSH, koj tuaj yeem siv qhov txuas no kom paub ntau ntxiv

Yog tias koj ua tiav nrog SSH kev sib txuas, koj npaj tau teeb tsa lub software rau tus neeg taug qab!

Kauj Ruam 3: Teeb Teem Software

Ua ntej txhim kho software, koj yuav tsum tsim koj li Google Spreadsheet thiab tau txais koj tus lej API. Koj tuaj yeem siv daim ntawv nthuav qhia no ua piv txwv los tsim koj li. Yog tias koj ua raws cov lus qhia no, koj tuaj yeem tsim koj li API tus lej hauv tsawg dua 5 feeb. Tom qab qhov kev qhia kawg, koj yuav tsum tau rub tawm JSON cov ntaub ntawv. Koj yuav tsum hloov lub npe JSON cov ntaub ntawv mus rau 'secret.json' txhawm rau nws ua haujlwm nrog cov software muab.

  • Rub tawm cov ntawv cofee_tracker.zip thiab unzip nws.
  • Muab cov ntawv zais.json tso rau hauv daim nplaub tshev unzipped (coffee_tracker).

Koj yuav tsum tau xa daim nplaub tshev rau koj li Raspberry Pi. Koj tuaj yeem ua qhov ntawd siv Cyberduck nrog SSH File Transfer Protocol (SFTP). Hloov daim nplaub tshev rau koj li Raspberry Pi lub tsev npe.

Kev taug qab software siv Python 3. Koj tsis tas yuav nruab nws tus kheej vim tias Raspberry Pi duab los nrog kev npaj ua ntej Python 3, tab sis thov nco ntsoov siv python3 hais kom ua es tsis txhob nab.

Ua ntej yuav khiav software koj yuav tsum teeb tsa qhov kev vam khom siv cov lus txib hauv qab no.

pip3 nruab gspread oauth2client

Kev taug qab software kuj xav tau Adafruit OLED Libraries. Koj tuaj yeem nruab lawv los ntawm kev ua raws cov lus qhia no.

Raws li cov kauj ruam kawg ntawm koj cov txheej txheem teeb tsa, koj yuav tsum hloov kho gdrive_controller.py hauv code_tracker nplaub tshev. Qhib cov ntawv thiab mus rau kab 13, raws li cov lus pom ntawm kab 12 hais tias, koj yuav tsum hloov daim ntawv teev npe mus rau qhov koj tau tsim rau koj daim ntawv thov.

Tam sim no, koj tau teeb tsa los sim nws!

Nkag mus rau lub kas fes_tracker nplaub tshev thiab khiav cov lus txib hauv qab no kom pib lub tracker.

cd ~/cofee_tracker

sej 3 main.py

Yog tias koj xav pib koj main.py txhua lub sijhawm koj Raspberry Pi khau raj, thov ua raws cov lus qhia no.

Kauj Ruam 4: Siv Koj Li Tracker

Siv Koj Tus Tracker!
Siv Koj Tus Tracker!
Siv Koj Tus Tracker!
Siv Koj Tus Tracker!
Siv Koj Tus Tracker!
Siv Koj Tus Tracker!
Siv Koj Tus Tracker!
Siv Koj Tus Tracker!

Nrog koj zoo siab! Koj muaj txoj sia nyob ntawm cov kauj ruam dhau los! Tam sim no, koj tuaj yeem sim thiab siv koj tus tracker.

Tus tracker pib nrog lub vijtsam tso tawm "Init …" ua raws los ntawm koj tus IP chaw nyob rau lub hom phiaj debug. Tus tracker tas li tshuaj xyuas nws qhov kev sib txuas WiFi thiab yog tias nws poob qhov kev sib txuas, qhia "Tsis muaj Wi-nkaus" lus.

Yog tias koj li kev sib txuas WiFi ruaj khov, tus tracker qhia pom lub vijtsam muaj duab zoo li tau qhia hauv qhov pib ntawm cov lus qhia no kom txog thaum lub hauv paus khawm raug nias.

Nias lub khawm nruab nrab sau cov neeg siv cov ntaub ntawv los ntawm Google Cov Ntawv thiab ua kom pom cov npe ntawm cov neeg siv. Koj tuaj yeem taug kev ntawm cov neeg siv siv khawm sab laug thiab sab xis. Yog tias koj nias lub pob hauv nruab nrab, koj yuav raug taw rau tus neeg siv tshwj xeeb cov ntawv qhia zaub mov. Yog tias koj tsis ua dab tsi hauv 10 vib nas this cov zaub yuav pib qhia qhov ua yeeb yaj kiab dua.

Hauv cov neeg siv tshwj xeeb cov ntawv qhia zaub mov koj tuaj yeem sau koj li kas fes, sau npe them nyiaj, saib koj li nyiaj tshuav. Koj tuaj yeem taug kev los ntawm cov kev xaiv uas siv khawm sab laug thiab sab xis. Yog tias koj xav rov qab mus rau tus neeg siv daim ntawv teev npe mus rau lub cim rov qab thiab nias lub pob nruab nrab.

Kauj Ruam 5: Kev txhim kho yav tom ntej

Yog tias koj nyeem qhov no deb, ua tsaug rau qhov ua! Txog tam sim no kev ua haujlwm tau txwv tab sis koj tuaj yeem txhim kho tus neeg taug qab nrog tus thawj coj! Yog tias koj xav ua kho vajtse txhim kho cov ntaub ntawv txiav laser yuav yog qhov zoo.

Ua siab dawb xa xov rau kuv yog tias koj muaj teeb meem, lus nug lossis lus pom!

Pom zoo: