[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' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก