2024年11月22日星期五 上午12:22:45

蓝牙网关和蓝牙Beacon室内定位方案。

2 年 前
#1280 引用
蓝牙网关和蓝牙Beacon的应用是目前比较广泛的两个室内定位方案。
.
Bluetooth-based presence detection

USB dongle ASUS BT500 (Bluetooth 5.0)


What is BLE? -Bluetooth Low Energy basics
https://www.rfwireless-world.com/Terminology/what-is-BLE.html


Bluetooth vs BLE-difference between Bluetooth and BLE(Bluetooth Low Energy)
https://www.rfwireless-world.com/Terminology/Bluetooth-vs-BLE.html

基于蓝牙的3种协议,对应了home assistant 的3个Integration


Bluetooth Classic

Bluetooth Low Energy (LE)

iBeacon Tracker


rpi蓝牙设备跟踪

Bluetooth   -  https://www.home-assistant.io/integrations/bluetooth
Bluetooth Tracker  -  https://www.home-assistant.io/integrations/bluetooth_tracker
Bluetooth LE Tracker - https://www.home-assistant.io/integrations/bluetooth_le_tracker/
iBeacon Tracker - https://www.home-assistant.io/integrations/ibeacon/


Bluetooth Tracker  -  https://www.home-assistant.io/integrations/bluetooth_tracker
Bluetooth LE Tracker - https://www.home-assistant.io/integrations/bluetooth_le_tracker/
iBeacon Tracker - https://www.home-assistant.io/integrations/ibeacon/


Private BLE Device Integration

Bluetooth LE Tracker - https://www.home-assistant.io/integrations/bluetooth_le_tracker

This tracker discovers new devices on boot and in regular intervals and tracks Bluetooth low-energy devices periodically based on interval_seconds value. It is not required to pair the devices with each other.

Devices discovered are stored with ‘BLE_’ as the prefix for device mac addresses in known_devices.yaml.


Useful links
https://zhuanlan.zhihu.com/p/585537459
0
2 年 前
#1281 引用
.Server  software
Raspberry Pi 3B
└── .Debain 11 OS
    ├── Bluetooth    --> is active?
    │   ├── Passive BLE Monitor integration
    │   │   ├── /home/homeassistant/.homeassistant/configuration.yaml
    │   │   ├── turn_light_off_lounge.yaml
    │   │   ├── turn_light_on_bedroom.yaml
    │   │   └── home-assistant_v2.db  --> /home/homeassistant/.homeassistant/home-assistant_v2.db
    │   ├── Bluetooth LE Tracker  integration  
    │   └── Bluetooth Tracker  integration        https://www.home-assistant.io/integrations/xiaomi_ble
    │   └── Xiaomi BLE  integration        https://www.home-assistant.io/integrations/xiaomi_ble
    │       └── Bluetooth integration     detect nearby Bluetooth devices              
    ├── service  -->/etc/systemd/system/[email protected]
    ├── ssh server
    ├── nginx with let’s
    ├── frp
    └── git

Make Python virtual environment + Home Assistant Core run automatically



http://localhost:4999/zh/boards/topic/14414/passive-ble-monitor-integrationadd-xiami-motion-sensor-2-rtcgq02lm-to-home-assistant#18884


iBeacon Tracker

Step 1.Open bluetooth

Step 2:using the phones as BLE iBeacon transmitters

Enable BLE Transmitter sensor in Home Assistant Companion App

The BLE Transmitter on my  phones has start working.

In the Companion app settings the BLE Transmitter still shows as enable.

https://companion.home-assistant.io/docs/core/sensors#bluetooth-sensors



BLE Transmitter sensor allows your phones device to transmit a BLE iBeacon.

the beacon is  sent.

Step 3:

The iBeacon is  being detected by the iBeacon Tracker integration.

https://www.home-assistant.io/integrations/ibeacon


what steps are required to make home assistant iBeacon Tracker integration detect my phone?

Bluetooth running fine
IBeacon integration installed, but does not report anything.
HA companion app, sensor BLE transmitter enabled
Updated values Major = 1000, Minor = 2000 (for what it’s worth?)




自己动手 IBeacon 室内定位 完整体验(超详细过程)

https://blog.csdn.net/u011341435/article/details/18948137

源码产品

iBeacon 是苹果公司推出的一项室内定位技术,通过软件和硬件的结合,从而大大提高室内精度,从原来的几百米,几十米,提高到一米以内的定位精度。有了这么高精度的定位能力,许多原来只能想一想的事情,现在可以做到了:当你走到某个商品前,手机应用自动跳出商品的介绍,让你的购物体验感,大大增强。下图是一个典型的应用场景:

0
2 年 前
#10253 引用
BLE Transmitter or Beacon Monitor?

https://community.home-assistant.io/t/ble-transmitter-or-beacon-monitor/471846

BLE Transmitter for Production
We would like to add a BLE transmitter to our board so that it can serve as an iBeacon (and whatever the non-Apple equivalent is known as).


BLE Transmitter as scanner  by msly


Owntracks works very badly with beacons on Android, unfortunately. My solution was to use the “Beacon Locator” app which can execute Tasker actions, and the “MQTT Publisher Plugin” for Tasker.

BLE (Bluetooth Low Energy) 设备可以通过扫描发现周围的其他 BLE 设备。当 BLE 设备执行扫描时便处在 scanning state。该状态是 BLE 设备在 LL (Link Layer) 的状态之一。

处于 scanning state 的 BLE 设备被称为 scanner。对应的,当 BLE 设备想让其他设备发现自己时会处在 advertising state。此时 BLE 设备被称为 advertiser。


藍牙基站的介紹與使用方法(
home assistant app beacon monitor


必須要在手機上開啟一個Owntracks APP
Owntracks APP的Enter事件反應很快
但是Leave事件大多要在5-10秒後才會反應

Enter/Leave的事件更新到MQTT server還必須要有網路

https://bbs.hassbian.com/thread-2330-1-1.html

One way is using the phones as BLE iBeacon transmitters

Home Assistant Companion App as scanner

I have the HA android app with the BLE sensors enabled.


But there are two different ways to accomplish this:

One way is using the phones as BLE iBeacon transmitters and ESPs as beacon trackers.

The other one would be to use ESPs as iBeacons and the phones as beacon monitors.
0
2 年 前
#14343 引用
蓝牙网关工作原理

蓝牙网关是一个集成蓝牙和Wi-Fi的网关设备,该设备主要用于
iBeacon设备
的远程云管理,简单来说就是一个用于iBeacon设备的扫描管理设备。



由于蓝牙网关是集成了蓝牙与Wi-Fi的网关设备,即蓝牙模块扫描设备并获取数据,Wi-Fi模块获取扫描数据再通过网将数据上传到服务器端,详细的说就是蓝牙模块扫描其信号覆盖范围内的iBeacon设备并且获取到被扫描的设备的数据,再通过蓝牙与Wi-Fi的串口将扫描到的设备通过网络把数据提交到服务器端,服务器端显示并管理这些扫描到的设备。



蓝牙网关主要用于扫描蓝牙设备、遵守iBeacon协议的Beacon设备


蓝牙网关


支持扫描周边的蓝牙设备的广播,
并作为iBeacon设备向周边广播
,默认UDP方式上报,上报周期为1秒1次,

首先,当蓝牙设备进入某个蓝牙网关的范围,和蓝牙网关的蓝牙部分进行连接,并传输当前数据;

然后,蓝牙网关的蓝牙部分接收到数据,和WiFi模块通过串口连接并传输数据;

其次,蓝牙网关WiFi部分通过无线路由器将数据上传到服务器,并对当前的情况进行控制修改;

最后,服务器经过计算和分析将蓝牙设备的定位信息在前端显示,控制指令也可通过服务器传给蓝牙网关的WiFi,WiFi传输给蓝牙,蓝牙传输给蓝牙设备实现控制。

蓝牙网关最常用的功能就是进行反向定位。

反向定位是利用蓝牙网关将扫描到的蓝牙数据通过网络上传到云端服务器上,并且利用了蓝牙扫描到的Beacon设备数据中的RSSI,然后在后台通过这个RSSI值能够确定iBeacon设备与蓝牙网关的距离或者范围,实现位置追踪的目的,并在后台地图实时展示Beacon设备位置。

同时,还可以将蓝牙网关的扫描范围标记为安全区域,一旦Beacon设备离开安全范围,便能触发后台的安全报警,实现位置追踪的目的(这也是实现安全看护和物资管理的关键)。

此种方式充分利用蓝牙终端设备功耗低、蓝牙并发量大的特性,在学校、养老院等机构实现人员定位,特别是在学校的人员定位应用最多。

此种方式为定位设备(胸牌、电子校徽等)以一定的周期(900ms)发送广播包,蓝牙网关接收数据并通过网线传送至后台服务器,后台服务器通过算法实现人员定位。


室内型蓝牙网关设备一般价格在350元/台上下,室外防水型蓝牙网关设备一般价格在500~800元/台。
用于人员追踪的定位标签设备一般在40~80元/个,用于物品追踪和自动盘点的定位标签设备一般在50元/个上下。

0
2 年 前
#14344 引用
用于室内定位的蓝牙网关(人员定位、资产定位)

首先在需要定位的区域内铺设蓝牙网关。蓝牙网关可通过POE网线供电实现联网,也可以使用路由器实现联网(这种方式要外加直流电源供电)。当蓝牙终端(移动的蓝牙设备:Beacon、定位手环、定位标签等)进入定位区域内,蓝牙网关里面的蓝牙模块收集蓝牙终端的蓝牙设备信息,包括Mac地址、RSSI等信息,通过UART串口发给蓝牙网关里面的WiFi模块,WiFi模块把信息传输到指定的UDP服务器,并能接收服务器返回的信息。UDP服务器接收到来自某个IP的蓝牙网关数据后,通过数据解析和计算,得到蓝牙信标的位置信息
0
2 年 前
#14347 引用
ESP32-mqtt-room


ESPresense 基于ESP32的室内定位系统

https://bbs.hassbian.com/thread-15410-1-1.html




ESPresense: Fork of ESP32-MQTT-room w/ fingerprinting, tile support, Kalman filter, based on C++/Platformio
ESP-32-BLE-Scanner for Home Assistant: ESP32 based BLE presence detection for Home Assistant with web GUI
room-assistant: looks for Bluetooth LE beacons, based on Node.js
Happy Bubbles Presence Server: presence detection server for Happy Bubbles BLE-scanning devices, based on Go
ESP32-MQTT-room: runs on an ESP32, and looks for Bluetooth LE devices, based on C++/Arduino
OpenMQTTGateway: uses ESP32 Bluetooth Low Energy to scan BLE Broadcaster like smart watches/bands and much more to get sensor values

https://www.home-assistant.io/integrations/mqtt_room/
0
2 年 前
#14351 引用
蓝牙Beacon的工作原理

https://developer.apple.com/ibeacon/

This iBeacon technology has been introduced by Apple in the year 2013. It is based on Bluetooth Low Energy. It is used to exchange small bursts of data within short distances.



An iBeacon advertisement provides the following information via Bluetooth Low Energy:
UUID  

Any app can use the Core Bluetooth APIs to send iBeacon advertisements .

ok


iBeacon Software — Core Location APIs

As shown in the figure, there are two system components namely broadcaster device and smartphone with applications. Let us understand how iBeacon technology works.

In this system, beacon device sends out data all the time. When the device is in advertisement mode, it sends out data with three parameters viz. UUID, a major and a minor value.

iBeacon Transmitter - iBeacon数据基站

come from:https://blog.csdn.net/u011341435/article/details/18948137

蓝牙Beacon子设备(广播部分)+ 在iPhone上安装应用Locate Beacon来测试。当手机进入到蓝牙Beacon子设备的广播范围时,该应用就会显示出手机距离树莓派的距离。


蓝牙Beacon 就是一个小型的信息基站。

室内蓝牙定位,需求凭借iBeacon设备。在一个iBeacon基站的协助下,智能手机的软件能大约找到它和这个iBeacon基站的相对方位。iBeacon技能经过低功耗蓝牙来完成。这也是为什么iBeacon设备靠纽扣电池就能运转很长期。

  现在的iBeacon使用首要包括两种,一种是进入iBeacon区域后,进行音讯推送;另一种是布置好基站,使用信号强度进行定位。这两种都与方位感知有关.iBeacon进行方位感知的根据是其信号强度RSSI(Received Signal Strength Indication),经过RSSI值的改变来判别用户间隔iBeacon设备的远近。如已知某间隔(1米)的RSSI,那么大于该值则间隔小于1米,小于该值则间隔大于1米。经过布置多个基站,则能够经过与两个或多个基站的相对间隔来找到用户的方位大致区域。



Beacons是使用蓝牙4.0(BLE)技术发射信号的小设备

有效范围从几十厘米到几米,电池可用3年

信号为单向发射,只能发送小数据量,例如一个128bit的ID

智能手机通常作为接收方



首先在需要定位的区域内铺设蓝牙Beacon信标,一般至少需要铺设3个蓝牙Beacon信标(因为定位算法要求至少知道三个点的RSSI值才能准确地计算定位);

第二,蓝牙Beacon信标会每隔一定的时间广播一个数据包到周围;

第三,当终端设备进入蓝牙Beacon的信号覆盖范围内,蓝牙主机在执行扫描动作时,会间隔地接收到蓝牙Beacon广播出来的数据包;

第四,在蓝牙主机接收到的广播包时,会显示该广播包来自于哪一个蓝牙Beacon从机的MAC地址和当前的接收发送信号强度指示值RSSI;

第五,RSSI值是确定蓝牙主机位置和蓝牙Beacon之间远近距离的依据;

最后,通过内置的定位算法,以及和地图引擎数据库的交互,就可以测算出蓝牙主机当前的具体位置。
0
2 年 前
#14352 引用
蓝牙Beacon设备 + 手机APP应用  定位



蓝牙Beacon最常用的功能就是室内定位,将Beacon节点布在适当的位置,再配合APP应用,可以很方便地应用在室内导航、人流分析、物品跟踪等所有与人在室内流动相关的活动之中。

Apple iBeacon 2013 6月发布

Google Eddystone 2015,7月发布





iBeacon基站自主定位

iBeacon的出现为蓝牙定位找到一种低成本的位置服务的可能。iBeacon具有无需联网、无需充电,一节电池可持续工作3-5年以上,而且成本相对可控。这为iBeacon的广泛部署提供了必要的条件。而且在定位的基础上,还同步获得了导航人员的轨迹信息,为商业选址提供可行的数据支撑。故在iBeacon定位领域主要应用在商场、车站、医院、博物馆等人员密集且流动人口较多的区域,在车站、医院、博物馆等的应用最为成熟。

此种方式为iBeacon基站不断发送广播,设备(主要是手机)接收到iBeacon设备发送的数据后,通过算法来计算自身的位置。而且在通过iBeacon基站定位时,同时也会采集WIFI的指纹信息,从而将WIFI与iBeacon基站定位相结合,实现更低成本,更高精度的定位管理

.iBeacon技术

iBeacon是苹果公司2013年9月发布的移动设备用OS(iOS7)上配备的新功能。其工作方式是,配备有 低功耗蓝牙(BLE)通信功能的设备使用BLE技术向周围发送自己特有的ID,接收到该ID的应用软件会根据该ID采取一些行动。

Ibeacon一项低耗能蓝牙技术,基本原理类似之前的蓝牙技术,由iBeacon发射信号,终端设备无接触自动定位接受,反馈信号。根据这项简单的定位技术可以做出许多的相应技术应用。

基于蓝牙+iBeacon定位技术下的室内定位方案,是针对人员分区管理与监控的需求,专门设计开发的一套软硬件结合的应用系统。其核心包括:无线传感设备(包含物联网基站、iBeacon无线信标、网络交换机等)、身份识别终端(如身份识别卡、电子手腕、异性电子标签等)和平台(包括定位引擎、应用平台、电子地图、数据库等)以及与智能看护有关的其他子系统,如智能床垫生命体征检测、卫生间跌倒报警、房间温湿度检测、房间人员活动检测、生命体征检测穿戴设备等。
0
2 年 前
#14353 引用
蓝牙 5.1

近年来,室内高精度位置服务需求呈现出爆发式增长的态势,自蓝牙 5.1 引入了新的“寻向”功能之后,蓝牙信号的方向可得到检测,大幅提高了蓝牙定位的精确度,也提供了更好的位置服务,为室内定位奠定了基础。
0
2 年 前
#14356 引用
Bluetooth Tracker

https://www.home-assistant.io/integrations/bluetooth_tracker/

Step 1:This platform requires pybluez to be installed. On Debian based installs, run

sudo apt install bluetooth libbluetooth-dev


libbluetooth-dev - 安装bluez的开发库


Step2:To use the Bluetooth tracker in your installation, add the following to your configuration.yaml file:

bluetooth_tracker  configuration.yaml

This is my tracker configuration:

device_tracker:
  - platform: bluetooth_tracker
    interval_seconds: 15
    consider_home: 180
    new_device_defaults:
      track_new_devices: true
    device_id: -1
  - platform: ping
    hosts:
      vladimir_ping: 192.168.0.120
    count: 2
    scan_interval: 30
    consider_home: 60
  - platform: ping
    hosts:
      danijela_ping: 192.168.0.125
    count: 2
    scan_interval: 30
    consider_home: 60
0