Skip to content

User guide bluetooth BLE

Florian edited this page Sep 16, 2018 · 24 revisions

Bluetooth Low Energy gateway

Level of complexity: Moderate

Subscribe first to all the topics with mosquitto:

sudo mosquitto_sub -t +/# -v

Receiving signals from BLE beacon devices for Presence detection

NOTE: HM-10 or HM-11 module needed if you are not using ESP32; configure in user_config.h

The BT gateway module for OpenMQTTGateway enables the detection of BLE beacons and their signal strength. Generally BLE devices will not broadcast if they are paired so you may need to ensure your beacons is unpaired before it will be seen by the gateway.

If beacons are detected the gateway will periodically publish messages to MQTT (beacons must not be paired, see above):

home/BTtoMQTT/445F3666113E -085

home/BTtoMQTT/7F04B36BA3F2 -085

home/BTtoMQTT/63F9FE29FBC2 -088

home/BTtoMQTT/CCCCCCCD1A4C -075

home/BTtoMQTT/445F3666113E -086

home/BTtoMQTT/7F04B36BA3F2 -086

home/BTtoMQTT/462C2834FFE1 -090

home/BTtoMQTT/63F9FE29FBC2 -085

The subtopic after home/BTtoMQTT/ is the MAC address of the Bluetooth low energy beacon. The message value is the RSSI signal level from which you may deduce the relative distance to the device.

Note that you can find apps to simulate beacons and do some tests like Beacon simulator

IOS version >=10 devices advertise without an extra app a mac address, nevertheless this address changes randomly and cannot be used for presence detection. You must install an app to advertise a fixed MAC adress.

Receiving signals Mi Flora/ Mi jia device

So as to receive Mi Flora/Mi jia data you need either a simple ESP32 either an ESP8266/arduino + HM10/11 with firmware >= v601 The mi flora supported firmware is >3.1.8

Verify that your mi flora is working with the App and update it with the last software version. You should see in your MQTT broker the following data:

Note that the gateway return one sensor each time. The different sensors that you will get are:

  • Lux
  • Temperature
  • Moisture
  • Fertilization
  • Battery (mi jia only)

The infos will appear like this on your MQTT broker:

home/BTtoMQTT/C47xxxxxxx2F/name Flower care

home/BTtoMQTT/C47xxxxxxx2F/fer 56

home/BTtoMQTT/C47xxxxxxx2F/tem 20.5

home/BTtoMQTT/C47xxxxxxx2F/lux 69

home/BTtoMQTT/C47xxxxxxx2F/hum 18

home/BTtoMQTT/C47xxxxxxx2F/batt 75

More info are available on my blog (especially about how it was implemented with HM10)

Other

If you want to change the time between readings change the value of TimeBtw_Read(ms) into config_BT.h

To check your hm10 firmware version upload a serial sketch to the nodemcu (this will enable communication directly with the hm10) and launch the command: AT+VERR?

More info about HM-10 is available here

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.