Cov txheej txheem:

Kev tswj khaub ncaws ntse: 7 Kauj Ruam
Kev tswj khaub ncaws ntse: 7 Kauj Ruam

Video: Kev tswj khaub ncaws ntse: 7 Kauj Ruam

Video: Kev tswj khaub ncaws ntse: 7 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Kaum ib hlis
Anonim
Kev Tswj Ntxhua Khaub Ncaws
Kev Tswj Ntxhua Khaub Ncaws
Kev Tswj Ntxhua Khaub Ncaws
Kev Tswj Ntxhua Khaub Ncaws
Kev Tswj Ntxhua Khaub Ncaws
Kev Tswj Ntxhua Khaub Ncaws

Dandywash yog lub kaw lus tswj kev ntxhua khaub ncaws, tsom mus rau cov neeg uas muaj sijhawm tsawg los siv rau kev ua haujlwm hauv tsev tsis zoo ib yam li ua ntxhua khaub ncaws. Peb txhua tus tau nyob ntawd, tsuas yog pov peb cov khaub ncaws qias neeg hauv pob tawb, cia siab tias yuav nrhiav kev txhawb siab los daws qhov teeb meem tom qab. Txawm li cas los xij, tsis muaj leej twg pom nws. Txog thaum peb xav tau qee daim khaub ncaws thiab tsis tuaj yeem pom nws nyob qhov twg. Nov yog qhov pib xwb. Tom qab ntawd los ntawm kev txheeb, sau thiab taug qab. Ua txoj haujlwm yooj yim no thiab rov ua dua yuav siv sijhawm ntau dhau los mloog thiab tsom mus rau. Tias yog vim li cas kuv thiaj pib txoj haujlwm no. Dandywash tshem tawm tag nrho cov kev ua si nkees no. Koj tsis tas yuav siv lwm qhov kev txheeb cais thib ob, taug qab lossis ntsuas koj lub nra. Thaum tswj kev tswj hwm tag nrho. Nrhiav paub ntau ntxiv, thiab yuav ua li cas koj tuaj yeem ua tiav cov txiaj ntsig zoo ib yam, los ntawm kev nyeem hauv kab lus no.

Khoom siv

Kuv tsim cov ntaub ntawv ntxaws ntxaws ntawm cov khoom hauv Excel, uas koj tuaj yeem pom ntawm no.

Qhov no muaj tag nrho cov khoom tseem ceeb thiab daim uas koj xav tau, thiab mus rau qhov twg.

Nyob rau sab saum toj ntawm cov ntawd, Kuv xav sau qee cov khoom ntxiv uas yuav los tau yooj yim thaum ua qhov haujlwm no koj tus kheej, tab sis tsis muaj lub luag haujlwm.

  • Txij li thaum koj yuav xav tau qee lub xov hlau txuas ntev thiab cov uas tsis yog ib qho tiag tiag, Kuv xav kom koj yuav ob tus poj niam - poj niam cable li txiv neej - txiv neej cables. Kuv kuj yuav poj niam - txiv neej tab sis cov ntawd tsis tsim nyog tiag. Txoj kev no, koj tuaj yeem tsim cov hlua ntev dua los ntawm kev txuas lawv ua ke. Qhov no tshem tawm lub sijhawm siv cov haujlwm ua haujlwm tsis zoo.
  • Kuv kuj tau ntxiv ntau qhov kev tiv thaiv kev nyab xeeb hauv Circuit. Xav tias dawb los tshem tawm yog tias koj xav tias muaj kev ntseeg siab ntxiv. Yog tias koj tab tom ua haujlwm qis ntawm cov resistors Kuv xav kom koj khaws cov khoom siv no, nws yooj yim heev rau ib txwm muaj cov resistors koj xav tau, sau npe kom meej.

Kauj ruam 1: Ua ntej

Ua ntej
Ua ntej
Ua ntej
Ua ntej

Pib lub Raspberry Pi

Txhawm rau kom ua tiav tag nrho IOT saw los ntawm Raspberry Pi, peb yuav tsum tau pib ua lub cuab yeej. Qhov no tuaj yeem ua tiav los ntawm rub tawm cov duab muab, thiab hlawv nws mus rau daim npav micro SD (16GB). Qhov no tuaj yeem ua tiav siv Win32DiskImager lossis lwm yam software tiag tiag. Xyuas kom tseeb tias koj daim npav SD tsis muaj dab tsi kiag li thiab cov ntawv ua ntej hlawv cov duab. Cov vis dis aus no piav qhia tag nrho cov txheej txheem ib qib zuj zus. Nco ntsoov tias koj tsis tas yuav siv cov duab raspbian tab sis cov duab muab tso ua ke.

Thaum koj ua tiav sau daim npav SD, koj tuaj yeem tshem nws thiab ntxig rau hauv Pi. Nco ntsoov tias Pi tsis txuas nrog lub hwj chim tseem!

Thaum muab daim npav SD tso, txuas Pi rau koj lub khoos phis tawj siv lub ethernet cable. Tsuas yog thaum ntawd, thaum nws twb nyob hauv koj txoj kev tswj hwm lawm, muab lub zog rau nws. Tus Pi yuav khau raj hauv ob peb feeb.

Koj tuaj yeem saib xyuas qhov no los ntawm kev mus rau hauv kab hais kom ua thiab ntaus ntawv

ping 169.254.10.1 -t

Thaum koj tau txais lus teb ntau dua li 'Tus tswv tsis tuaj yeem nkag tau', koj tus Pi tau pib ua tiav. Qhov no txhais tau tias peb tuaj yeem cuam tshuam nrog nws. Tawm ntawm lub voj tsis kawg ntawm pinging los ntawm nias Ctrl+C. Tam sim no koj tuaj yeem nkag mus rau Pi los ntawm kev ntaus ntawv

ssh [email protected]

qhov no yuav qhia koj rau tus password, uas yog lub txiv pos nphuab.

Thaum khau raj thawj zaug, nws yog qhov ua tau zoo los khiav ob qho tib si

$ sudo apt-tau hloov tshiab

$ sudo apt-tau hloov tshiab

Qhov no yuav ua kom ntseeg tau tias txhua pob khoom tau hloov kho tshiab thiab ntawm qhov hloov tshiab kawg.

MariaDB thiab Apache2 yuav raug teeb tsa. Yog li peb tsis tas yuav txhawj txog cov ntawd. Txawm li cas los xij, peb yuav tsum teeb tsa qee yam ntxiv txhawm rau kom txhua yam ua haujlwm tau zoo raws li peb xav tau.

Txawm li cas los xij, koj yuav tsum rov pib ua ntej, kom ntseeg tau tias txhua yam tau npaj rau qib tom ntej.

$ sudo rov pib dua

Kauj ruam 2: Teem Up Database

Kev teeb tsa lub Database
Kev teeb tsa lub Database
Kev teeb tsa lub Database
Kev teeb tsa lub Database

Peb yuav teeb tsa cov ntaub ntawv siv koj lub laptop / desktop, tsis yog Pi. Qhib MySQL Workbench (rub tawm phau ntawv qhia) thiab ntxiv qhov txuas tshiab.

Tom qab ntawd, koj yuav tau txais kev ceeb toom nrog lub qhov rai teeb tsa. Kuv tau ua tiav raws li qhov koj yuav tsum tau ua. Ua tib zoo mloog rau cov cim cim. Cov xub taw qhia rau tus lej zais uas koj yuav tsum khaws hauv lub vault. Cov no tsuas yog qhov tsis ua tiav thiab tuaj yeem hloov pauv raws li koj nyiam.

Thaum tag nrho cov ntaub ntawv nkag mus, nyem rau ntawm Test Connection, tsis quav ntsej cov lus ceeb toom, thiab cia siab tias yuav pom qhov ua tiav qhov rai. Yog tias koj tsis ua, qee qhov chaw (s) tsis raug. Koj tuaj yeem txuas ntxiv los ntawm txhaj Ok ntawm lub qhov rais nrog txhua qhov chaw nkag.

Kev sib txuas yuav tsum tam sim no pom hauv qhov pib qhov rai. Nyem rau nws los sim txuas. Lo lus zais yuav tsum nkag mus tau txij li thaum peb khaws nws hauv lub qhov txhab.

Kauj ruam kawg yog ntshuam lub database. Koj tuaj yeem rub tawm pob tseg ntawm no. Cov vis dis aus no piav qhia yuav qhib thiab khiav cov ntaub ntawv.sql li cas. Nco ntsoov tias koj tau txuas nrog Raspberry Pi, thiab tsis yog qhov piv txwv hauv koj lub laptop!

Kauj Ruam 3: Teeb tsa Git Repository

Teeb tsa Git Repository
Teeb tsa Git Repository
Teeb tsa Git Repository
Teeb tsa Git Repository
Teeb tsa Git Repository
Teeb tsa Git Repository
Teeb tsa Git Repository
Teeb tsa Git Repository

Ua haujlwm nrog git repo yog qhov tsim nyog zoo nkauj ntawm no. Tshwj xeeb tshaj yog tias koj xav hloov pauv yooj yim ntawm koj lub pc thiab raspi. Git yuav tsum tau teeb tsa ntawm lub cuab yeej, yog li koj tuaj yeem tsuas yog git clone xijpeem repo koj xav tau rau txhua daim nplaub tshev uas koj xav tau. Txawm li cas los xij, txij li peb tab tom siv apache, peb yuav tsum tso peb li Frontend code (html, css, javascript) hauv/var/www/html folder. Kuv tsis xav tso tag nrho repo ntawm no, thiab kuv twv yuav raug hu tsis xav tau cais repo.

Qhov no tuaj yeem daws tau los ntawm kev tsim cov kab sib txuas sib txuas, uas yog qhov tseem ceeb tib yam li kev luv hauv windows. Nws tuaj yeem teeb tsa tau yooj yim los ntawm kev ntaus cov lus txib hauv qab no hauv raspi davhlau ya nyob twg (tom qab cloning repo!)

$ git clone

Tsim kev sib txuas symbiotic muaj cov qauv hauv qab no

$ ln -s/path/to/dir/path/to/symlink

Ua ntawv thov rau qhov kev siv no, cov lus txib yuav tsum zoo ib yam li qhov no

$ ln -s ~/tsev/pi/project1/git -repo//var/www/html

Tam sim no, yog tias txhua yam mus tau zoo, koj tuaj yeem tshawb rau https://169.254.10.1/Frontend yuav tsum pom qhov index.html los ntawm git repo.

Hauv daim nplaub tshev no koj yuav pom cov lus teb ua tau zoo ua ntej tus lej. Xws li HTML5, CSS thiab JavaScript.

Kauj ruam 4: Backend

Backend
Backend
Backend
Backend

Txog qhov haujlwm no, peb yuav siv Flask ua ke nrog Socketio. Qhov no tso cai rau peb teeb tsa lub vev xaib hloov pauv tau yooj yim nrog kev xa mus thiab websockets. Cov Flask app no tseem yuav cuam tshuam nrog Database txhawm rau ua cov haujlwm CRUD. Qhov zoo tshaj plaws txog txhua pawg no, yog nws siv sijhawm me ntsis thiab siv zog los teeb tsa. Ua ntej tshaj, ua kom ntseeg tau tias cov neeg thib peb Python pob khoom tau teeb tsa. Cov no yuav tsum suav nrog hauv daim duab, tab sis los ntawm kev ua cov lus txib hauv qab no koj tuaj yeem ua kom paub tseeb / hloov kho dua tshiab.

$ pip3 nruab mysql-connector-python

$ pip3 nruab flask-socketio $ pip3 nruab flask-cors $ pip3 nruab gevent $ pip3 nruab gevent-websocket

Tam sim no koj yuav tsum tuaj yeem ua haujlwm app.py tsab ntawv yam tsis muaj teeb meem. Nws tuaj yeem yog qhov koj tau txais tus cwj pwmError hais hom khoom 'Database' tsis muaj tus cwj pwm 'tus cursor'. Qhov no tshwm sim los ntawm kev ua yuam kev hauv cov ntawv config.py. Nco ntsoov tus username password, thiab lub npe ntawm cov ntaub ntawv raug thiab muaj kev nkag tau mus rau lub database peb nyuam qhuav nkag los xwb. Qhov no yog qhov tshwj xeeb tshaj yog qhov koj hloov pauv lub npe siv thiab tus lej siv hauv MySQL.

Kauj ruam 5: Circuit Court

Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court

Kuv tsis tuaj yeem hais ntau ntau txog ntawm Circuit Court. Koj tsuas yog yuav tsum tsim qhov no thiab khiav cov ntawv xeem hauv git repo. Kuv tsim cov ntawv xeem rau txhua lub ntsuas hluav taws xob thiab tus ua haujlwm hauv Circuit Court, yog li koj tuaj yeem sim txhua ntu / ib feem ntawm tus kheej.

Nws tuaj yeem yog qhov koj yuav tsum tau hloov tus lej tus lej hauv tus lej. Kuv kuj tau ntxiv ntau qhov kev tiv thaiv kev nyab xeeb hauv Circuit. Xav tias dawb los tshem tawm yog tias koj xav tias muaj kev ntseeg siab ntxiv. Yog tias koj tab tom ua haujlwm qis ntawm cov resistors Kuv xav kom koj khaws cov khoom siv no, nws yooj yim heev rau ib txwm muaj cov resistors koj xav tau, sau npe kom meej.

Yog tias Circuit Court ua rau koj ntshai, thov tsis txhob poob siab. Sim rhuav nws hauv ntu. Ua cov nyees khawm tawm ua ntej, xyuas kom nws ua haujlwm, thiab tom qab ntawd txav mus rau lub ntsuas tom ntej. Nov yog qee yam uas koj tsis tuaj yeem tsim hauv 1 mus, tshwj tsis yog koj muaj peev xwm xav tsis thoob.

Thaum kawg, nco ntsoov tias Raspberry Pi tsis haum rau ib qho software loj PWM. Linux tsis yog lub sijhawm ua haujlwm tiag tiag. Qhov no txhais tau tias koj yuav muaj kev tshee me ntsis hauv cov servo motors. GPIO tus pin 18 txhawb kev kho vajtse pwm, tab sis peb xav tau ntau dua li tsuas yog 1 tus pin.

Kauj Ruam 6: Rooj plaub

Case
Case
Case
Case
Case
Case

Kuv tau npaj tag nrho cov phiaj xwm tau npaj tseg hauv kuv lub taub hau, uas tsis tuaj yeem ua tiav vim tias muaj kev kis thoob qhov txhia chaw tam sim no. Tau kawg qhov no yog xwm txheej uas xav tau kev hloov pauv los ntawm txhua tus, thiab qhov ntawd yog qhov kuv tau ua li cas. Kuv tseem muaj qhov tshwm sim thawj zaug uas kuv tau ua, thiab kuv yuav qhia qhov no ntawm no ib yam nkaus, yog tias koj xav tsim rooj plaub ntawd. Txawm li cas los xij, rau qhov seem ntawm kab lus no, Kuv yuav tham txog yuav ua li cas rooj plaub raug xaiv los ua.

Qhov tsis yooj yim tseem ceeb yog phaj abs kuv yuav siv los txhawm rau sab saum toj mus rau hauv qab. Qhov no yog cov khoom siv zoo meej. Kev ua kom zoo nkauj thiab ua tau zoo heev. Qhov no tuaj yeem, txawm li cas los xij, tsis paub, yog li kuv yuav tsum nrhiav lwm txoj hauv kev. Txij li thaum kuv tsis tuaj yeem xav txog lwm cov khoom ntawm tib lub zog uas tuaj yeem khoov tib yam, kuv txiav txim siab hloov nws los ntawm ntoo zoo li. Qhov no ua rau txoj kab nkhaus nkhaus ua tsis tau, tab sis qhov tseeb tau tsim lwm qhov tiaj tus uas tuaj yeem siv los khaws cov khoom xws li cov khoom ntxhua khaub ncaws lossis khaub ncaws. Kuv tau siv nws los khaws lub khob cij thib ob, ua rau kuv lub neej kev sib tw yooj yim dua rau daim ntawv no.

Nco tseg lub duab plaub uas tau ua rau sab nraub qaum. Qhov no tso cai rau cov kab hluav taws xob xa mus rau Raspbarry Pi.

Rau cov phiajcim kuv tau mus ntsib kuv lub khw diy hauv zos. Lawv ib txwm muaj qee cov ntoo ntoo tso ncig thiab txaus siab txiav nws ua tej daim me me. Kuv tau them tag nrho € 5 hauv tag nrho. Hu nrov heev rau Louis los ntawm Hubo Wevelgem kom ua tau qhov no. Tom qab ntawd nws tsuas yog teeb meem ntawm qhov drilling qhov thiab ntsaws txhua yam hauv qhov chaw. Cov ncauj lus ntxaws ntxaws txog qhov yuav txiav qhov twg thiab yuav siv qhov twg tuaj yeem nrhiav tau ntawm no.

Txog qhov 3D Luam tawm cov khoom, Kuv yuav tsum tso siab rau cov neeg nyob ib puag ncig kuv, txij li tsev kawm ntawv tsis tuaj yeem muab cov kev pabcuam no ntxiv vim muaj kev sib kis. Los ntawm tus phooj ywg ntawm tus phooj ywg kuv tau ntsib nrog ib tus neeg uas nyuam qhuav pib tsim nws 3D Luam Ntawv lag luam. Nws ua siab dawb txaus los luam kuv daim tseem ceeb. Qhov zoo tau hloov pauv vim yog kev teeb tsa tsis raug ntawm lub tshuab luam ntawv. Kuv yuav cov tshuaj tsuag xim ua ntej thiab muab nws 3 txheej, rov ua kom pom tag nrho.

Cov neeg ntsuas qhov nrug deb tau ua los ntawm lwm tus phooj ywg. Nws kuj tau luam tawm lub dawm uas tau txuas rau lub cav servo. Thaum xub thawj kuv tau sim qhov no nrog duab los qhia, tab sis lawv yuav tsis lo zoo heev. Nco ntsoov tias yog koj 3D Luam cov khoom no, koj xav tau bottom_hatch.stl ob zaug, ntxiv rau qhov nrugSensorHolder.stl. main_piece.stl thiab middle_hatch.stl tsuas yog yuav tsum tau luam tawm ib zaug.

Kauj Ruam 7: Cov lus nug?

Yog tias ib feem twg tseem tsis tau meej rau koj tam sim no, tsis txhob yig mus cuag thiab tso cai rau kuv los pab koj.

Xav tias dawb los tiv tauj ntawm email ntawm [email protected]

Pom zoo: