Cov txheej txheem:

Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj: 9 Kauj Ruam (nrog Duab)
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj: 9 Kauj Ruam (nrog Duab)

Video: Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj: 9 Kauj Ruam (nrog Duab)

Video: Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj: 9 Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj

Hloov kho Lub Kaum Ob Hlis 4, 2017 - hloov kho Feather nRF52 cov duab kos thiab cov lus qhia debug. Ntxiv cov duab ntawm tus choj txuas rau hauv lub thawv

Txoj haujlwm yooj yim no muab WiFi nkag mus rau ib qho Bluetooth Tsawg Zog (BLE) cov qauv uas siv Nordic's UART nrog TX Qhia. Tus choj Wifi2BLE yog pob tshab tag. Nws tsuas yog xa cov ntaub ntawv WiFi mus rau BLE lub cuab yeej thiab dhau BLE cov cuab yeej cov ntaub ntawv rov qab mus rau WiFi txuas.

Pub dawb pfodDesignerV3 tsim cov cai los siv Nordic UART Kev pabcuam ntawm ntau BLE cov qauv suav nrog, Adafruit Bluefruit Feather nRF52, Arduino/Genuino 101, RedBearLab BLE Nano V2 thiab V1-V1.5, RedBearLab BLE Shield, Adafruit Bluefruit LE UART phooj ywg thiab Flora Board, Adafruit Bluefruit LE SPI (piv txwv li Bluefruit LE Shield, Bluefruit LE Micro, Feather 32u4 Bluefruit LE, Feather M0 Bluefruit LE lossis Bluefruit LE SPI phooj ywg) thiab lwm cov laug cam uas cia koj ua haujlwm rau koj li kev pabcuam.

Tus choj Wifi2BLE no haum rau cov neeg tsis muaj kev paub dhau los uas tuaj yeem siv tau. Nws siv tsuas yog ob lub rooj tsavxwm, ib txoj hlua kab thiab ob tus tiv thaiv

Ntxiv rau kev sim ntxaws ntxaws rau txhua lub rooj tsavxwm, cov lus qhia no suav nrog Kev Pabcuam - Nws Tsis Ua Haujlwm kauj ruam nrog ntau qhov ua txhaum kev nrhiav tswv yim.

Cov lus qhia no tseem muaj nyob online

Vim Li Cas Qhov Project no?

Txoj haujlwm no daws teeb meem ntau yam uas BLE (Bluetooth Low Energy) muaj.

  • Tsuas yog cov xov tooj thiab cov khoos phis tawj tsis ntev los no txhawb nqa BLE. Tus choj Wifi2BLE tso cai rau txhua lub xov tooj ntawm tes lossis khoos phis tawj nrog WiFi txuas mus txuas rau thiab tswj cov cuab yeej BLE.
  • BLE muaj qhov txwv tsawg. Tus choj Wifi2BLE tso cai rau koj nkag mus rau BLE lub cuab yeej los ntawm txhua qhov chaw hauv tsev (qhov twg muaj kev sib txuas WiFi) thiab sab nraud los ntawm Is Taws Nem.
  • Tsim BLE apps xav kom koj kawm Android lossis iOS. Tus choj Wifi2BLE muab kev sib txuas xov tooj cua thoob ntiaj teb los ntawm txhua qhov kev pabcuam davhlau ya nyob twg. Ntxiv mus ntxiv koj tuaj yeem npaj tau ntxiv lub vev xaib rau WiFi module los tsim koj li kev cai sib tham.
  • BLE V5 cog lus sib txuas ua ke kom txuas txhua yam hauv koj lub tsev BLE cov cuab yeej, ib zaug cov software tau txais nrog qhov tshwj xeeb tshaj plaws ntawm Bluetooth. Tus choj Wifi2BLE siv BLE V5 lub cuab yeej thiab yog li yuav muab kev siv internet rau lub network hauv tsev no thaum nws tuaj txog.

Kuv qhov kev siv tam sim rau qhov haujlwm no yog ntxiv chav chav BLE tswj lub teeb rau WiFi network kom tso cai rau nws tswj tau los ntawm txhua qhov chaw hauv tsev. Txawm hais tias qhov kev qhia no siv pfodApp ua piv txwv ntawm kev tswj hwm BLE cov laug cam ntawm WiFi, koj tsis tas yuav yuav pfodApp kom ua tiav txoj haujlwm no.

Kauj Ruam 1: Daim Ntawv Teev Npe

Nqi ~ US $ 60 li ntawm 30th Kaum Ib Hlis 2017, tsis suav nrog kev xa khoom + lub thawv yas me me

Adafruit Feather nRF52 Bluefruit LE - nRF52832 - ~ US $ 25

Adafruit HUZZAH ESP8266 Breakout - ~ US $ 10

Ribbon Cable nrog cais poj niam kawg-Tsheb npav Pirate Cable ~ US $ 5 https://www.sparkfun.com/products/9556 LOSSIS 10-pin IDC Socket Rainbow Breakout Cable ~ US $ 4 https://www.sparkfun.com/products/ 9556 LOS YOG zoo sib xws

So Tawm Txiv Neej Headers - Txoj Cai Ncaj Ncees - ~ US $ 2

USB rau TTL 3V3 Serial Cable - ~ US $ 10 https://www.sparkfun.com/products/12977 (Nyiam raws li nws muaj cov cim npe) lossis LOS YOG https://www.sparkfun.com/products/12977 (pins tsis yog daim ntawv lo)

USB A rau Micro B cable - ~ US $ 4 https://www.sparkfun.com/products/12977 (3 ko taw ntev) LOSSIS ~ US $ 3 https://www.sparkfun.com/products/12977 (6 nti ntev) LOSSIS ~ US $ 2 https://www.sparkfun.com/products/12977 (6 nti ntev) LOSSIS ~ US $ 5 https://www.sparkfun.com/products/12977 (6 ko taw ntev) LOSSIS zoo sib xws

2 x 100 ohm resistors - ~ US $ 1

USB fais fab mov (500mA lossis ntau dua) - ~ US $ 6 https://www.sparkfun.com/products/12890 LOSSIS ~ US $ 7 https://www.adafruit.com/product/1994 LOS YOG zoo sib xws

Arduino IDE V1.8.5 thiab lub khoos phis tawj los khiav nws.

Rau lub thawv yas kuv siv ib qho los ntawm Jaycar UB5 (xiav) 83mm x 54mm x 31mm ~ A $ 4

Kauj ruam 2: Wifi2BLE Circuit

Wifi2BLE Circuit
Wifi2BLE Circuit

Wifi2BLE Circuit yog qhia saum toj no. Tus pdf version nyob ntawm no. Raws li koj tuaj yeem pom lub voj voog yog yooj yim heev. Tsuas yog 4 xov hlau thiab ob 100 ohm tiv thaiv tiv thaiv. Cov tiv thaiv tiv thaiv yog nyob rau hauv rooj plaub koj plam-txuas cov kab TX / RX tom qab ua haujlwm HUZZAH ESP8266 lossis Feather nRF52.

NCO TSEG: Feather nRF52 npav npav rau TX thiab RX pins yog qhov raug. Tus pin TX tiag tiag yog tus nyob ib sab ntawm DFU tus pin thiab RX tus pin yog tus nyob ib sab ntawm tus pin MISO

Nco ntsoov tias koj txuas kab TX/RX raws li qhia saum toj no. Hmoov zoo qhov kev tiv thaiv tiv thaiv tau ua lawv txoj haujlwm thiab cov laug cam tsis raug puas tsuaj thaum kuv txheeb xyuas vim li cas cov laug cam tsis sib koom.

Kauj Ruam 3: Kev Siv Wifi2BLE

Wifi2BLE Kev Tsim Kho
Wifi2BLE Kev Tsim Kho
Wifi2BLE Kev Tsim Kho
Wifi2BLE Kev Tsim Kho
Wifi2BLE Kev Tsim Kho
Wifi2BLE Kev Tsim Kho

Txoj cai-angled header pins qhov twg soldered mus rau HUZZAH ESP8266 kom nws tsis raug ntsaws rau lub cajmeem. Plaub txoj hlua hluav taws xob ntawm txoj hlua hlua tau siv los txuas ob lub laug cam. Khaws tus poj niam tus pin txuas thiab txiav tawm lwm qhov kawg ntawm txoj hlua hlua. Kuv tus xov tooj kab ntawv muaj xim zoo ib yam li Sparkfun USB rau TTL cov phiaj xwm kab ntawv yog li kuv tau xaiv cov hlau kom phim nws. Dub rau GND, Liab rau 5V+, Txiv kab ntxwv rau TX (txuas rau ESP8266 RX) thiab Xim av rau RX (txuas rau ESP8266 TX)

Kuv xaim cov tiv thaiv tiv thaiv sab nraum qab ntawm Feather nRF52 pawg thawj coj. (Cov neeg tsim qauv saib xyuas uas paub lawv tus lej tiv thaiv yuav pom kuv tau siv ob 68 ohm resistors kuv muab ntawm tes tsis yog 100 ohm sawv daws) thiab tom qab ntawd thaiv lawv nrog qee qhov qhwv.

Cov kab liab liab tau muab txuas rau Plaub Plaub nRF52 USB tus pin kom khaws USB 5V txhawm rau siv zog HUZZAH ESP8266 tus qauv thiab Dub cable tau muab txuas rau Feather nRF52 GND tus pin.

Tias txhua qhov muaj tsuas yog rau kev ua haujlwm cov qauv, raws li tau piav qhia hauv qab no, muab nws tso rau hauv lub thawv yas thiab ntsaws USB lub hwj chim muab rau hauv Feather nRF52.

Kauj ruam 4: Wifi2BLE Programming

Wifi2BLE Programming
Wifi2BLE Programming
Wifi2BLE Programming
Wifi2BLE Programming
Wifi2BLE Programming
Wifi2BLE Programming

Kev ua haujlwm ntawm HUZZAH ESP8266

Txhawm rau txhawm rau txhim kho daim ntawv pov thawj ua raws cov lus qhia tau muab rau ntawm https://github.com/esp8266/Arduino nyob rau hauv Kev Txhim Kho Nrog Cov Thawj Tswj. Thaum qhib Tus Thawj Saib Xyuas Haujlwm los ntawm Cov Cuab Yeej → Pawg ntawv qhia zaub mov thiab xaiv Hom Pabcuam thiab teeb tsa lub esp8266 platform. Txoj haujlwm no tau suav sau siv ESP8266 version 2.3.0. Lwm cov ntawv yuav muaj lawv tus kheej teeb ntawm kab thiab tej zaum yuav tsis ua haujlwm nrog cov cai no.

CEEB TOOM: TSIS TXHOB siv Adafruit Board teeb tsa raws li cov duab kos siv ntawm no yuav tsis suav sau raws li txoj cai ntawd.

Kaw thiab rov qhib Arduino IDE thiab tam sim no koj tuaj yeem xaiv "Adafruit HUZZAH ESP8266" los ntawm Cov Cuab Yeej → Board ntawv qhia zaub mov.

Koj kuj yuav tsum tau teeb tsa qhov hloov tshiab kawg ntawm pfodESP8266WiFiBufferedClient lub tsev qiv ntawv. Lub tsev qiv ntawv no ua haujlwm nrog ESP8266.com IDE plug-in V2.3. (Yog tias koj tau teeb tsa pfodESP2866WiFi lub tsev qiv ntawv yav dhau los, rho tawm phau ntawv teev npe ntawd kom tiav.)

  • a) Rub tawm pfodESP8266WiFiBufferedClient.zip cov ntaub ntawv no rau koj lub khoos phis tawj, txav nws mus rau koj lub desktop lossis qee lwm daim nplaub tshev uas koj tuaj yeem nrhiav tau yooj yim
  • b) Tom qab ntawd siv Arduino 1.8.5 IDE ntawv qhia zaub mov xaiv Sketch → Import Library → Ntxiv Library los nruab nws. (Yog tias Arduino tsis tso cai rau koj teeb tsa nws vim tias lub tsev qiv ntawv twb muaj lawm ces nrhiav thiab rho tawm cov ntawv qub pfodESP8266BufferedClient thiab tom qab ntawv import qhov no)
  • c) Nres thiab rov pib dua Arduino IDE thiab hauv File-> Piv txwv koj yuav tsum pom tam sim no pfodESP8266BufferedClient.

Teeb Network Network ssid thiab tus password thiab IP thiab chaw nres nkoj

Tom qab koj tau teeb tsa lub tsev qiv ntawv pfodESP8266BufferedClient, qhib Arduino IDE thiab luam daim duab no, Wifi_Bridge.ino, rau hauv IDE. Ua ntej koj teeb tsa tus qauv, koj yuav tsum teeb tsa koj lub network ssid thiab password thiab xaiv tus IP tsis siv.

Hloov kho peb kab no ze rau saum Wifi_Bridge.ino

char ssid = "**** ***"; char tus password = "**** *****"; char zoo li qub = "10.1.1.180";

Kuv siv Fing (Android lossis iOS) app los tshuaj xyuas kuv lub network hauv cheeb tsam thiab txheeb xyuas tus IP uas twb tau siv lawm. Feem ntau nws muaj kev nyab xeeb los xaiv tus IP tsis siv hauv thaj tsam. 180 txog.254

Txhawm rau pib nrog koj tuaj yeem tawm ntawm qhov chaw Tsis muaj li 23, tus qauv chaw nres nkoj rau kev txuas xov tooj.

Thaum koj tau ua cov kev hloov pauv no koj tuaj yeem ua haujlwm ESP8266.

Kev ua haujlwm ntawm HUZZAH ESP8266

Txhawm rau ua haujlwm HUZZAH ESP8266, txuas USB rau Serial cable raws li qhia hauv daim duab. Txheeb daim duab thiab koj cov xov hlau. Kuj pom ESP8266 Cov Lus Qhia Ua Haujlwm (espcomm tsis ua tiav)

Kuv siv Sparkfun USB rau TTL 3V3 Serial Cable vim nws muaj TX thiab RX ua cim. Nco ntsoov tias TX tus txhuas tau txuas rau RX tus pin thiab RX txhuas tau txuas rau TX tus pin raws li qhia saum toj no. Yog tias koj siv Adafruit cable, nws tsis muaj lub cim cim cim tab sis yog xim xim, liab yog lub zog, dub yog hauv av, ntsuab yog TX thiab dawb yog RX.

Txuas USB rau Serial cable rau hauv koj lub computer thiab xaiv nws COM chaw nres nkoj hauv Cov Cuab Yeej → Chaw nres nkoj ntawv qhia zaub mov. Tawm ntawm CPU Zaus, Flash Loj thiab Tshaj Tawm ntawm lawv qhov kev teeb tsa ua ntej.

Tom qab ntawd muab Adafruit HUZZAH ESP2866 module rau hauv hom phiaj ua haujlwm los ntawm kev tuav lub GPIO0 thawb khawm thiab nyem lub pob Pib dua thiab tom qab ntawd tso lub GPIO0 thawb khawm. GPIO0 coj yuav tsum nyob twj ywm tsis pom kev. Tom qab ntawv xaiv Cov Ntaub Ntawv → Tshaj Tawm lossis siv Txoj Cai xub xub los ua ke thiab rub tawm cov program. Yog tias koj tau txais cov lus yuam kev xa mus xyuas koj lub xov tooj sib txuas tau txuas rau hauv tus pin raug thiab sim dua.

Thaum lub phiaj xwm ua tiav Red Led ntawm tus qauv yuav tsum teeb. Qhov ntawd qhia tias nws tau ua tiav txuas nrog koj lub network hauv zej zog thiab pib server kom lees txais kev sib txuas.

Kuaj HUZZAH ESP2866

Txhawm rau sim HUZZAH ESP2866, tawm ntawm cov phiaj xwm txuas nrog thiab qhib Arduino IDE Cov Cuab Yeej Monitor Serial Monitor thiab teeb tsa 9600 baud (hauv qab txoj cai kaum). Tom qab ntawd qhib lub davhlau ya nyob twg ntawm koj lub computer, Kuv siv TeraTerm rau Windows thiab CoolTerm rau Mac, thiab txuas rau IP thiab chaw nres nkoj Tsis muaj koj teeb tsa hauv Wifi_Bridge.ino kos duab.

Thaum koj txuas Red Led ntawm tus qauv yuav tsum pib ntsais muag, qhia tias muaj kev sib txuas. Tam sim no koj yuav tsum tuaj yeem ntaus rau hauv koj lub khoos phis tawj qhov rai qhov rai thiab cov cim yuav tsum tshwm hauv Arduino IDE lub qhov rai saib thiab pom sib txawv.

Wifi Kev Txuas Sijhawm

Tus lej Wifi_Bridge.ino muaj sijhawm sib txuas.

uint32_t connectionTimeout = 60000; // 60sec lub sijhawm sib txuas tawm

Yog tias tsis muaj WiFi cov ntaub ntawv tau txais los ntawm HUZZAH ESP8266 module rau 60 vib nas this ces cov qauv kaw qhov kev txuas thiab tos rau qhov tshiab. Qhov no ua kom tus qauv rov zoo los ntawm 'ib nrab kaw' kev sib txuas uas tshwm sim mus rau tus neeg siv tsuas yog ploj mus vim qhov tsis zoo WiFi txuas, lub zog poob ntawm lub router lossis yuam kom kaw ntawm tus neeg siv khoom. Saib Kev Tshawb Nrhiav Ib Nrab-Qhib (Dropped) TCP/IP Qhov Txuas Txuas kom paub meej ntxiv.

Lub sijhawm sib txuas tawm no tau teeb tsa rau 60 sec. tab sis tuaj yeem txo lossis nce ntxiv raws li xav tau. Teeb nws rau 0 txhais tau tias tsis siv sijhawm ntev uas tsis pom zoo.

Programming Feather nRF52

Txhawm rau program Feather nRF52, ua raws cov lus qhia ntawm rub tawm thiab teeb tsa Arduino Board txhawb nqa rau Feather nRF52. Txheeb xyuas koj tuaj yeem txuas rau, thiab teeb tsa lub rooj tsavxwm ntawm USB cable.

NCO TSEG: Unplug HUZZAH ESP8266 module los ntawm Feather nRF52 ua ntej sim ua program Feather

Txuas Feather nRF52 rau BLE cov cuab yeej muaj ob theem. Ua ntej txheeb xyuas qhov chaw nyob MAC (thiab hom) ntawm lub cuab yeej thiab txheeb xyuas nws txhawb nqa Nordic UART cov kev pabcuam nrog TX Qhia thiab tom qab ntawd hloov qhov chaw nyob ntawd thiab ntaus mus rau daim duab kos.

Kauj ruam 5: Kev sib txuas rau BLE Device

Kev sib txuas rau BLE Device
Kev sib txuas rau BLE Device
Kev sib txuas rau BLE Device
Kev sib txuas rau BLE Device
Kev sib txuas rau BLE Device
Kev sib txuas rau BLE Device

Thaum HUZZAH ESP8266 tau ua haujlwm, koj yuav tsum tau sau tus lej BLE chaw nyob thiab hom khoom siv uas koj xav txuas rau hauv daim duab plaub nRF52. Nov yog txheej txheem ob kauj ruam. Kuv) Khiav qhov kev tshuaj xyuas kom pom BLE cov cuab yeej nyob ze uas siv Nordic UART Service (TX ceeb toom) thiab tom qab ntawd luam theej tawm lub tshuab luam ntawv tso rau hauv Feather choj kos duab kom nws txuas mus rau lub cuab yeej ntawd.

Luam theej duab rau BLE Peripherals

Txhawm rau txheeb xyuas BLE cov khoom siv sib xws, ntsaws qhov nruab nrab_bleuart_scanner.ino qhov kev pab cuam rau hauv koj cov plaub hau nRF52. Txoj haujlwm no txuas ntxiv tshuaj xyuas cov cuab yeej tshiab thiab tom qab ntawv tshuaj xyuas yog tias lawv txhawb nqa Nordic UART kev pabcuam nrog TX ceeb toom.

Nordic UART Kev Pabcuam

Nordic UART Kev Pabcuam muaj peb ntu, Kev Pabcuam UUID thiab RX thiab TX yam ntxwv. Nov yog qee qhov qauv qauv tsim los ntawm pfodDesignerV3 rau RedBear NanoV2

BLEService uartService = BLEService ("6E400001B5A3F393E0A9E50E24DCCA9E");

BLECharacteristic rxCharacteristic = BLECharacteristic ("6E400002B5A3F393E0A9E50E24DCCA9E", BLEWrite, BLE_MAX_LENGTH); BLECharacteristic txCharacteristic = BLECharacteristic ("6E400003B5A3F393E0A9E50E24DCCA9E", BLENotify, BLE_MAX_LENGTH);

pfodDesignerV3 tuaj yeem tsim qauv qauv rau tus lej ntawm BLE cov qauv. Txawm li cas los xij vim tias tsis muaj BLE kev qhia tshwj xeeb rau 'tus qauv' UART kev txuas tsis yog txhua tus qauv siv Nordic UART kev pabcuam. Piv txwv HM-10 modules (Itead BLE shield), RFduno thiab Romeo BLE siv lawv tus kheej cov kev pabcuam tshwj xeeb thiab yog li yuav tsis txuas rau Feather nRF52.

Cov laug cam hauv qab no yuav txuas:- Adafruit Bluefruit Feather nRF52, Arduino/Genuino 101, RedBearLab BLE Nano V2 thiab V1-V1.5, RedBearLab BLE Shield, Adafruit Bluefruit LE UART Phooj ywg thiab Flora Boards, Adafruit Bluefruit LE SPI (piv txwv li Bluefruit LE Shield, Bluefruit LE Micro, Feather 32u4 Bluefruit LE, Feather M0 Bluefruit LE lossis Bluefruit LE SPI Phooj Ywg) Ib yam li cov laug cam uas tuaj yeem sau nrog cov kev pabcuam tshwj xeeb lossis cov laug cam uas tuaj yeem siv BLEPeripheral lub tsev qiv ntawv.

Cov piv txwv pawg thawj coj siv ntawm no yog Arduino/Genuino 101 nrog cov lej tsim los ntawm pfodDesignerV3. Pub dawb pfodDesignerV3 tso cai rau koj los tsim pfodApp menus thiab tom qab ntawd tsim Arduino code tsim nyog los qhia cov ntawv qhia meej ntawm koj lub xov tooj ntawm tes siv (them nyiaj) pfodApp. pfodApp tseem yuav txuas ntawm Wifi, ntxiv rau Bluetooth Classic, BLE thiab SMS, thiab yog li tuaj yeem txuas ntawm Wifi2BLE tus choj no. Txawm li cas los xij txawm tias koj tsis xav siv pfodApp ua koj li app tswj, koj tseem tuaj yeem siv pfodDesignerV3 los tsim Nordic UART cov cai pabcuam rau koj pawg BLE.

Qhov kev qhia txuas no piav qhia teeb tsa Arduino/Genuino 101 BLE thiab tsim kom yooj yim LED rau/tawm kev tswj nrog pfodDesignerV3. Cov duab kos tsim los ntawm pfodDesignerV3 yog Arduino101_led_control.ino

Kev ua haujlwm Arduino/Genuino 101 nrog Arduino101_led_control.ino yuav cia koj txuas nrog pfodApp thiab tso saib lub vijtsam hauv qab no ntawm koj lub xov tooj ntawm tes.

Txawm li cas los xij qhov no tsuas yog qhov piv txwv thiab koj tsis tas yuav yuav pfodApp kom ua tiav txoj haujlwm no. Qhov tseem ceeb yog qhov dawb pfodDesignerV3 app tau tsim cov cai rau Arduino/Genuino 101 uas ua haujlwm rau Nordic UART Service. Yog li cia scan rau nws.

Txawm li cas los xij qhov no tsuas yog qhov piv txwv thiab koj tsis tas yuav yuav pfodApp kom ua tiav txoj haujlwm no. Qhov tseem ceeb yog qhov dawb pfodDesignerV3 app tau tsim cov cai rau Arduino/Genuino 101 uas ua haujlwm rau Nordic UART Service. Yog li cia scan rau nws.

Luam theej duab rau Nordic UART Kev Pabcuam

Nrog HUZZAH ESP8266 module txuas los ntawm Feather nRF52, program Feather nRF52 nrog rau hauv nruab nrab_bleuart_scanner.ino thiab tom qab ntawd qhib Arduino IDE Tools → Serial Monitor thiab teeb tsa baud tus nqi rau 9600. Powering Arduino/Genuino 101 muab cov khoom tso tawm pom hauv thawj qhov tshuaj ntsuam saum toj no.

Raws li koj tuaj yeem pom lub tshuab luam ntawv pom ob lub cuab yeej BLE, Arduino/Genuino 101 nrog pom Nordic UART cov kev pabcuam rau nws, TAB SIS TX tus yam ntxwv tsis txhawb kev ceeb toom. Lub tshuab ntsuas kuj tseem pom RFduino BLE module tab sis RFduino tsis siv Nordic UART Service tab sis siv nws tus kheej xwb. Pawg Bluetooth tsis lees paub qhov no rau qhov tsis tau hais meej txog 'tus qauv' UART Service, es tsis txhob tso txhua tus neeg tsim khoom los ua lawv li.

Raws li tau hais los saum toj no 101 tsab cai tau tsim los ntawm pfodDesignerV3 feem ntau siv rau pfodApp. pfodApp tsis zoo li xaiv TX ceeb toom raws li Feather nRF52 uart code yog. pfodApp ua haujlwm nrog 101 raws li tau npaj tseg tab sis Feather nRF52 hais txog TX ceeb toom yog li kev hloov pauv me me rau cov cai yog xav tau kom txaus siab rau Feather.

Qhib Arduino101_led_control.ino hauv Arduino IDE thiab ze rau saum toj koj yuav pom ob kab no. Kab thib ob tsuas yog piav qhia tus yam ntxwv thiab tsis cuam tshuam rau kev ua haujlwm.

BLECharacteristic txCharacteristic = BLECharacteristic ("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLEIndicate, BLE_MAX_LENGTH), BLEDescriptor txNameDescriptor = BLEDescriptor ("2901"), TX

Hloov lawv mus

BLECharacteristic txCharacteristic = BLECharacteristic ("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLENotify, BLE_MAX_LENGTH); BLEDescriptor txNameDescriptor = BLEDescriptor ("2901", "TX - (Qhia)");

Tom qab ntawv rov kho dua 101 nrog rau qhov hloov kho no, Arduino101_Notify_led_control.ino. Tom qab ntawd thaum koj rov ua haujlwm plaub hau nRF52 scanner (central_bleuart_scanner.ino), Serial Monitor qhia pom qhov tshuaj ntsuam thib ob saum toj no.

Tsis muaj qhov yuam kev rau Genuino 101 tam sim no thiab lub tshuab luam ntawv luam tawm cov cai xav tau rau Feather nRF52 tus choj kos duab kom nws yuav txuas rau 101. Lub tshuab luam ntawv yuav tshuaj xyuas txhua lub cuab yeej nws pom hauv ntau yam. Liab coj lub teeb ib zaug rau txhua lub cuab yeej pom nrog Nordic UART Service (TX Ceeb Toom).

Kauj Ruam 6: Txuas mus rau BLE Peripheral

LED Qhia

Feather nRF52 muaj ob lub coj, Xiav thiab Liab. Thaum lub rooj tsav xwm tau txuas nrog BLE lub cuab yeej, Blue Led yog qhov tas li, txwv tsis pub nws yog teeb. Lub tshuab luam ntawv tsis txuas nrog lub cuab yeej yog li nws Blue coj yog feem ntau flashing. Liab coj teeb ib zaug rau txhua qhov Nordic UART Service (TX ceeb toom) ntaus ntawv. Thaum khiav raws li lub tshuab luam ntawv Red Led suav tus naj npawb ntawm Nordic UART Service (TX ceeb toom) cov cuab yeej pom. Thaum khiav raws li tus choj, Liab Liab ci ib zaug thaum txuas nrog tus lej BLE chaw nyob.

Txuas mus rau BLE Peripheral

Tam sim no tias lub tshuab luam ntawv kos duab tau muab cov ntsiab lus rau BLE lub cuab yeej koj xav txuas rau, koj tuaj yeem luam cov ntawv tso rau hauv nruab nrab_bleuart_bridge.ino kos duab. Nyob ze rau saum daim duab ntawd koj yuav pom cov cai hauv qab no.

// Cov kab peb kab tom ntej no los ntawm central_bleuart_scanner.ino cov zis

const char *BLE_NAME = "GENUINO 101-FC8F"; const char *BLE_ADDRESS = "98: 4F: EE: 0C: FC: 8F"; const uint8_t BLE_ADDRESS_TYPE = 0;

Hloov peb kab ntawm cov lej nrog cov zis los ntawm lub tshuab luam ntawv rau BLE lub cuab yeej koj xav txuas rau. Tom qab ntawv teeb tsa Feather nRF52 nrog kho qhov chaw nruab nrab_bleuart_bridge.ino.

Kuaj qhov nruab nrab_bleuart_bridge kos duab

Ua ntej ntsaws HUZZAH ESP8266 rov qab rau hauv Feather nRF52, sim txuas rau koj li BLE ntaus ntawv. Tawm ntawm Feather nRF52 txuas nrog koj Arduino IDE, qhib Cov Cuab Yeej → Serial Monitor ntawm 9600 baud thiab tom qab ntawd txheeb xyuas koj lub hom phiaj BLE cov cuab yeej siv tau.

Thaum qhov kev sib txuas tau ua rau koj lub cuab yeej BLE, raws li tau piav qhia saum toj no, Xiav coj yuav ci ntsa iab tas li thiab Liab liab yuav nyem ib zaug txhua 10sec lossis ntau dua. Qhov no cia koj tsis muaj kev sib txuas tau ua thiab raug saib xyuas.

Tom qab ntawd hauv Serial Monitor koj tuaj yeem nkag mus rau cov lus txib uas koj xav tias yuav xa mus rau koj li BLE ntaus ntawv thiab saib nws ua haujlwm thiab saib xyuas cov lus teb uas nws xa rov qab. Yog tias txhua yam zoo koj tuaj yeem tso lub hwj chim thiab txuas rau HUZZAH ESP8266 module.

Kauj Ruam 7: Txuas rau BLE Device Via WiFi - Muab Nws Ua Ke

Thaum koj tau npaj thiab sim HUZZAH ESP8266 tus qauv nrog nws tus lej txuas (Wifi_Bridge.ino) teeb tsa rau koj lub network ssid thiab tus password thiab IP THIAB programmed thiab sim Feather nRF52 nrog nws tus lej choj (central_bleuart_bridge.ino) teeb tsa nrog BLE ntaus ntawv qhov chaw nyob thiab ntaus, tom qab ntawd koj tuaj yeem ntsaws lawv ua ke thiab ntsaws rau hauv USB muab rau Feather module txhawm rau txhawb lawv ob qho tib si.

HUZZAH module Liab coj yuav tsum ua kom pom kev zoo li nws txuas rau koj lub network network hauv zos thiab Feather Blue coj yuav tsum teeb pom kev zoo li nws txuas rau koj li BLE lub cuab yeej thiab Feather Red coj yuav tsum nyem ib zaug txhua 10 vib nas this lossis li ntawd los qhia qhov tseeb xwb Cov cuab yeej BLE txuas nrog.

Qhib koj lub program telnet thiab txuas rau HUZZAH tus IP thiab chaw nres nkoj. HUZZAH Liab coj yuav tsum nyem qeeb los qhia koj txoj haujlwm tau txuas nrog thiab koj yuav tsum tau xa lus txib rau koj li cuab yeej BLE ntawm WiFi thiab saib BLE ntaus ntawv ua haujlwm thiab pom ib qho lus teb hauv koj lub qhov rais telnet. Nco ntsoov yog tias koj lub cuab yeej BLE tsis xa cov ntaub ntawv rov qab rau 60sec, tus lej HUZZAH yuav siv sijhawm txuas thiab txuas thiab HUZZAH Red led yuav rov khov dua.

Kauj Ruam 8: Pab - Nws Tsis Ua Haujlwm

Ua ntej ua qhov kev sim ntsuas cov ntsiab lus saum toj no, Xeem HUZZAH ESP2866 thiab Xeem lub hauv paus_bleuart_bridge kos duab.

Teeb Meem Teeb Meem

Yog tias lub tshuab luam ntawv tsis tuaj yeem pom koj BLE lub cuab yeej nws yog nyob deb dhau los lossis tsis tshaj tawm lossis twb tau txuas nrog qee yam. Sim txav lub tshuab luam ntawv kom ze zog thiab siv lub tshuab fais fab thiab tua txhua lwm yam nyob ze ntawm cov khoom siv mobile uas tej zaum yuav muaj kev sib txuas rau BLE ntaus ntawv.

Yog tias koj tau txais lub tshuab luam ntawv zoo li no.

Txuas mus rau 98: 4F: EE: 0C: FC: 8F Nrhiav kev pabcuam Nordic UART… Tsis pom lossis LOSSIS tsis pom tau !!!!! Tsis tuaj yeem txheeb xyuas Nordic UART Kev Pabcuam !!!!!!!! Yog tias koj tab tom cia siab Nordic UART Kev Pabcuam, txav lub Scanner ze rau BLE lub cuab yeej !!!!

Nws yuav yog qhov koj nyob ze txaus rau BLE lub cuab yeej los tshuaj xyuas nws tab sis tsis ze txaus kom ua tiav Kev Pabcuam nrhiav kom pom Nordic UART kev pabcuam. Sim txav ze rau BLE lub cuab yeej.

Raws li qhov kawg koj tuaj yeem siv dawb Nordic nRF Txuas app rau Android lossis iOS. Qhov app ntawd muaj ntau yam zoo dua thiab rhiab heev. Nws yuav qhia koj yog tias BLE lub cuab yeej muaj Nordic UART Service. Txawm li cas los koj tseem yuav tsum tau txais lub tshuab luam ntawv kom khiav thiab txuas thiab txheeb xyuas Nordic UART Serivice ua ntej koj sim siv Wifi2BLE tus choj vim nws siv cov lej zoo ib yam li lub tshuab luam ntawv.

Yog tias koj xav khawb ntxaum koj tuaj yeem siv Adafruit Bluefruit LE Sniffer module kom pom dab tsi hauv huab cua.

Teeb meem kev sib txuas BLE

Yog tias koj tswj xyuas lub cuab yeej BLE ces feem ntau yuav ua rau muaj teeb meem kev sib txuas yog kuv) BLE lub cuab yeej nyob deb dhau, II) lwm yam twb tau txuas nrog BLE lub cuab yeej

Teeb meem Kev Txuas WiFi

Yog tias HUZZAH ESP8266 Liab coj tsis pom teeb pom kev ces nws tsis muaj kev sib txuas rau koj lub network ntawm koj lub router. Txheeb xyuas ssid thiab tus lej koj muaj tus lej nkag mus rau Wifi_Bridge.ino thiab siv Fing app Android lossis iOS los tshuaj xyuas tias tus IP koj tau faib tsis tau siv lawm. Sim ua kom lub zog tag nrho koj lub khoos phis tawj thiab cov khoom siv thiab lub zog caij lub router (tso nws tawm rau 20sec) thiab tom qab ntawd luam theej duab nrog Fing dua.

Kauj Ruam 9: Kev txuas ntxiv thiab Xaus

Txoj haujlwm nthuav tawm ntawm no yog qhov yooj yim tshaj plaws. Muaj ntau tus lej txuas ntxiv tau xws li:-

  • Cov plaub hau nRF52 muaj peev xwm txuas mus txog 4 BLE cov cuab yeej ib zaug yog li koj tuaj yeem hloov kho cov cai kom ntxiv qhov chaw nyob raug thiab tswj tau txog 4 lub cuab yeej los ntawm ib qho txuas WiFi. Saib cov piv txwv tus lej uas los nrog Feather nRF52 board teeb tsa.
  • Koj tuaj yeem ntaus qhov hauv koj lub router kom nkag tau mus rau BLE cov cuab yeej los ntawm txhua qhov chaw hauv internet. Saib Txuas Txuas DIY IoT cov cuab yeej rau Is Taws Nem nrog pfodApp.
  • Koj tuaj yeem siv tus lej los ntawm Pheej Yig/Yooj Yim Wifi Shield los tso cai rau koj teeb tsa WiFi network tsis rau HUZZAH ntawm lub vev xaib, yam tsis tau rov sau dua. Koj yuav tsum tau ntxiv qhov teeb tsa thawb khawm rau hauv Circuit Court.
  • Koj tuaj yeem ntxiv qhov teeb tsa thawb khawm (siv tib lub pob zoo li saum toj no) uas ua rau Feather nRF52 luam theej duab rau BLE cov cuab yeej nrog Nordic UART (TX Tshaj Tawm) thiab tom qab ntawd khaws cov ntsiab lus sib txuas rau ib qho nrog lub teeb liab muaj zog tshaj plaws. Txhawm rau txuag qhov txiaj ntsig, koj yuav tsum siv nffs lub tsev qiv ntawv uas los nrog Adafruit nRF52 pawg thawj coj teeb tsa.
  • Koj tuaj yeem ntxiv nplooj ntawv web rau HUZZAH ESP8266 code los muab kev cai sib cuam tshuam rau koj li BLE ntaus ntawv. Koj kuj tseem tuaj yeem siv pfodDesignerV3 thiab pfodApp ntxiv qhov kev cai cuam tshuam nrog tsis muaj kev hloov pauv rau txoj haujlwm no txhua.

Xaus

Txoj haujlwm yooj yim no muab WiFi nkag mus rau ib qho Bluetooth Tsawg Zog (BLE) cov qauv uas siv Nordic's UART nrog TX Tshaj Tawm. Tus choj Wifi2BLE yog pob tshab tag. Nws tsuas yog xa cov ntaub ntawv WiFi mus rau BLE lub cuab yeej thiab dhau BLE cov cuab yeej cov ntaub ntawv rov qab mus rau WiFi txuas.

Kev tsim kho yooj yim thiab cov lus qhia ntxaws ntsuas ua qhov no yog txoj haujlwm tsim nyog rau cov pib tshiab uas xav nkag mus rau lawv cov cuab yeej BLE los ntawm lawv lub khoos phis tawj lossis los ntawm sab nraud BLE qhov qub.

Txoj haujlwm no yuav dhau los ua qhov tseem ceeb dua thaum BLE cov cuab yeej siv software ua tiav nrog Bluetooth V5 Mesh tshiab tshwj xeeb. Tom qab ntawd Wifi2BLE yuav muab internet nkag rau koj lub tsev tag nrho kev siv tshuab.

Pom zoo: