Cov txheej txheem:

Hack Koj Lub Qhov Rooj Rau Tsheb: 5 Kauj Ruam
Hack Koj Lub Qhov Rooj Rau Tsheb: 5 Kauj Ruam

Video: Hack Koj Lub Qhov Rooj Rau Tsheb: 5 Kauj Ruam

Video: Hack Koj Lub Qhov Rooj Rau Tsheb: 5 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Hack Koj Lub Nkoj Qhov Rooj
Hack Koj Lub Nkoj Qhov Rooj
Hack Koj Lub Nkoj Qhov Rooj
Hack Koj Lub Nkoj Qhov Rooj
Hack Koj Lub Nkoj Qhov Rooj
Hack Koj Lub Nkoj Qhov Rooj

Leej twg tsis tau npau suav txog kev mus tsev tsuas yog siv lub xov tooj app, lossis tuaj yeem mloog thiab rov ua dua cov ntaub ntawv trams? Kuv zoo siab tau tuaj yeem qhia rau koj txog qhov kuv paub, thiab kuv yuav ua li cas. Kuv pib qhov haujlwm no tom qab zaum ob kuv tsis nco qab kuv cov yuam sij …

Tau kawg, kev sau tus lej, hom kev hloov pauv, zaus ntawm tus neeg nqa khoom, cov ntaub ntawv txuas ntawm bluetooth, thiab cov ntaub ntawv uas kuv yuav qhia rau hauv piv txwv tsis yog lub hauv paus, Kuv nyiam tsis muaj neeg tuaj xyuas;-).

Daim ntawv thov no siv rau txhua yam khoom muaj peev xwm tau txais cov ntaub ntawv digital los ntawm lub tshuab hluav taws xob (lub qhov rooj rau tsheb, lub tsheb, qee lub qhov rooj…). Tag nrho cov kab ke muaj cov khoom sib txuas los ntawm bluetooth rau lub xov tooj, cov khoom no tuaj yeem xa tib lub thav duab raws li cov chaw taws teeb cuam tshuam nrog qhov peb xav hack. Kuv tau muab cov khoom no tso rau hauv kuv lub nkas -las, thiab kuv tuaj yeem txuas nrog nws los ntawm sab nraud.

Kauj ruam 1: Cov khoom siv

Khoom siv
Khoom siv
Khoom siv
Khoom siv

Cov lus siv: C ++, MATLAB, Typescript, C, html.

Kev paub pib hauv digital electronics thiab kev sib txuas lus/teeb liab.

Tus nqi: tsawg dua $ 35.

Yuav tsum tau kho vajtse:

- NooELEC NESDR: rau kev khaws cov ntaub ntawv. Qhov kev lag luam pheej yig heev no ua rau kev tshem tawm digital, yog li nws qhov kev txav tau siab. Cov qauv no tau sib xws nrog MATLAB. ($ 18.95)

www.nooelec.com/store/sdr/sdr-receivers/nes…

- Wemos Lolin32 lite: tus esp32 no yog tus tswj hwm tus nqi pheej yig, nruab nrog Wifi thiab Bluetooth. Peb yuav tsis siv Wifi hauv daim ntawv thov no, tab sis qhov no feem ntau xav tau. ($ 4.74)

wiki.wemos.cc/products:lolin32:lolin32_lit…

- CDSENET cc1101: lub xov tooj cua xa xov no muab rau peb hloov pauv tau yooj yim, los ntawm cov neeg nqa khoom xaiv zaus mus rau hom kev hloov pauv. ($ 2.63)

www.aliexpress.com/item/2PC-Lot-E07-868MS1…

- Cov xov hlau, lub taub hau, cov khoom siv vuam siv, 3.7V lipo roj teeb rau kev tswj hwm tus kheej, tejzaum nws yuav oscilloscope, thiab/lossis tus kws tshuaj xyuas qhov laj thawj rau kev debug, thiab qhov xwm txheej, lub xov tooj smartphone …

Software yuav tsum tau:

- MATLAB/Simulink: rau kev khaws cov ntaub ntawv. Lwm qhov pub dawb uas tuaj yeem siv tau, zoo li Audacity rau kev pom cov ntaub ntawv. (daim ntawv tso cai)

fr.mathworks.com/products.html?s_tid=gn_ps

- esp-idf toolchain: qhov no yuav siv rau kev tsim cov esp32. Lub tswv yim Arduino tseem tuaj yeem siv tau, tab sis nws tsis tso cai kom muaj kev ywj pheej ntau npaum li qhov peb yuav siv. (dawb)

esp-idf.readthedocs.io/en/latest/get-starte…

- TI SmartRF Studio: qhov no yuav pab peb teeb tsa cov ntawv sau npe cc1101, raws li peb qhov tshwj xeeb. (dawb)

www.ti.com/tool/SMARTRFTM-STUDIO

- Ionic: rau tsim lub app. Koj tuaj yeem xaiv qhov tsim cov apps ib txwm muaj, tab sis Ionic tso cai rau peb khiav peb app ntawm ob qho tib si Android thiab IOS, nrog tsuas yog tus lej. Kev ua tau zoo tsis tau nrhiav hauv peb qhov xwm txheej. (dawb)

ionicframework.com/

- Koj lub tswv yim nyiam …

Kauj Ruam 2: Spying Cov Chaw Taws Teeb

Spying Cov Chaw Taws Teeb
Spying Cov Chaw Taws Teeb
Spying Cov Chaw Taws Teeb
Spying Cov Chaw Taws Teeb
Spying Cov Chaw Taws Teeb
Spying Cov Chaw Taws Teeb

Peb yuav pib los ntawm kev soj ntsuam cov ntaub ntawv uas cov lus txib ntawm cov chaw taws teeb tswj tsim. Txhawm rau ua qhov no, peb yuav siv rtl-sdr dongle thiab kav hlau txais xov:

fr.mathworks.com/hardware-support/rtl-sdr….

Los ntawm kev ua raws qhov txuas no, koj yuav pom pob MATLAB, ntxiv rau phau ntawv pub dawb piav qhia txhua qhov kev cia siab nrog lawv cov lus piav qhia. Txhawm rau piav qhia qhov kev txhawj xeeb rau peb, cov ntaub ntawv hla tebchaws yog nyob rau hauv daim ntawv ntawm IQ teeb liab: "Kuv" cov ntaub ntawv hauv-theem, ua ke nrog "Q" cov ntaub ntawv plaub npaug. Txoj kev no ua kom yooj yim rau kev sib tham. Peb yuav tsuas yog xav tau txais cov teeb liab hauv theem. Tam sim no peb yuav khaws cov ntaub ntawv ntawm lub cev thiab digital ntawm cov chaw taws teeb. Yog tias koj tuaj yeem nrhiav qee cov ntaub ntawv ntawm nws, nws yuav yooj yim dua. Kuv tsis pom ib qho. Yuav kom tuaj yeem soj ntsuam lub teeb liab lub sijhawm, peb yuav tsum xub paub tias yog tus neeg nqa khoom ntau zaus ntawm lub teeb liab tawm. Peb yuav siv qhov piv txwv muab nrog cov ntaub ntawv ntim khoom "Spectral Analysis with RTL-SDR Radio", kom paub tseeb tias qhov zaus peb pom lub zog siab tshaj thaum peb xa lus txib. Hauv kuv qhov xwm txheej nws yog 868.22 MHz. "Tus qauv" zaus rau cov ntawv thov no nyob ib puag ncig 868 MHz.

Nrog cov cim qhia no, peb yuav tuaj yeem sau tus lej MATLAB kom rov qab tau cov ntaub ntawv. Qhov no tau txuas nrog hauv daim duab thiab tawm tswv yim. Qhov txiaj ntsig tso cai rau peb nrhiav hom kev hloov pauv: los ntawm kev rov qab khaws cov ntaub ntawv nyoos, tso tawm qhov tshwm sim tsuas yog tom qab tau rov zoo ib yam ntawm lub teeb liab, peb tuaj yeem txiav tawm tias nws yog ASK / OOK kev hloov kho. Tseeb tiag, peb pom tias qhov zaus tsis sib xws, txawm li cas los xij, lub teeb liab tsuas muaj ob qhov kev nthuav dav: tsis muaj, thiab tsau. Qhov seem ntawm txoj cai tso cai rau peb rov qab lub hnab ntawv ntawm lub teeb liab tau txais, ua kom yooj yim dua los nyeem kom paub qhov trame. Thaum tso tawm, peb tuaj yeem txiav txim siab qhov kev hloov pauv hauv qab: qhov no yog Manchester coding (saib daim duab txuas). Peb tseem tuaj yeem txiav tawm tus nqi baud (cim ib ob). Tag nrho cov ntaub ntawv no tau sib sau ua ke, peb tuaj yeem paub cov ntaub ntawv. Hauv kuv qhov xwm txheej, cov bytes pom yog: 249, 39, 75, 178, 45, 200, thiab rov ua ntau zaus, kom ntseeg tau tias cov lus txib tau txais zoo. Hmoov zoo, txoj cai tsis tau dov, cov ntaub ntawv ib txwm zoo ib yam.

Kauj Ruam 3: Xa Cov Ntaub Ntawv Zoo Li Qub

Xa Cov Ntaub Ntawv Zoo Li Qub
Xa Cov Ntaub Ntawv Zoo Li Qub
Xa Cov Ntaub Ntawv Zoo Li Qub
Xa Cov Ntaub Ntawv Zoo Li Qub
Xa Cov Ntaub Ntawv Zoo Li Qub
Xa Cov Ntaub Ntawv Zoo Li Qub

Texas Instruments cc1101 hloov pauv tau yooj yim uas koj tseem yuav ua tiav koj lub hom phiaj, txawm tias cov teeb tsa uas koj pom hauv qib dhau los txawv ntawm kuv li. Qhov tseeb, koj yuav pom hauv cov ntaub ntawv, nplooj 2 (https://www.ti.com/lit/ds/symlink/cc1101.pdf) uas nws tso cai ua NRZ, Manchester, FSK, ASK/OOK kev hloov kho, kom mus txog zaus nyob ib ncig ntawm 433 MHz lossis 868 MHz, thiab ntau yam ntxiv. Kuv qhia koj kom nyeem cov ntaub ntawv kom paub koj tus kheej nrog cov qauv no.

Ntawm qhov txuas no koj yuav pom ua piv txwv ua haujlwm ntawm Loboris hais txog kev tsim cov haujlwm uas siv cov qauv no:

github.com/loboris/ESP32_CC1101/tree/maste…

Peb yuav sau peb cov cai rau peb esp32 nrog esp-idf toolchain (saib txuas ntawm thawj kauj ruam). Koj tuaj yeem ntxiv cov ntaub ntawv ntawm qhov txuas hauv cov cheeb tsam subdirectory ntawm koj qhov project. Txhawm rau teeb tsa peb lub cc1101 kom raug, peb yuav xav kho nws cov npe. Texas Instruments muab peb nrog software uas muab rau peb tus nqi ntawm kev sau npe raws li peb teeb tsa: SmartRF Studio.

Hais txog kuv, kuv qhia rau lub software uas kuv xav kom Manchester coding, tias kuv tus neeg nqa khoom zaus yog 868.22 MHz, tias kuv hom kev hloov pauv yog ASK / OOK … Kuv cia koj nkag mus rau koj qhov ntsuas. Hauv qhov xwm txheej uas koj lub hauv paus nkag tsis muaj, koj tuaj yeem txiav txim siab NRZ kev nkag siab, los ntawm kev nce tus nqi baud, thiab hloov kho cov ntaub ntawv.

Thaum koj tau piav qhia koj qhov txiaj ntsig, koj muaj ntau txoj kev xaiv hais txog kev siv tus qauv: koj tuaj yeem siv cov haujlwm uas kuv tau txuas rau koj, lossis qhov kuv tau ua, tsuas yog siv kev tshoov siab los ntawm cov cai no, txhawm rau teeb tsa txhua yam hauv ntau dua txoj kev lim hiam (saib cov duab txuas nrog), thiab tsuas yog siv yam peb xav tau.

Raws li cc1101 nti sib txuas lus los ntawm SPI, koj yuav pom hauv qhov txuas ntawm tus piv txwv tus lej "spi_master_lobo.h" header file, uas muaj cov haujlwm yooj yim dua rau siv SPI ntau dua yog tias koj yuav tsum siv nws nrog cov cuab yeej nkaus xwb. Kuv koom nrog koj hauv daim duab txheej txheem ntawm CC1101 kev sib txuas lus hauv SPI, yees duab los ntawm nplooj ntawv 30 ntawm CC1101 cov ntawv teev tseg. Plaub lub xov hlau nthuav tawm yog: CS (Chip Select, lossis SS: Slave Select, lossis ntawm no CSn), CLK (lossis SCLK, Moos, muab los ntawm tus tswv), MISO (lossis SO, Master In Slave Out), thiab MOSI (lossis SI, Tswv Qhia Tawm Qhev Hauv). Hauv peb qhov xwm txheej, tus tswv yog ESP32, thiab tus qhev yog CC1101. Kev sib txuas lus pib thaum CS tus lej qis, feem ntau.

Tsis txhob hnov qab ua kom muaj nyob hauv cov kev xaiv ua ke ntawm cov ntawv qhia zaub mov teeb tsa C ++ kev zam rau kev suav sau.

Kauj ruam 4: Txuas mus rau Qhov System

Txuas mus rau Qhov System
Txuas mus rau Qhov System
Txuas mus rau Qhov System
Txuas mus rau Qhov System
Txuas mus rau Qhov System
Txuas mus rau Qhov System

Yog tias koj tus lej ua haujlwm, koj tau ua qhov tseem ceeb. Hauv ntu no, peb yuav tsom mus rau yuav ua li cas thiaj tsim lub xov tooj app txuas nrog rau hauv kab ke. Qhov kev daws teeb meem tshaj plaws yog txuas los ntawm bluetooth, vim tias nws tso cai siv cov txheej txheem qis-zog: Bluetooth Low Energy (BLE). Cov hierarchy profile tau qhia hauv daim duab txuas nrog: peb yuav nyeem thiab sau cov lus txib hauv Tus Cwj Pwm ntawm Kev Pabcuam. Thiab ntawm chav kawm, peb esp32 thiab peb lub xov tooj smartphone tau nruab nrog bluetooth.

Cov kauj ruam no tau muab faib ua ob ntu: ntu esp32, thiab ntu app. Daim duab txuas nrog qhia thiab piav qhia qhov tseem ceeb ntawm cov lej.

Koj tuaj yeem tsim koj li UUIDs los ntawm qhov txuas hauv qab no:

www.uuidgenerator.net/

Cov no yog cov cim uas yuav muab kev nkag mus rau cov kev pabcuam thiab cov yam ntxwv ntawm peb BLE profile.

Txog ntawm esp32 BLE code, Kolban tau ua haujlwm zoo ua rau txhua qib qib C ++ ua haujlwm tau tshaj:

github.com/nkolban/esp32-snippets/tree/mas…

Koj tuaj yeem muab cov ntaub ntawv no tso rau hauv cov ntawv teev npe sib xyaw. Txwv tsis pub, koj yuav xav tau sijhawm ntau ntxiv kom nkag siab siv BLE nrog cov cuab yeej esp-idf.

Hauv cov ntsiab lus ntawm yam koj yuav pom hauv cov cai, peb tsim Tus Neeg rau zaub mov, Kev Pabcuam, thiab Tus Cwj Pwm, nrog UUIDs cuam tshuam, thiab peb ntxiv cov lus txhais rov qab hu ua chav kawm, nrog txoj hauv kev cuam tshuam ntawm kev sau: thaum peb tau txais "O" tus yam ntxwv, peb xa cov lus txib sau rau cc1101.

Yog lawm, tsis txhob hnov qab qhib Bluetooth hauv Cov Txheej Txheem teeb tsa ntawm Menuconfig.

Txog ntawm ntu app, peb yuav siv Cov Qauv Ionic. Koj tuaj yeem pom ntau cov ntaub ntawv hais txog nws hauv kab ntawv txuas hauv thawj kauj ruam, thiab xav paub ntau ntxiv txog yuav siv BLE nrog Ionic li cas:

ionicframework.com/docs/native/ble/

Thiab piv txwv, sau los ntawm don:

github.com/don/ionic-ble-examples/tree/mas…

Koj tuaj yeem hloov kho piv txwv piv txwv "Txuas". Peb luam theej duab cov khoom ntawm thawj nplooj ntawv, thiab mus txog nplooj ntawv thib ob yog tias peb xaiv peb lub cuab yeej. Tom qab ntawd peb nkag mus rau lub interface uas koj tuaj yeem ntxiv khawm nrog txoj hauv kev nthuav qhia hauv daim duab: nws xa peb cov lus txib "O" nrog UUIDs uas tsim nyog. Koj tseem tuaj yeem ntxiv tus tsim ntawm thawj nplooj ntawv tus txheej txheem "pab", thov kom qhib lub bluetooth thaum pib ntawm daim ntawv thov.

Kuv pom zoo kom koj tshawb xyuas Ionic lub vev xaib, thiab txhawm rau tshawb pom txhua lub Cheeb Tsam (cov nyees khawm, ceeb toom, kos rau …) txhawm rau txhim kho koj daim ntawv thov:

ionicframework.com/docs/components/#overvi…

Kauj Ruam 5: Txhim Kho Kev Siv Fais Fab

Txhim Kho Kev Siv Hluav Taws Xob
Txhim Kho Kev Siv Hluav Taws Xob
Txhim Kho Kev Siv Hluav Taws Xob
Txhim Kho Kev Siv Hluav Taws Xob

Peb pib ua haujlwm ntawm kev siv qis, yog li cia ua haujlwm dhau los.

Cov cuab yeej esp-idf tso cai rau peb siv teeb tsa GUI, cov ntawv qhia zaub mov teeb tsa: ntau qhov tsis tuaj yeem txo qis esp32 kev siv. Ua ntej tshaj plaws, vim tias peb tsis xav tau Wifi, peb tuaj yeem kaw nws hauv Cov Txheej Txheem teeb tsa. Hauv tib lub nplaub tshev, hauv FreeRTOS, koj tuaj yeem xaiv "Khiav FreeRTOS nkaus xwb ntawm thawj tus tub ntxhais kawm ntawv. Tom qab ntawd, hauv ESP-tshwj xeeb, koj tuaj yeem txo qis CPU zaus mus rau 80 MHz. khij "Enable Ultra Low Power (ULP) Coprocessor. Qhov teeb tsa no ua rau kev siv tam sim no mus ntawm ib puas mA txog li peb caug mA. Qhov no tseem ntau dhau…

ESP32 tuaj yeem ua rau pw tsaug zog. Tsuas yog cov tub ntxhais uas tsis muaj zog nyob thiab tos kom sawv.

Saib qhov txuas hauv qab no kom paub meej ntxiv:

esp-idf.readthedocs.io/en/latest/api-refere…

Hmoov tsis zoo, nyob rau qhov kawg muaj nyob rau ntawm esp-idf toolchain (3.0), tsuas yog sawv los muaj yog los ntawm lub sijhawm thiab los ntawm GPIOs cuam tshuam. Hmoov zoo, Espressif cog lus rau peb BLE sawv hauv qhov hloov tshiab tom ntej (3.1).

Koj tseem tuaj yeem tso CC1101 nyob rau hauv hom pw tsaug zog, los ntawm kev xa hauv SPI cov lus txib kom tsim nyog rau lub zog ntaus ntawv (saib cc1101 cov ntawv, SPWD hais kom ua, nplooj 51). Txhawm rau tso lub cuab yeej rau hauv hom pw tsaug zog lossis txhawm rau tsa nws, koj tuaj yeem tso qis dua ces siab Chip Xaiv tus pin ntawm SPI pins (ntau cov ntaub ntawv hauv cov ntawv teev npe).

Cov teeb tsa zaum kawg no yuav tsum tuaj yeem ua rau kev siv cov kab ke hla hauv qab milli-ampere …

Thaum kawg, txhawm rau ua kom lub kaw lus kav ntev li ntev tau yam tsis tau them rov qab, lossis txawm tias ncav cuag ib lub hlis ntawm kev tswj hwm tus kheej, xaiv lub roj teeb 3.7V nrog ntau milli-amperes ib teev. Los ntawm kev ntsuas lub zog siv ntawm koj lub kaw lus, nrog cov zaub ntawm lub tshuab hluav taws xob lossis ammeter txuas hauv kab ua ntej koj + tus ncej ntawm koj lub cev, koj tuaj yeem kwv yees lub sijhawm uas koj lub kaw lus yuav nyob ntev!

Pom zoo: