Cov txheej txheem:

Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv: 14 Cov Kauj Ruam (nrog Duab)
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv: 14 Cov Kauj Ruam (nrog Duab)

Video: Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv: 14 Cov Kauj Ruam (nrog Duab)

Video: Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv: 14 Cov Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv
Kev Ceeb Toom Thaum Ntxov Raspberry PI Txoj Kev Siv Lub Teeb Siv Dav Dav Qhia Cov Ntaub Ntawv

Lub teeb no tau los ntawm ntau qhov laj thawj hauv qhov uas kuv ib txwm nyiam cov dav hlau uas ya saum taub hau thiab thaum lub caij ntuj sov nyob rau hnub so muaj ntau zaus qee qhov zoo nkauj heev uas ya ncig. Txawm hais tias koj tsuas yog nyiam hnov lawv thaum lawv dhau los. Tom qab ntawd lwm qhov laj thawj yog tias nws zoo li txoj kev ya dav hlau mus rau lub dav hlau los ntawm London Lub Tshav Dav Hlau yuav qee zaum tau hnov dua thiab lawv muaj qee lub dav hlau nrov nrov zoo nkauj mus. Ua raws li kuv dabble hauv kaw qee cov vis dis aus rau YouTube nws yog qhov txaus siab heev uas yuav tsum tau muab kaw vim tias lub dav hlau nrov. Yog li kuv xav tsis thoob yog tias cov ntaub ntawv uas koj pom ntawm cov vev xaib zoo li flightradar24 tau tshaj tawm rau pej xeem, thaum kuv pom qee yam zoo sib xws muaj los ntawm qhib lub network qhov teeb meem ceeb toom ntxov tau yug los. Nws tsis siv sijhawm ntev dhau los los nrog lub tswv yim ntawm kev siv cov qauv ntawm lub teeb pom kev khiav mus rau lub tsev.

Koj tuaj yeem nrhiav paub ntau ntxiv txog OpenSky Network ntawm https://www.opensky-network.org Kuv kuj xav kom lub sijhawm no ua lub lens zoo nkauj tsis txhob siv PLA txhais tau tias thiab txawm hais tias kuv muaj ADS-B tus txais kuv xav khaws qhov yooj yim thiab pheej yig. ADS-B kuj xav tau lub kav hlau txais xov thiab qhov no yuav tsis ua rau lub teeb mus rau ntawm lub txee hauv chaw ua haujlwm. Yog li cia siab tias koj yuav pom qhov kev nthuav tawm zoo li nws npog 3D luam ntawv, Resin molding thiab lej zoo ib yam los nthuav tawm txoj haujlwm ntawm lub dav hlau uas muaj peev xwm tuaj yeem hla dhau.

Kauj Ruam 1: Tsim Rooj Plaub

Kev tshawb nrhiav hauv Google los nrog ntau qhov kev tsim qauv sib txawv ntawm cov teeb pom kev thiab qhov tsim ntawm qhov no tau tsim los siv kev cuam tshuam los ntawm ntau qhov sib txawv ua los ntawm cov teeb tiag. Nws tseem raug ntsuas kom zaum hauv chav lossis ntawm lub txee ntau dua li qhov loj, vim tias lawv zoo li loj dua hauv lub neej tiag.

Cov qauv tsim tau kos rau hauv Fusion 360 thiab kuv tau xa qee cov ntsiab lus yav dhau los xws li raspberry pi xoom tuav los ntawm cov phiaj xwm yav dhau los. Kev muaj peev xwm rov siv tau cov ntsiab lus yuav siv ntau qhov mob taub hau tawm ntawm qhov pib. Koj tseem tuaj yeem rub cov ntawv ntawm no

Kauj Ruam 2: Casting Lenses - #fail

Casting Lenses - #fail
Casting Lenses - #fail
Casting Lenses - #fail
Casting Lenses - #fail
Casting Lenses - #fail
Casting Lenses - #fail

Qhov tseem ceeb tshaj plaws tsim ntawm lub teeb no yuav yog lub lens. Yog li kuv daws qhov no ua ntej yam tsis muaj qhov zoo nkauj saib iav qhov project tau mus ua haujlwm. Kuv tabtom sau cia ntawm no qhov ua tsis tiav uas kuv tau sim ua kom tiav, tsis yog tias kuv tseem tau txiav txim siab ua lub lens amber. Cov teeb ci hauv qhov dej tuaj rau ob qho tib si amber thiab xiav thiab nws tsuas yog tom qab kuv tau pib ua cov amber uas kuv hloov kuv lub siab thiab txiav txim siab tias kuv xav tau ib qho xiav.

Los ntawm qhov kuv tuaj yeem ua tawm Amber cov uas tau siv ntawm txoj kab tuav thiab cov xim xiav tau siv los ua kab ntawm txoj kev khiav, thiab cov no yog cov uas zoo li yog cov khoom qub uas pom tau yog tias koj tshawb nrhiav cov teeb pom kev. Txawm li cas los xij, ntawm no yog kuv thawj zaug ntawm kev ua lub amber lens. Txhawm rau ua lub lens, Kuv tab tom yuav siv cov kua nplaum ntshiab nrog cov xim ntxiv, thiab txawm hais tias kuv tau ua ob peb pwm ua ntej kuv xav tsis thoob yog tias nws yuav muaj peev xwm luam tau 3D pwm thiab siv qhov ntawd. Yog li kuv pib nrog ua cov pwm sib cais hauv 3D thiab luam tawm nws hauv PetG. Kev txiav txim siab ntau ntawm cov pwm tso tawm Kuv ntseeg tias yuav txaus los siv cov pwm. Raws li nws tshwm sim nrog ob peb qhov kev sim kuv tau ua cov nplaum txuas rau cov pwm zoo li cov kua nplaum thiab nws tsuas zoo li tsis muaj peev xwm cais lawv. Txawm hais tias kuv muaj qhov ntsuas ib qho uas kuv yuav siv, Kuv txiav txim siab tawm tsam nws thiab luam tawm lub lens kom siv nrog cov tshuaj silicone ib txwm ua.

Kauj Ruam 3: Hom Sib Txawv Sib Txawv

Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv
Hom Sib Txawv Sib Txawv

Raws li qhov nrawm nrawm, Kuv siv 3 hom ntshiab/xim xim rau qhov haujlwm no.

Thawj qhov yog hom kev nyiam ua lag luam hu ua Pebeo - Gedeo thiab ib txwm muag rau kev ntim khoom me me thiab siv rau cov hniav nyiaj hniav kub thiab rooj ntawv ntawv hnyav dua thiab lwm yam. Qhov no ua haujlwm tau zoo thiab kho tau zoo li ntawm 24-36 teev. Txawm li cas los nws kim heev rau tus nqi uas koj tau txais, tab sis nws muaj txiaj ntsig thiab yooj yim muaj nyob hauv cov khoom nyiam thiab khoom siv tes ua. Nws yog sib xyaw ntawm 2: 1 piv. Qhov thib ob yog cov xim pleev xim ua ntej uas tau sib xyaw ntawm 10: 1 piv nrog cov tawv tawv thiab qhov no siv sijhawm ntev tshaj plaws los kho, kwv yees li ib lub lim tiam kom ncaj ncees ua ntej nws tau kho zoo. Qhov kawg yog cov dej ntshiab, uas tseem tau sib xyaw hauv 2: 1 piv thiab kho tau li ntawm 2 hnub, koj tuaj yeem pleev xim qhov no nrog tee xim, tab sis koj yuav tsum paub tseeb tias koj ib txwm siv tib xim piv yog tias koj tab tom ua pawg sib cais. Nws tseem ua haujlwm tawm tus nqi zoo tshaj plaws. Thaum kawg RTV rau pwm yog GP-3481 RTV thiab qhov no yuav siv sijhawm txog 24 teev los teeb tsa thiab muaj lub lauj kaub ntev heev yog li koj muaj sijhawm ntau los sib tov nws thiab tom qab ntawd ncuav nws.

Tam sim no kuv tsis muaj lub lauj kaub tsis muaj dab tsi (tam sim no tau xaj) yog li koj tuaj yeem cuam tshuam los ntawm cov npuas hauv ob qho pwm thiab cov tshuaj txau. Tsis muaj teeb meem ntau dhau rau qhov no, tab sis nrog lub teeb pom kev zoo lossis zoo sib xws ces koj yuav xav xav txog qee qhov kom tau cov npuas tawm ntawm cov sib tov.

Kauj Ruam 4: Casting Lens hauv Silicone Mould #2

Image
Image
Casting lub Lens hauv Silicone Pwm #2
Casting lub Lens hauv Silicone Pwm #2
Casting lub Lens hauv Silicone Pwm #2
Casting lub Lens hauv Silicone Pwm #2

Yog li qhov no yog qhov kev sim zaum thib ob ntawm kev ua lub lens Resin thiab thawj theem yog ua ob lub lens hauv Fusion 360 thiab tom qab ntawd luam tawm hauv ABS nrog rau lub thoob los tuav nws. Qhov no yuav yog qhov qub rau cov pwm thiab pab txo qis cov silicone uas yuav siv. Koj tuaj yeem yooj yim ua qhov no tawm ntawm daim npav, tab sis nws tsuas yog txoj hauv kev sib txawv. Txhawm rau muab nws txoj hauv kev zoo dua ntawm kev tso tawm los ntawm cov pwm Kuv xub ua kom nws ziab nws thiab tom qab ntawd muab nws npog zoo ntawm cov tshuaj tso tawm.

Tom qab ntawd kuv nchuav qee GP-3481 uas yog hais txog ntug dej 27 RTV thiab tom qab ntawd cia nws teeb tsa nyob rau 24 teev tom ntej ua ntej yuav tawg. Thaum qhov no tau ua tiav Kuv tau siv cov kua nplaum sib tov sib xyaw ntawm 2: 1 piv nrog li 4/5 tee ntawm cov xim xim thiab sib tov nws zoo rau plaub feeb zoo. Ncuav qhov no mus rau hauv cov pwm thiab tom qab ntawd muab lub iav txhaj rau hauv cov tshuaj zoo ib yam los muab qhov khoob tom qab rau lub teeb lossis LED's. Tom qab kwv yees li 24 teev cov tshuaj no tau npaj tshem tawm thiab lub lens tawm los zoo nkauj heev. Muaj cua npuas tam sim no, tab sis tam sim no kuv tseem tsis tau muaj lub tshuab nqus dej kom degass cov tshuaj ua ntej nchuav.

Kauj Ruam 5: Kev Luam Ntawv 3D thiab Kev Npaj

3D Luam Ntawv thiab Kev Npaj
3D Luam Ntawv thiab Kev Npaj
3D Luam Ntawv thiab Kev Npaj
3D Luam Ntawv thiab Kev Npaj
3D Luam Ntawv thiab Kev Npaj
3D Luam Ntawv thiab Kev Npaj

Tus qauv tau tsim nyob rau hauv txoj hauv kev uas lub hauv paus ntu ntsaws rau hauv paus. Qhov no yog kom tsis txhob npog ntsej muag thaum txheej txheem tha xim. Tag nrho cov qauv tau luam tawm hauv Hatchbox ABS thiab tom qab ntawd xuab zeb. Pib nrog 60 pob zeb txog li 800 pob zeb muab qhov ua tau zoo txaus rau qhov qauv no.

Kauj Ruam 6: Sib dhos thiab pleev xim

Sib dhos thiab pleev xim
Sib dhos thiab pleev xim
Sib dhos thiab pleev xim
Sib dhos thiab pleev xim
Sib dhos thiab pleev xim
Sib dhos thiab pleev xim

Thaum cov ntawv luam tawm lawm, tom qab ntawd nws tau pleev xim nrog qee qhov tsim ua ntej. Maj mam xuab zeb thiab tom qab ntawd txau rau hauv cov xim grey. Cov ntu tseem ceeb tau pleev xim rau xim liab xim daj, thiab tom qab ntawd brooklands ntsuab siv rau lub hauv paus. cov ntsiab lus tseem ceeb ntawm tamiya nyiaj tau thov rau cov ntsia liaj qhov rooj thiab qee qhov molotow nyiaj chrome siv ntawm tus tuav lub lens.

Kauj Ruam 7: Thawj Pom Cov Dav Hlau Nyob Hauv Ib Cheeb Tsam

Nrog rau kho vajtse txheeb, software xav tau los ua haujlwm. Muaj ob peb lub vev xaib tam sim no uas muab kev ya dav hlau, tab sis tsis ntau uas muab API rau nkag mus rau cov ntaub ntawv ntawd. Qee qhov ua, tsuas yog ua li ntawd ntawm kev lag luam tab sis hmoov zoo muaj ib lub xaib hu ua https://opensky-network.org uas koj tuaj yeem siv dawb.

Txhawm rau nkag mus rau cov ntaub ntawv no koj yuav tsum tso npe thiab tom qab ntawd koj tuaj yeem siv lawv li API, nws muab ntau txoj haujlwm thiab txoj hauv kev los rub cov ntaub ntawv. Peb txaus siab rau txhua lub davhlau hauv ib cheeb tsam thiab lawv muaj Live API hu rau qhov ntawd. https://opensky-network.org/apidoc/ hu ua lub thawv ntim. Kev hu API xav tau cov ces kaum ntawm lub npov uas koj txaus siab rau ntawm qhov kawg peb Lat/Lon ua qhov chaw nruab nrab. Koj tuaj yeem tshawb xyuas cov lej ua haujlwm ntawm lub xaib no, uas kos lub thawv nyob ntawm seb koj ntaus ntawv. Http://tools.geofabrik.de tab sis tam sim no cov ntawv hauv qab no muab cov ntsiab lus peb xav tau ntsaws rau hauv API.

muaj nuj nqi get_bounding_box ($ latitude_in_degrees, $ longitude_in_degrees, $ half_side_in_miles) {$ half_side_in_km = $ half_side_in_miles * 1.609344; $ lat = deg2rad ($ latitude_in_degrees); $ lon = deg2rad ($ longitude_in_degrees); $ radius = 6371; $ parallel_radius = $ radius*cos ($ lat); $ lat_min = $ lat - $ ib nrab_side_in_km/$ vojvoog; $ lat_max = $ lat + $ half_side_in_km/$ radius; $ lon_min = $ lon - $ half_side_in_km/$ parallel_radius; $ lon_max = $ lon + $ half_side_in_km/$ parallel_radius; $ box_lat_min = rad2deg ($ lat_min); $ box_lon_min = rad2deg ($ lon_min); $ box_lat_max = rad2deg ($ lat_max); $ box_lon_max = rad2deg ($ lon_max); xa rov qab array ($ box_lat_min, $ box_lon_min, $ box_lat_max, $ box_lon_max);

Yog tias koj xav ntsuas koj tus lej, muaj ib lub xaib uas koj tuaj yeem nkag mus rau lat/lon thiab pom cov txiaj ntsig ntawm daim duab qhia chaw: Saib ib lub npov piv txwv piv txwv ntawm daim duab qhia chaw

Kauj Ruam 8: Xam Thawj Lub Dav Hlau hauv Kev Txheeb Rau Peb

Xam Tus Thawj Coj ntawm Cov Dav Hlau hauv Kev Txheeb Rau Peb
Xam Tus Thawj Coj ntawm Cov Dav Hlau hauv Kev Txheeb Rau Peb

Cov txiaj ntsig los ntawm lub thawv ciam teb API hu rau peb cov npe dav hlau, lawv Lon/lat, nrawm, qhov siab thiab nqe lus. Yog li qhov txuas ntxiv uas peb yuav tsum tau ua yog kom tau txais lub taub hau ntawm txhua lub dav hlau cuam tshuam nrog peb kom peb tuaj yeem ua cov txheej txheem uas tsawg kawg mus rau hauv peb cov lus qhia dav dav. Peb tuaj yeem ua qhov no raws li peb paub peb txoj haujlwm thiab tuaj yeem ua haujlwm tawm ntawm peb mus rau txhua lub dav hlau.

Txhawm rau ua qhov ntawd kuv siv ib feem ntawm cov cai los ntawm qhov uas tau muaj nyob hauv Javascript yog li kuv tau hloov nws ntawm no rau PHP, * xam (pib) nqa ntawm ob lub ntsiab lus * * los ntawm: Ed Williams 'Aviation Formulary, https://williams.best.vwh.net/avform.htm#Crs * source = instantglobe.com/CRANES/GeoCoordTool.html */ muaj nuj nqi get_bearing ($ home_lat, $ home_lon, $ plane_lat, $ plane_lon) {$ lat1 = deg2rad ($ home_lat); $ lat2 = deg2rad ($ plane_lat);

$ dLon = deg2rad ($ plane_lon- $ home_lon);

$ y = sin ($ dLon) * cos ($ lat2);

$ x = cos ($ lat1)*sin ($ lat2) - sin ($ lat1)*cos ($ lat2)*cos ($ dLon); $ z = atan2 ($ y, $ x); $ zz = (rad2deg ($ z) +360)% 360; rov qab $ zz;

Yog tias koj xav saib ntawm nplooj ntawv qhov twg javascript cov ntawv qub yog, qhov no yog qhov txuas:

nyob rau hauv txoj cai ntawd, koj tseem tuaj yeem pom ntau yam kev ua haujlwm niaj hnub rau txhua hom kev suav.

Kauj Ruam 9: Xam qhov kev cuam tshuam los ntawm Saib ntawm Lub Vajvoog

Xam ib qho kev cuam tshuam los ntawm Saib ntawm Lub Vajvoog
Xam ib qho kev cuam tshuam los ntawm Saib ntawm Lub Vajvoog

Yog li tam sim no peb muaj lub dav hlau qhov chaw nruab nrab ntawm nws thiab peb qhov chaw nyob tsawg dua 90 (ib qho zoo lossis tsis zoo) thiab yog li qhov no txhais tau tias muaj txoj hauv kev uas nws yuav ya los ze. Siv tus lej haversine peb tseem tuaj yeem ua haujlwm siv Lon/Lat ntawm lub dav hlau thiab Lon/Lat ntawm peb lub tsev qhov deb uas nws nyob deb ntawm peb.

Saib ntawm daim duab, yog tias peb kos lub voj voos ncig peb lub tsev hais txog 3 mais ib puag ncig qhov no ua rau peb muaj sijhawm pom txhua yam ya hla. Peb paub qhov sib txawv ntawm nqe lus ntawm lub dav hlau thiab peb, peb kuj paub qhov deb ntawm lub dav hlau los ntawm peb yog li peb tuaj yeem ua haujlwm daim duab peb sab siv SOHCAHTOA qub zoo, thiab hauv qhov no siv Tan ntawm lub kaum sab xis peb tuaj yeem tau txais rov qab sab ntev. Yog li yog tias peb sib piv tus nqi no tiv thaiv lub vojvoog ntawm lub voj voos ncig lub tsev peb tuaj yeem tshawb pom yog tias lub dav hlau yuav ya ze txaus rau peb pom nws. Qhov ntxiv me ntsis peb tuaj yeem ua yog ua haujlwm lub sijhawm uas lub dav hlau yuav ya dhau los ntawm kev siv huab cua nrawm thiab nrug deb thiab yog tias qhov no tsawg dua li hais txog 45 vib nas this lossis yog li peb qhib lub teeb. Nov yog me ntsis ntawm cov cai uas kuv siv los ua kom muaj txoj hauv kev ya mus. Kuv ua qhov no vim tias muaj lub tshav dav hlau nyob ze thiab thaum lub dav hlau tab tom caij tsheb tavxij ncig lawv yam tsis pom nyob hauv tsev. Txawm li cas los xij raws li lawv qhov siab yog xoom thiab nrawm yog taug kev nrawm qhov no yuav tsum tsis txhob ua rau lub tswb nrov.

muaj nuj nqi get_intercept ($ home_head, $ plane_head, $ plane_distance) {

$ flight_angle = abs (abs ($ home_head - $ plane_head) - 180); $ flight_angle_r = deg2rad ($ flight_angle); $ flight_angle_t = tan ($ flight_angle_r); $ flight_intercept = $ flight_angle_t * $ dav hlau_distance;

yog (($ flight_angle <90) && ($ flight_intercept <3)) {// ua tau ya yav dhau los

}

rov qab $ flight_intercept;

}

Kauj Ruam 10: Qhov Nruab Nrab Ntawm Ob Lub Ntsiab Lus ntawm Daim Ntawv Qhia - Haversine Formula

Nrug nruab nrab Ntawm Ob Lub Ntsiab Lus ntawm Daim Ntawv Qhia - Haversine Formula
Nrug nruab nrab Ntawm Ob Lub Ntsiab Lus ntawm Daim Ntawv Qhia - Haversine Formula

Yog li peb yuav tsum suav qhov deb ntawm lub dav hlau thiab peb qhov chaw nyob. Ntawm qhov nrug deb ntawm daim duab qhia chaw koj tuaj yeem kwv yees kwv yees qhov deb, tab sis raws li lub ntiaj teb yog kheej kheej, muaj cov qauv hu ua haversine formula uas tso cai rau koj los txiav txim siab qhov nkhaus. Koj tuaj yeem nyeem ntxiv rau hauv tus lej:

Tam sim no nrog qhov kev suav nrug deb thiab peb paub lub dav hlau ntawm lub dav hlau peb tuaj yeem ua haujlwm tau pes tsawg vib nas this nws yuav yog ua ntej lub dav hlau raug nyiaj siv ua haujlwm. Yog li lub teeb yuav tuaj yog tias muaj qee yam hauv 30 vib nas this ntawm flypast thiab thaum kawg peb muaj peb lub teeb ceeb toom.

* raws 0n JS ntawm instantglobe.com/CRANES/GeoCoordTool.html thiab hloov mus rau PHP */

muaj nuj nqi get_distHaversine ($ home_lat, $ home_lon, $ plane_lat, $ plane_lon) {$ R = 6371; // lub ntiaj teb lub nruab nrab nruab nrab hauv km $ dLat = deg2rad ($ plane_lat- $ home_lat); $ dLon = deg2rad ($ plane_lon- $ home_lon); $ lat1 = deg2rad ($ home_lat); $ lat2 = deg2rad ($ plane_lat);

$ a = sin ($ dLat/2) * sin ($ dLat/2) + cos ($ lat1) * cos ($ lat2) * sin ($ dLon/2) * sin ($ dLon/2);

$ c = 2 * atan2 (sqrt ($ a), sqrt (1- $ a)); $ d = $ R * $ c; rov qab $ d; }

Kauj ruam 11: Ntshuam thiab Txhais Cov Dav Hlau Database

Ib qho ntawm lwm daim yog tias lub xaib qhib tau muab cov ntaub ntawv rub tawm ntawm cov dav hlau nrog rau lawv cov phiaj xwm hu xov tooj thiab cov npe. Nws ntau pua txhiab nkag. Yog li peb tuaj yeem rub tawm qhov no thiab thauj nws hauv zos mus rau hauv MariaDB database rau nrhiav (MySQL). Nrog rau txhua lub dav hlau uas tshwm rau saum taub hau, peb khaws nws cov ntsiab lus thiab hloov kho lub txee kom pom pes tsawg zaus nws tau pom.

Tam sim no kuv tseem tab tom kho cov ntaub ntawv txhawm rau hais txog lub dav hlau uas kuv txaus siab rau. Feem ntau cov qub tsov rog thiab lwm cov dav hlau uas zoo sib xws. Ob peb zaug lub caij ntuj sov no Mig-15 tau ya mus lawm. yog li lub hom phiaj yog siv thaj chaw ceeb toom kuv tau ntxiv thiab tom qab ntawd nyem lub teeb kom nrawm thaum muaj qee yam nthuav tawm

Kauj Ruam 12: Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab

Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab
Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab
Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab
Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab
Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab
Txhim Kho Cov Ntsiab Lus thiab Nta Tshiab

Yog li hauv kev xav txhua yam ua haujlwm tau zoo, tab sis koj yuav pom nrog cov ntaub ntawv uas muaj dav hlau ya hla qhov uas tsis tshwm sim hauv API.

Qhov no yog vim tias tsis yog txhua lub dav hlau siv ADS-B transponder thiab siv cov qub transponders raws li MLAT. Txhawm rau kom tau txais cov ntaub ntawv txoj haujlwm ntawm lub dav hlau siv MLAT nws xav tau cov neeg txais khoom hauv av los ua peb tog lawv txoj haujlwm thiab qee qhov chaw xws li flightradar24 muaj lub network loj dua ntawm cov koom nrog ua qhov no piv rau qhib qhib. Vam tias dhau sijhawm lawv cov kev pabcuam yuav txhim kho ib yam thiab kuv tau teeb tsa kuv tus kheej MLAT tus txais los ntxiv rau cov ntaub ntawv no.

Kauj ruam 13: Codebase

Tsis txhob hnov qab yog tias koj yuav siv qhov no koj yuav xav tshem SQL nqe lus yog tias koj tsis muaj lub database ntawm dav hlau thiab tseem ntxiv koj tus kheej Lon/Lat tus nqi thiab tus lej API rau nkag mus rau cov ntaub ntawv dav hlau.

github.com/ajax-jones/runway-light-awacs

txhais ("INTERVAL", (20 * 1)); muaj nuj nqi fexp () {$ lat = "koj qhov latitude"; $ lon = "koj qhov ntev"; $ sab = 15.75; $ box = get_bounding_box ($ lat, $ lon, $ sab); $ latmin = $ box [0]; $ lonmin = $ box [1]; $ latmax = $ box [2]; $ lonmax = $ box [3]; $ flyurl = "https://opensky-network.org/api/states/all?lamin=$latmin&lomin=$lonmin&lamax=$latmax&lomax=$lonmax"; ncha "Scanning SKY"; $ start_time = microtime (muaj tseeb); $ json = file_get_contents ($ flyurl); $ data = json_decode ($ json, TSEEB); $ inbound = FALSE; $ num_planes = suav ($ data ['states']); yog ($ num_planes> 0) {ncha "thiab peb tuaj yeem pom $ num_planes dav hlau / n"; rau ($ x = 0; $ x 0) {$ plane_eta = $ distplane/$ air_speed_kmh; } lwm {$ eta = 1; } yog ((($ cuam tshuam) 0)) && ($ distplane0) {$ inbound = TRUE; ncha "---------------------------------------------------------------------- -------------------- / n "; ncha "$ icao24 - [$ lub tebchaws $ callign] ntawm [$ geo_altitude_m M - $ geo_altitude_f ft]"; ncha "[nrawm $ air_speed_kmh kmh thiab", puag ncig ($ lub dav hlau, 1), "km deb] n"; ncha "[ntawm kab lus ntawm", puag ncig ($ dav hlau_heading, 1), "] [homeangle $ nqe lus_d]"; ncha "[$ latitude, $ longitude] n"; ncha "[flypast in", decimal_to_time ($ plane_eta), "tam sim no", puag ncig ($ cuam tshuam, 1), "km deb / n"; ncha "---------------------------------------------------------------------- -------------------- / n "; $ DBi = tshiab mysqli ("127.0.0.1", "hauv paus", "koj tus password", "awacs"); $ sql = "xaiv * los ntawm aircraftdatabase qhov twg 'icao24` =' $ icao24 '"; mysqli_set_charset ($ DBi, "utf8"); $ getplanedata = mysqli_query ($ DBi, $ sql) lossis tuag (mysqli_error ($ DBi)); $ row_getplanedata = mysqli_fetch_assoc ($ getplanedata); $ rows_getplanedata = mysqli_num_rows ($ getplanedata); yog ($ rows_getplanedata> 0) {do {echo "callsign ="; ncha $ row_getplanedata ['tso npe']; echo "yog"; ncha $ row_getplanedata ['chaw tsim khoom lub npe']; ncha ""; ncha $ row_getplanedata ['qauv']; ncha "by"; ncha $ row_getplanedata ['manufacturericao']; ncha "muaj los ntawm"; ncha $ row_getplanedata ['tus tswv']; ncha "pom"; ncha $ row_getplanedata ['mus ntsib']; ncha "sijhawm"; ncha "kev ntaus nqi tshwj xeeb ="; ncha $ row_getplanedata ['tshwj xeeb']; ncha "\ n"; $ mus ntsib = $ row_getplanedata ['mus ntsib']+1; } thaum ($ row_getplanedata = mysqli_fetch_assoc ($ getplanedata)); mysqli_free_result ($ getplanedata); $ sqli = "Hloov tshiab aircraftdatabase SET mus ntsib = $ mus xyuas qhov twg icao24 = '$ icao24'"; mysqli_set_charset ($ DBi, "utf8"); $ updateplanedata = mysqli_query ($ DBi, $ sqli) lossis tuag (mysqli_error ($ DBi)); } lwm {echo "Tsis tuaj yeem pom lub dav hlau no hauv DB yog li ntxiv nws"; $ sqli = "INSERT INTO aircraftdatabase (icao24, mus ntsib, tshwj xeeb) VALUES ('$ icao24', 1, 1)"; $ updateplanedata = mysqli_query ($ DBi, $ sqli) lossis tuag (mysqli_error ($ DBi)); } echo "------------------------------------------------------- --------------------- / n "; } lwm tus {// ncha "$ callign"; }}} lwm {echo "thiab lub ntuj pom tseeb / n"; } yog ($ inbound) {ncha "Inbound dav hlau / n"; $ hais kom = "npua w 17 1"; execInBackground ($ hais kom ua); } lwm yam {ncha "tsis muaj kev ya davhlau / n"; $ hais kom = "npua w 17 0"; execInBackground ($ hais kom ua); }} muaj nuj nqi decimal_to_time ($ zauv) {$ offset = 0.002778; yog ($ decimal> $ offset) {$ decimal = $ decimal - 0.002778; } $ teev = gmdate ('H', pem teb ($ zauv * 3600)); $ feeb = gmdate ('kuv', pem teb ($ zauv * 3600)); $ vib nas this = gmdate ('s', pem teb ($ zauv * 3600)); rov qab str_pad ($ teev, 2, "0", STR_PAD_LEFT). ":". str_pad ($ feeb, 2, "0", STR_PAD_LEFT). ":". str_pad ($ vib nas this, 2, "0", STR_PAD_LEFT); }/ * * xam (pib) coj los ntawm ob lub ntsiab lus * * los ntawm: Ed Williams 'Aviation Formulary, https://williams.best.vwh.net/avform.htm#Crs * qhov chaw = instantglobe.com/CRANES/GeoCoordTool. html */ muaj nuj nqi get_bearing ($ home_lat, $ home_lon, $ plane_lat, $ plane_lon) {$ lat1 = deg2rad ($ home_lat); $ lat2 = deg2rad ($ plane_lat); $ dLon = deg2rad ($ plane_lon- $ home_lon); $ y = sin ($ dLon) * cos ($ lat2); $ x = cos ($ lat1)*sin ($ lat2) - sin ($ lat1)*cos ($ lat2)*cos ($ dLon); $ z = atan2 ($ y, $ x); $ zz = (rad2deg ($ z) +360)% 360; rov qab $ zz; } muaj nuj nqi get_intercept ($ home_head, $ plane_head, $ plane_distance) {$ flight_angle = abs (abs ($ home_head - $ plane_head) - 180); $ flight_angle_r = deg2rad ($ flight_angle); $ flight_angle_t = tan ($ flight_angle_r); $ flight_intercept = $ flight_angle_t * $ dav hlau_distance; rov qab $ flight_intercept; } / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *// * * Siv Haversine tus lej los laij tawm deb (hauv km) nruab nrab ntawm ob lub ntsiab lus teev tseg los ntawm * latitude/longitude (hauv lej lej) * * los ntawm: Haversine formula - RWSinnott, "Virtues of the Haversine", * Ntuj thiab Telescope, vol 68, no 2, 1984 * https://williams.best.vwh.net/avform.htm#Crs * * piv txwv siv los ntawm daim ntawv: * result.value = LatLon.distHaversine (lat1.value.parseDeg (), long1.value.parseDeg (), * lat2.value.parseDeg (), long2.value.parseDeg ()); * qhov twg lat1, long1, lat2, long2, thiab qhov tshwm sim yog daim foos * qhov chaw = instantglobe.com/CRANES/GeoCoordTool.html */muaj nuj nqi get_distHaversine ($ home_lat, $ home_lon, $ plane_lat, $ plane_lon) {$ R = 6371; // lub ntiaj teb lub nruab nrab nruab nrab hauv km $ dLat = deg2rad ($ plane_lat- $ home_lat); $ dLon = deg2rad ($ plane_lon- $ home_lon); $ lat1 = deg2rad ($ home_lat); $ lat2 = deg2rad ($ plane_lat); $ a = sin ($ dLat/2) * sin ($ dLat/2) + cos ($ lat1) * cos ($ lat2) * sin ($ dLon/2) * sin ($ dLon/2); $ c = 2 * atan2 (sqrt ($ a), sqrt (1- $ a)); $ d = $ R * $ c; rov qab $ d; } muaj nuj nqi get_bounding_box ($ latitude_in_degrees, $ longitude_in_degrees, $ half_side_in_miles) {$ half_side_in_km = $ half_side_in_miles * 1.609344; $ lat = deg2rad ($ latitude_in_degrees); $ lon = deg2rad ($ longitude_in_degrees); $ radius = 6371; # Lub vojvoog ntawm qhov sib luag ntawm qhov latitude muab; $ parallel_radius = $ radius*cos ($ lat); $ lat_min = $ lat - $ ib nrab_side_in_km/$ vojvoog; $ lat_max = $ lat + $ half_side_in_km/$ radius; $ lon_min = $ lon - $ half_side_in_km/$ parallel_radius; $ lon_max = $ lon + $ half_side_in_km/$ parallel_radius; $ box_lat_min = rad2deg ($ lat_min); $ box_lon_min = rad2deg ($ lon_min); $ box_lat_max = rad2deg ($ lat_max); $ box_lon_max = rad2deg ($ lon_max); xa rov qab array ($ box_lat_min, $ box_lon_min, $ box_lat_max, $ box_lon_max); } ua haujlwm execInBackground ($ cmd) {yog (substr (php_uname (), 0, 7) == "Windows") {pclose (popen ("start /B". $ cmd, "r")); } lwm {exec ($ cmd. "> /dev /null &"); }} muaj nuj nqi checkForStopFlag () {// ua tiav qhov kev xaiv rov qab (TRUE); } muaj nuj nqi pib () {ncha "pib / n"; $ hais kom = "npua w 17 1"; execInBackground ($ hais kom ua); $ nquag = TSEEB; thaum ($ nquag) {us pw (1000); // yeem, yog tias koj xav txiav txim siab yog tias (microtime (tseeb)> = $ nextTime) {fexp (); $ nextTime = microtime (tseeb) + INTERVAL; } $ nquag = checkForStopFlag (); }} fexp (); pib (); ?>

Kauj Ruam 14: Txuas lub LED thiab Shutdown Switch

Txuas lub LED thiab Shutdown Switch
Txuas lub LED thiab Shutdown Switch

Txoj hlua ntawm txoj haujlwm no tsis tuaj yeem yooj yim dua. Tsuas yog ib qho LED uas txuas nrog tus pin 17 thiab hauv av nrog 270R resistor inline.

Kuv kuj suav nrog kaw thiab lub zog khawm nrog rau lub zog LED uas khiav tawm ntawm TXd cov ntaub ntawv tus pin. Koj tuaj yeem nyeem ntau ntxiv txog kev kaw haujlwm thiab cov cai xav tau ntawm https://github.com/Howchoo/pi-power-button.git los ntawm lub xaib https://howchoo.com/g/mwnlytk3zmm/how-to- add-a-pow… Koj tuaj yeem nyeem txog kev ntxiv lub teeb pom kev ntawm no

Pom zoo: