ble_mqtt_gateway

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
ble_mqtt_gateway [21.08.2018 20:41] – created Pascal Suterble_mqtt_gateway [08.01.2019 00:40] – [Flashing] Pascal Suter
Line 1: Line 1:
 ====== BLE MQTT Gateway ====== ====== BLE MQTT Gateway ======
-the idea here is to have an esp32 based gateway which detects BLE Beacons and reports them to an MQTT server for presence detection to open doors, turn on lighs etc. +the idea here is to have an esp32 based gateway which detects BLE Beacons and reports them to an MQTT server for presence detection to open doors, turn on lighs etc.
  
-so far this is a collection of research waiting to be finished into a working solution :+On the software side i decided to go with the [[https://github.com/1technophile/OpenMQTTGateway|OpenMQTTGateway]]
  
-[[https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md|install esp32 board support in arduino ide]]+After Reading some git hub issues and blog posts I decided to trop the esp32 and go for an [[https://github.com/1technophile/OpenMQTTGateway/wiki/ESP8266-BT-Module|esp8266 combined with an HM10 module]]. for the esp8266 i will be using a wemos d1 mini. the nice thing is, that the HM10 module, if purchased on an SZ-040 (or AT-09) board fits right underneath the esp8266. combine some of the sockets that come with the wemos d1 mini and bend some pins on the ZS-040 board and you won't have to use a single wire. 
  
-[[https://github.com/1technophile/OpenMQTTGateway/wiki/Module-Overview-ESP32|OpenMQTTGateway]]+here is how it connects
  
 +^ pin on ZS-040 ^ pin on D1 mini ^
 +| RX | D6 |
 +| TX | D7 |
 +| VCC | 5V |
 +| GND | G | 
 +
 +===== Flashing =====
 +with the hardware in place let's get the software side done: first I [[setup_arduino_ide_for_esp8266]]. Now download [[https://github.com/1technophile/OpenMQTTGateway/releases|the latest release of OpenMQTTGateway]] and extract it. Rename the folder to ''OpenMQTTGateway'' (remove the version) so that you can open it in the arduino IDE. 
 +
 +open the ''OpenMQTTGateway.ino'' file in your prepared arduino gateway and go through the ''User_config.h'' settings for your wifi, passwords and mqtt settings. In the module selecton comment out all the modules and remove the comment from the ''ZgatewayBT'' module. Next go through the settings in ''config_BT.h''
 +
 +now Copy the contents of ''OpenMQTTGateway/lib'' to ''<sketchbook folder>/libraries'' in your arduino ide folder
 +
 +**NOTE** make sure you have ''SPIFF'' enabled in the board settings of the arduino IDE. it seems OMG wants to use that to save config changes
 +
 +the web-interface to configure the wifi and mqtt settings seems to only be available in access point mode.
  • ble_mqtt_gateway.txt
  • Last modified: 09.01.2019 07:31
  • by Pascal Suter