[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 7. NRF51822 ๋น„์ฝ˜ ํ…Œ์ŠคํŠธ ๋ฐ ์ดˆ๊ธฐ ์„ค์ •
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
๋“œ๋””์–ด ์•Œ๋ฆฌ์—์„œ ๊ตฌ๋งคํ•œ NRF51822 BLE4.2 ๋น„์ฝ˜์ด ๋„์ฐฉํ–ˆ๋‹ค. ๊ฐœ๋‹น 6000์›์— ๋ฐฐํ„ฐ๋ฆฌ 4๊ฐœ ์ •๋„ ํ•ด์„œ 3๋งŒ ์› ์ •๋„์— ๊ตฌ๋งคํ–ˆ๋‹ค. ๋‹ค์Œ ๊ธ€๋กœ ์‚ผ๋ณ€์ธก๋Ÿ‰์— ๋Œ€ํ•ด ํฌ์ŠคํŒ…ํ•  ์˜ˆ์ •์ด์ง€๋งŒ, ๋น„์ฝ˜์œผ๋กœ ์‹ค๋‚ด ์ธก์œ„๋ฅผ ์œ„ํ•ด์„  ์ตœ์†Œ 3๊ฐœ์˜ ๋น„์ฝ˜์ด ํ•„์š”ํ•˜๋‹ค.์กฐ๋ฆฝ์€ ๊ฐ„๋‹จํ•˜๋‹ค ๋ฐฐํ„ฐ๋ฆฌ ์žฅ์ฐฉ ํ›„ ๋‚˜์‚ฌ 3๊ฐœ๋งŒ ์กฐ์—ฌ์ฃผ๋ฉด ๋œ๋‹ค.beacon ๊ตฌ๋งค ํ›„ beacon์„ ์ดˆ๊ธฐ ์„ค์ •ํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค. ์„ค์ • ๋ฐฉ๋ฒ•์€ ์ œ์ž‘์‚ฌ์—์„œ ์ œ๊ณตํ•˜๋Š” Holyiot-beacon์„ ์„ค์น˜ํ•˜๋ฉด ๋œ๋‹ค.์šฐ์„ , ํ•˜๋‚˜์˜ ๋น„์ฝ˜๋งŒ ๋™์ž‘ ์ค‘์ด๋ฉฐ ๋‹ค์šด๋กœ๋“œํ•œ ์•ฑ์„ ์‹คํ–‰ํ•  ๊ฒฝ์šฐ ์•„๋ž˜์™€ ๊ฐ™์ด ํ™”๋ฉด์— ํ‘œ์‹œ๋œ๋‹ค.๋น„์ฝ˜์˜ ์—ฐ๊ฒฐ์„ ์œ„ํ•ด์„  ์ตœ์ดˆ์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์š”๊ตฌํ•œ๋‹ค. ๋‚ด๊ฐ€ ๊ตฌ๋งคํ•œ ๋น„์ฝ˜์˜ ๊ฒฝ์šฐ ์ดˆ๊ธฐ ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” aa14061112 ์ด๋‹ค.๋น„์ฝ˜์„ ์—ฐ๊ฒฐํ•˜๊ณ  ๋‚˜๋ฉด, password, major, minor,..
[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 6. RSSI ๋ณ€๋™์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ์ด๋™ ํ‰๊ท  ํ•„ํ„ฐ
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
BLE RSSI์˜ ๋ฌธ์ œ์ ์€ ์œ„ ๊ทธ๋ฆผ๊ณผ ๊ฐ™๋‹ค.4.5m ์ด์ƒ์—์„œ๋Š” ์ œ๋Œ€๋กœ ๋œ ๊ฑฐ๋ฆฌ๋ฅผ ๊ณ„์‚ฐํ•  ์ˆ˜ ์—†์Œ. (๋‚˜์ค‘์—๋Š” ํ†ต์‹  ๊ฑฐ๋ฆฌ๊ฐ€ ๋” ๊ธธ์–ด์ง„ BLE5.0์— ๋Œ€ํ•ด ์•Œ์•„๋ณผ ์˜ˆ์ •)์‹ค์ œ ํ™˜๊ฒฝ์—์„œ๋Š” ๋งŽ์€ ์™ธ๋ถ€ ์š”์ธ์œผ๋กœ ์ธํ•ด RSSI ๋ณ€๋™์ด ๋ฐœ์ƒํ•ด ๊ฑฐ๋ฆฌ์˜ ์˜ค์ฐจ๊ฐ€ ๋ฐœ์ƒํ•จ.๐Ÿ“Œ 1. ์ด๋™ ํ‰๊ท  ํ•„ํ„ฐRSSI ๋ณ€๋™์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•์€ ์—ฌ๋Ÿฌ ๊ฐ€์ง€๊ฐ€ ์žˆ๋Š”๋ฐ ๊ทธ ์ค‘ ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ์ด๋™ํ‰๊ท  ํ•„ํ„ฐ์ด๋‹ค.์›๋ฆฌ๋Š” ๊ฐ„๋‹จํ•˜๋‹ค. ํ•˜๋‚˜์˜ ์œˆ๋„์šฐ ์‚ฌ์ด์ฆˆ๋งŒํผ ๊ทธ๋ฃน์„ ๋ฌถ๋Š”๋‹ค.๊ทธ๋ฃน์˜ ํ‰๊ท  ๊ฐ’์„ ๋Œ€ํ‘ฏ๊ฐ’์œผ๋กœ ์žก๋Š”๋‹ค.ํ•œ ์นธ์”ฉ ์ด๋™ํ•œ๋‹ค. (Convolution 1D์™€ ๊ฐ™์€ ์›๋ฆฌ)์ด ๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ์Šค๋ฌด๋”ฉ ํšจ๊ณผ๋ฅผ ๋‚ผ ์ˆ˜ ์žˆ๋‹ค. RSSI ๊ฐ’์ด ํ™• ํŠ€์—ˆ์„ ๋•Œ ์ด๋ฅผ ์™„ํ™”์‹œ์ผœ์ฃผ๋Š” ํšจ๊ณผ๋ฅผ ๋‚ธ๋‹ค. ๋‹น์—ฐํžˆ ๋‹จ์ ๋„ ์กด์žฌํ•œ๋‹ค.  delay๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค. ์œˆ๋„์šฐ ์‚ฌ์ด์ฆˆ๋งŒํผ ํ‰๊ท  ๋‚ด๊ธฐ ..
[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 5. BLE Beacon์˜ RSSI ๊ฐ’์—์„œ ๊ฑฐ๋ฆฌ๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ๋ฐฉ๋ฒ• (feat.log distance path los
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
๐Ÿ“ˆ 1. Log distance path loss modelRSSI๋Š” ์ˆ˜์‹  ์‹ ํ˜ธ ๊ฐ•๋„ ํ‘œ์‹œ๊ธฐ๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค. ์Šค๋งˆํŠธํฐ๊ณผ ๊ฐ™์€ ์ˆ˜์‹  ์žฅ์น˜์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋Š” ๋น„์ฝ˜์˜ ์‹ ํ˜ธ ๊ฐ•๋„์ด๋‹ค. ์‹ ํ˜ธ ๊ฐ•๋„๋Š” ๊ฑฐ๋ฆฌ์™€ ์ „์†ก ์„ธ๊ธฐ์— ๋”ฐ๋ผ ๋‹ค๋ฅด๋‹ค. RSSI๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ฑฐ๋ฆฌ๋ฅผ ๊ตฌํ•˜๋Š” ์‹์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.d : distance(๊ฑฐ๋ฆฌ)n : ๋ณด์ • ์ƒ์ˆ˜ (2~4: ๋ณดํ†ต 2๋ฅผ ์‚ฌ์šฉ)α : 1m์—์„œ ์ธก์ •๋œ RSSIRSSI : ์ธก์ •๋œ ํ˜„์žฌ RSSI๐Ÿ”— 2. Codeimport "dart:math";void main() { int n = 2; // constant N int alpha = -63; // rssi at 1m int rssi = -80; // measured rssi num m = pow(10.0,((alph..
[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 4. BLE advertising packet ๊ธฐ๋ณธ ๊ตฌ์„ฑ
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
๐Ÿ“Œ 1. BLE Packet BLE์˜ ํŒจํ‚ท ํƒ€์ž…์€ ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค. Advertising channl PDUs : ๊ธฐ๊ธฐ ๊ฐ์ง€ ๋ฐ ๋ธŒ๋กœ๋“œ์บ์ŠคํŒ…Data channel PDUs : ๋ฐ์ดํ„ฐ ์ „์†ก์šฉโ€‹์‹ค๋‚ด ์ธก์œ„์—์„œ๋Š” ๋ฐ์ดํ„ฐ ์ „์†ก์ด ๋”ฐ๋กœ ํ•„์š” ์—†์œผ๋ฏ€๋กœ Advertising channel PDUs์— ๋Œ€ํ•ด์„œ๋งŒ ์–ธ๊ธ‰ํ•œ๋‹ค.โ€‹ Packet types์€ ์•„๋ž˜ ํ…Œ์ด๋ธ”๊ณผ ๊ฐ™๋‹ค. ๋ณดํ†ต ๋น„์ฝ˜์˜ ํƒ€์ž…์€ ADV_IND๊ฐ€ ์ผ๋ฐ˜์ ์ด๋‹ค. ํŠน์ • ์ค‘์•™ ์žฅ์น˜๋ฅผ ํŠน์ •ํ•˜์ง€ ์•Š๊ณ  ๋ชจ๋“  ์ฃผ๋ณ€ ๊ธฐ๊ธฐ์™€ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค.Payload๋Š” ์ตœ๋Œ€ 37๋ฐ”์ดํŠธ ์ค‘์—์„œ 6๋ฐ”์ดํŠธ๋Š” Advertisement Address, ๋‚˜๋จธ์ง€ 0 ~ 31๋ฐ”์ดํŠธ๋Š” Advertisement Data์ด๋‹ค.BLE ๋น„์ฝ˜์—๋Š” ๊ฐ ์ œ์กฐ์‚ฌ์— ๋”ฐ๋ผ ๋‹ค์–‘ํ•œ ํŒจํ‚ท ํฌ๋งท์„ ๊ฐ€์ง„๋‹ค. ๊ทธ์ค‘ ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ๊ฒƒ์ด ..
[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 3. Flutter BLE Scan Demo Program, RSSI monitoring
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
ํ•˜์ด์ œ๋‹ˆ์Šค ๋‹˜์˜ ํฌ์ŠคํŒ…์— ํฌํ•จ๋œ ์ฝ”๋“œ๋ฅผ ์ผ๋ถ€ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.https://blog.naver.com/chandong83/222414483554BLE ํ†ต์‹  ์Šค์ผ€์ค„ ๋ฐ ์•ˆ๋“œ๋กœ์ด๋“œ ๋™์ž‘์— ๊ด€ํ•œ ํฌ์ŠคํŒ…์„ ๋ณด๊ณ  ์™€์•ผ ์–ด๋Š ์ •๋„ ์ดํ•ดํ•˜๊ธฐ ํŽธํ•˜๋‹ค.๐Ÿ“Œ  โ€‹1.  ํŒจํ‚ค์ง€ ์„ค์น˜ ๋ฐ ์„ค์ •flutter_blue ๋Œ€์‹  flutter_blue_plus ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•œ๋‹ค.flutter_blue๋Š” ๋” ์ด์ƒ ์—…๋ฐ์ดํŠธํ•˜์ง€ ์•Š๊ณ  ์•ˆ๋“œ๋กœ์ด๋“œ 12 ๊ถŒํ•œ ์ด์Šˆ๊ฐ€ ์žˆ์œผ๋ฏ€๋กœ, flutter_blue_plus๋ฅผ ์„ค์น˜ํ•œ๋‹ค.$ flutter pub add flutter_blue_plus์„ค์น˜ํ•˜๊ฒŒ ๋˜๋ฉด ์•Œ์•„์„œ dependecies๊ฐ€ ์ถ”๊ฐ€๋œ๋‹ค.โš™๏ธ 1. android/app/build.gradle : SDK ์ตœ์†Œ ๋ฒ„์ „ 19๋กœ ์„ค์ •Android { def..
[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 2. Bluetooth Low Energy(BLE) ํ†ต์‹  ์Šค์ผ€์ค„, ์•ˆ๋“œ๋กœ์ด๋“œ ํ•จ๊ป˜ ์ดํ•ดํ•˜๊ธฐ
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
BLE ํ†ต์‹ ์„ ํ•˜๊ธฐ ์ „์— ํ†ต์‹  ์Šค์ผ€์ค„์— ๋Œ€ํ•ด ์ดํ•ดํ•˜๊ณ  ๊ฐ€๋ฉด ์ข‹๋‹ค. BLE์˜ ๋ฌผ๋ฆฌ ๊ณ„์ธต ๋จผ์ € ๊ฐ„๋‹จํ•˜๊ฒŒ ์งš๊ณ  ๊ฐ„๋‹ค. BLE๋Š” 2.4GHz ๋Œ€์—ญ์„ ์‚ฌ์šฉํ•˜๋ฉฐ, (2.402 GHz ~ 2.4835 GHz) : 2 MHz ๊ฐ„๊ฒฉ์œผ๋กœ 40๊ฐœ ์ฑ„๋„๋กœ ๊ตฌ์„ฑ๋œ๋‹ค. Advertising ์ฑ„๋„์€ 37, 38, 39 (2402 MHz, 2426 MHz, 2480 MHz)๋ฅผ, Adaptive Frequency Hopping ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•œ๋‹ค.๐Ÿ“Œ ์‹ค๋‚ด ์ธก์œ„ (Indoor Positioning)Advertiser์€ ์†ก์‹ ๋ถ€, Scanner๋Š” ์ˆ˜์‹ ๋ถ€๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ํŽธํ•˜๋‹ค. ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ๋Š” ๋”ฐ๋กœ ๊ธฐ๊ธฐ ๊ฐ„ ์—ฐ๊ฒฐ์„ ํ•„์š”๋กœ ํ•˜์ง€ ์•Š๊ณ , Device discovery ๋ชจ๋“œ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค. ์‹ค๋‚ด ์ธก์œ„์— ๊ฐ„๋žตํžˆ ์„ค๋ช…ํ•˜์ž๋ฉด, Advertiser๊ฐ€ ๋ชจ๋“ ..
[BLE ์‹ค๋‚ด ์ธก์œ„ ํ”„๋กœ์ ํŠธ] 1. Flutter_blue ์„ค์ • (feat.์•ˆ๋“œ๋กœ์ด๋“œ12 ๊ถŒํ•œ ์ด์Šˆ)
ยท
๐Ÿ’กProject/โœ… BLE Indoor Positioning
๊ฐœ์ธ ํ”„๋กœ์ ํŠธ์ธ BLE ์‹ค๋‚ด ์ธก์œ„ ์ฒซ ๊ธ€์ด๋‹ค. ์šฐ์„ , flutter์—์„œ ble ๊ด€๋ จ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•œ๋‹ค. ๋Œ€ํ‘œ์ ์œผ๋กœ ble ๊ด€๋ จ ํŒจํ‚ค์ง€๋Š” 3๊ฐœ๊ฐ€ ์žˆ๋‹ค. flutter_ble_libflutter_reactive_bleflutter_blueflutter_ble_lib๋Š” ์—…๋ฐ์ดํŠธ๊ฐ€ ๋Š๋ ค, 2๋ฒˆ๊ณผ 3๋ฒˆ ์ค‘ ๊ณจ๋ผ์•ผ ํ•˜๋Š”๋ฐ, ์˜ค๋Š˜ ์ž ๊ธฐ์ค€์œผ๋กœ flutter_blue๊ฐ€ ์ตœ์‹  ๋ฒ„์ „์ด ์žˆ์–ด flutter_blue๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. flutter ํŒจํ‚ค์ง€๋Š” pub.dev์—์„œ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค. ํ˜น์€ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค.$ flutter pub add flutter_blue์„ค์น˜ํ•˜๊ฒŒ ๋˜๋ฉด ์ž๋™์ ์œผ๋กœ pubspec.yaml ํŒŒ์ผ์˜ dependecies์— ์ถ”๊ฐ€๋œ๋‹ค.  ํ•˜์ง€๋งŒ, flutter_blue์˜ ๊ฒฝ์šฐ ์•ˆ๋“œ๋กœ์ด๋“œ 12์—..
18์ง„์ˆ˜
'๐Ÿ’กProject/โœ… BLE Indoor Positioning' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก