Git Product home page Git Product logo

esp32-ble2mqtt's People

Contributors

almirus avatar dakhnod avatar duranda avatar gvdhoven avatar issmirnov avatar kipk avatar ndoo avatar ozonejunkieau avatar robertcsakany avatar shmuelzon avatar valpackett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-ble2mqtt's Issues

How to disconnect from BLE devices?

Hi
It seems esp32 will try to connect BLE devices in the config.json once esp32 startup. It there any way to disconnect from BLE devices after "Get" data from BLE devices. Next time when I need to fetch data connects first. That for better energy saving.

Thank,
Natic

Is it possible compile by Mongoose-OS?

Hi,

First of all, congratulations for Ble2Mqtt bridge. Its really nice!

As I have others IoT firmwares using Mongoose-OS connected directly to AWS IoT Mqtt, I would like to know if is possible I compile your esp32-ble2mqtt firmware by Mongoose-OS and connect it to AWS IoT mqtt server?

Thanks a lot!
Jose Lima

Wiki pages for devices?

Hi,

is it maybe possible to create a few wiki pages for specific devices. I notice that others are also trying to get the Eurotronics Comet Blue device up & running.

wifi": {
    "ssid": "xxxxxx",
    "password": "xxxxxx"
  },
  "mqtt": {
    "server": {
      "host": "192.168.11.90",
      "port": 1883,
      "username": "homeassistant",
      "password": "xxxxxx",
      "client_id": "ble2mqtt"
    },
    "publish": {
      "retain": true,
      "qos" : 0
    },
    "topics" :{
      "prefix": "ble/",
      "device_name": "Address",
      "get_suffix": "/Get",
      "set_suffix": "/Set"
    }
  },
  "ble": {
    "whitelist": ["28:6c:16:96:xx:xx"],
    "services": {
        "definitions": {
            "47e9ee00-47e9-11e4-8939-164230d1df67": {
                "name": "ThermostatService"
            }
        }
    },
    "characteristics" : {
        "blacklist": ["00002a05-0000-1000-8000-00805f9b34fb"],
        "definitions": {
           "47e9ee01-47e9-11e4-8939-164230d1df67": {
                "name": "Time",
                "types": [ "uint8","uint8","uint8","uint8","uint8"]
           },
           "47e9ee10-47e9-11e4-8939-164230d1df67": {
                "name": "SwitchpointMonday"
           },
           "47e9ee11-47e9-11e4-8939-164230d1df67": {
                "name": "SwitchpointTuesday"
           },
           "47e9ee12-47e9-11e4-8939-164230d1df67": {
                "name": "SwitchpointWednesday"
           },
           "47e9ee13-47e9-11e4-8939-164230d1df67": {
                "name": "SwitchpointThursday"
           },
          },
           "47e9ee13-47e9-11e4-8939-164230d1df67": {
                "name": "SwitchpointThursday"
           },
           "47e9ee14-47e9-11e4-8939-164230d1df67": {
                "name": "SwitchpointFriday"
           },
           "47e9ee15-47e9-11e4-8939-164230d1df67": {
                "name": "15"
           },
           "47e9ee16-47e9-11e4-8939-164230d1df67": {
                "name": "16"
           },
           "47e9ee17-47e9-11e4-8939-164230d1df67": {
                "name": "17"
           },
           "47e9ee18-47e9-11e4-8939-164230d1df67": {
                "name": "18"
           },
           "47e9ee19-47e9-11e4-8939-164230d1df67": {
                "name": "19"
           },
           "47e9ee1a-47e9-11e4-8939-164230d1df67": {
                "name": "1a"
           },
           "47e9ee1b-47e9-11e4-8939-164230d1df67": {
                "name": "1b"
           },
           "47e9ee1c-47e9-11e4-8939-164230d1df67": {
                "name": "1c"
           },
           "47e9ee1da-47e9-11e4-8939-164230d1df67": {
                "name": "1d"
           },
           "47e9ee1e-47e9-11e4-8939-164230d1df67": {
                "name": "1e"
           },
           "47e9ee1f-47e9-11e4-8939-164230d1df67": {
                "name": "1f"
           },
           "47e9ee20-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday1"
           },
           "47e9ee21-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday2"
           },
           "47e9ee22-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday3"
           },
           "47e9ee23-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday4"
           },
           "47e9ee24-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday5"
           },
           "47e9ee25-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday6"
           },
           "47e9ee26-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday7"
           },
           "47e9ee27-47e9-11e4-8939-164230d1df67": {
                "name": "Holiday8"
           },
           "47e9ee2a-47e9-11e4-8939-164230d1df67": {
                "name": "Flags",
                "types": ["uint24"]
           },
           "47e9ee2b-47e9-11e4-8939-164230d1df67": {
                "name": "Temperature",
                "types": [ "uint8" ,"uint8","uint8","uint8","uint8","uint8","uint8"]
           },
           "47e9ee2c-47e9-11e4-8939-164230d1df67": {
                "name": "Battery",
                "types": [ "uint8"]
           },
           "47e9ee2d-47e9-11e4-8939-164230d1df67": {
                "name": "2d"
           },
           "47e9ee2e-47e9-11e4-8939-164230d1df67": {
                "name": "LcdTimer"
           },
           "47e9ee30-47e9-11e4-8939-164230d1df67": {
                "name": "Pin",
                "types": [ "uint8","uint8","uint8","uint8" ]
           },
           "47e9ee40-47e9-11e4-8939-164230d1df67": {
                "name": "FirmwareVersion"
           }
        }
    }
  },
  "log": {
    "host": "192.168.11.3",
    "port": 5000
  }
}

In Home Assistant i can transmit the Pin-code (1234) as:
ble/28:6c:16:96:xx:xx/ThermostatService/Pin/Set with the value: 1,2,3,4

build error in log.c

I get a compile error. Not sure if I'm doing something wrong?

Downloaded org.bluetooth.characteristic.plx_spot_check_measurement
Generating source code
CC build/main/ble_utils.o
CC build/main/log.o
D:/mcdev/msys32/home/esp/esp32-ble2mqtt/main/log.c: In function 'log_start':
D:/mcdev/msys32/home/esp/esp32-ble2mqtt/main/log.c:43:5: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
memset(&dst, 0, sizeof(dst));
^
D:/mcdev/msys32/home/esp/esp32-ble2mqtt/main/log.c:43:5: warning: incompatible implicit declaration of built-in function 'memset'
D:/mcdev/msys32/home/esp/esp32-ble2mqtt/main/log.c:43:5: note: include '<string.h>' or provide a declaration of 'memset'
cc1.exe: some warnings being treated as errors
make[1]: *** [/home/esp/esp-idf/make/component_wrapper.mk:292: log.o] Fehler 1

Feature Request: Passive Scanning

I have a limited understanding of BLE so apologies in advance, but as I understand it esp32-ble2mqtt is actively connecting to BLE devices.

Would it be possible to make it so it passively "sniffs" beacons and reports them to MQTT, without ever connecting to the device itself?

Thanks

Unable to communicate with Comet Blue device

Hi,

I've put many hours of effort into creating a bridge between my Bluetooth radiator thermostat (Comet Blue) and Home Assistant. I think your project is quite mature and expected that i would get it to work.

I do see some attributes being published (for instance DeviceName), but only when i'd whitelisted the device. If i remove the "whitelist" attribute, i don't any attributes being published anymore. This is not what i'd expected. I do see other devices like IMac's being recognized.

Another issue is that i'm unable to retrieve any other attributes by publishing any value to the topic.

Any hint for me?

This is my current configuration which i build using ESP IDF v3.3:

{
  "wifi": {
    "ssid": "mywifi",
    "password": "mypassword"
  },
  "mqtt": {
    "server": {
      "host": "192.168.11.90",
      "port": 1883,
      "username": "homeassistant",
      "password": "anotherpassword",
      "client_id": "ble2mqtt"
    },
    "publish": {
      "retain": true
    },
    "topics" :{
      "device_name": "Address",
      "prefix": "ble/",
      "get_suffix": "/Get",
      "set_suffix": "/Set"
    }
  },
  "ble": {
    "whitelist": ["28:6c:17:96:5e:0a"],
    "services": { 
        "definitions": {
            "47e9ee00-47e9-11e4-8939-164230d1df67": {
                "name": "cb"
            }
        }   
    },
    "characteristics" : {
        "47e9ee2c-47e9-11e4-8939-164230d1df67": {
           "name": "bat",
           "poll": 60,
           "types": [
               "uint8"
           ]
        }
    }
  },
  "passkeys": {
     "28:6c:17:96:5e:0a": 0
  },
  "log": {
    "host": "192.168.11.3",
    "port": 5000
  }
}

If i subscribe to MQTT, i see the following data:

ble/28:6c:17:96:5e:0a/Connected true
ble/28:6c:17:96:5e:0a/Owner BLE2MQTT-A678
ble/28:6c:17:96:5e:0a/GenericAccess/DeviceName Comet Blue
ble/28:6c:17:96:5e:0a/GenericAccess/Appearance 0
ble/28:6c:17:96:5e:0a/GenericAccess/PeripheralPrivacyFlag false
ble/28:6c:17:96:5e:0a/GenericAccess/PeripheralPreferredConnectionParameters 80,160,0,300
ble/28:6c:17:96:5e:0a/GenericAttribute/ServiceChanged 1,65535

But i don't see the ManfacturerNameString attribute for instance.

Feature request: Web interface

Hi!
I've just played around with this project and I think it's awesome. Currently in the middle of setting it up in my home automation system (replacing the need for BLE support in my main HA controller).

During this process I discovered one thing - it's a bit annoying editing the config on the computer, uploading it to the device and then hoping that everything is set up correctly. It would be awesome if this would include a configuration web interface (like a very popular sonoff-tasmota project for instance).

It would be nice if we could see all of the discovered BLE devices in the web interface, then add them to a whitelist/blacklist and configure which of devices services/characteristics we would like published via MQTT, ... It doesn't have to be anything fancy or anything. The first version could just dump the current config and enable us to edit it on the fly and press save.

I know it's a lot to ask, but that would be one feature that would make this a lot easier to use.

Restart loop after flashing

Hey everyone,

How to reproduce

  • I've cloned the repo with its submodules
  • Configured serial flasher port via make menuconfig
  • Edited config.json for just wifi credentials and mqtt.host

After first make flash, I've faced is there was no mkspiffs executable in it's folder.

make: /Users/emir.ayar.empa/esp/esp32-ble2mqtt/mkspiffs/mkspiffs: No such file or directory
make: *** [/Users/emir.ayar.empa/esp/esp32-ble2mqtt/build/spiffs.bin] Error 1

Then, I couldn't figure out to build it. The instruction on the README of its repo (https://github.com/igrr/mkspiffs) says;

$ git submodule update --init
$ make dist

But it didn't worked. I've gcc-4.9 and everything seems okay but It gave something ends with this;

      ...
  "_strncpy", referenced from:
      _spiffs_stat_pix in spiffs_hydrogen.o
      _spiffs_object_create in spiffs_nucleus.o
      _spiffs_object_update_index_hdr in spiffs_nucleus.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mkspiffs] Error 1

So, I downloaded the latest release from its Releases; mkspiffs-0.2.3-esp-idf-osx.tar.gz and copied it to mkspiffs folder. I was feeling ready to make flash the project.

Problem

The project is flashed successfully.

Emirs-MacBook-Pro:esp32-ble2mqtt emir.ayar.empa$ make flash
Flashing binaries to serial port /dev/cu.SLAB_USBtoUART (app at offset 0x10000 )...
esptool.py v2.5.0
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
MAC: 30:ae:a4:15:29:dc
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 20928 bytes to 12379...
Wrote 20928 bytes (12379 compressed) at 0x00001000 in 1.1 seconds (effective 153.1 kbit/s)...
Hash of data verified.
Compressed 1185488 bytes to 723300...
Wrote 1185488 bytes (723300 compressed) at 0x00010000 in 63.8 seconds (effective 148.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.0 seconds (effective 1310.6 kbit/s)...
Hash of data verified.
Compressed 524288 bytes to 1203...
Wrote 524288 bytes (1203 compressed) at 0x00310000 in 0.1 seconds (effective 37784.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

But it have been failed into a reset loop. Here is the some of logs of make monitor�

I (0) cpu_start: Starting scheduler on APP CPU.
I (405) BLE2MQTT: Version: v0.6.0-7-g532242a
I (405) Config: Initializing configuration
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x400d46f7
0x400d46f7: app_main at /Users/emir.ayar.empa/esp/esp32-ble2mqtt/main/ble2mqtt.c:402 (discriminator 1)

file: "/Users/emir.ayar.empa/esp/esp32-ble2mqtt/main/ble2mqtt.c" line 402
func: app_main
expression: config_initialize()

Backtrace: 0x40093830:0x3ffd9350 0x40093ce0:0x3ffd9370 0x400d46f7:0x3ffd9390 0x400d24da:0x3ffd93b0
0x40093830: invoke_abort at /Users/emir.ayar.empa/esp/esp-idf/components/esp32/panic.c:649

0x40093ce0: _esp_error_check_failed at /Users/emir.ayar.empa/esp/esp-idf/components/esp32/panic.c:665

0x400d46f7: app_main at /Users/emir.ayar.empa/esp/esp32-ble2mqtt/main/ble2mqtt.c:402 (discriminator 1)

0x400d24da: main_task at /Users/emir.ayar.empa/esp/esp-idf/components/esp32/cpu_start.c:470


Rebooting...
ets Jun  8 2016 00:22:57

Do you have any ideas?

mDNS (Bonjour) resolve support

By default all domain resolve (for example mqtt host) made by gethostbyname() . Which is using the given DNS servers only for resolve. But what if the MQTT / NTP servers doesn't registered in local DNS servers or there is no local DNS at all? On that case it is possible the services advertising themselves via multicast.
Lot of arduino based firmwares tasmota/espurna supports that and workes well, in my network every IOT device and services are resolved with mDNS. I think with a host_resolver.c module can help to extend that functionality. I know only mqtt service are bundled now, but for possible future implementation of remote log, ntp etc. can use that too. What do you think?

Handling advertising using manufacturer specific data

Hi,

Great piece of code so far, thanks for that project.

I was wondering if we could consider adding a generic way to handle manufacturer specific data ( 0xFF ) embedded in advertising frames. Those are broadcastes too.

https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2017/11/14/bluetooth_advertisin-zCHh

The idea would be to have it configurable with something like this:
example packet:

[02 01 06 02 0A 00]  [08]     [FF]         [0D 00] [ 01 CD 00 34 32 ]
                     length  manuf data     company id      Data

"ble": {	
	"broadcaster_manufacturer_data": [
            {
            "name": "MySwitch_Temp_Sensor", //broadcasted name
            "whitelist": ["10:CE:A9:E3:A4:E6"],     // whitelist/blacklist array
             "data": [                                           // variables positions in the data field
                             { "name": "actuator", 
                               "from" : 0, //starting byte
                               "to":  1,      //ending byte
                               "type": "bool",
                               "endian": "little"
                              },
                             { "name": "temperature", 
                               "from" : 2, //starting byte
                               "to":  5,      //ending byte
                               "type": "hex",
                               "endian": "little"
                              },
                             { "name": "humidity",
                               "from" : 6,
                                "to": 9,
                                "type": "ascii",
                                "endian": "big"
                              }
                        ]
                  }
              ]
           }

In the example we receive this data 0x01CD003432 in the manufacturer specific data field, would mean:
. actuator is On ( 01 )
. temperature = 20.5 ( 00 CD ) // Hex
. humidity = 42% ( 34 32 ) // in ASCII
type could be bool, int, hex, ascii
Best

TLS support

How feasible would it be to add TLS support for the connection to the MQTT server?

I see that ESP-IDF has example code for it but I don't know if it's just a case of copying the code over and adding some configuration entries for it, or if it's more involved than that.

Is it likely to grow the image size and RAM footprint beyond what an ESP32 can cope with?

Error with the config_initialize()

Hello and thank you for this nice work!
I've used the esp-idf to flash the code into the esp32, i'm facing this error at the monitor once I open the Esp32 Terminal.

�[0;32mI (544) Config: Initializing configuration�[0m
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x400d48c9
file: "C:/Users/Nathan/msys32/home/Nathan/esp/esp32-ble2mqtt/main/ble2mqtt.c" line 376
func: app_main
expression: config_initialize()

Backtrace: 0x400935cc:0x3ffbb3d0 0x400939f8:0x3ffbb3f0 0x400d48c9:0x3ffbb410 0x400d27ce:0x3ffbb430

Rebooting...

ok, I presume this error msg has something to do with the config file inside of the data folder, I've found a error on my previous config.json file, therefore I let that file just like the one on this git.
The other question I have is, I belive even after the alteration of the config.json file, the esp-idf does not rebuild the code! you know any command to rebuild the code?

Ty very much!

Stability issues

I am testing this gateway using a Thingy:52. It contains a bunch of sensors and data is sent using notifications.

The gateway acts as expected after connection to the device and works for a few seconds, and then stops publishing MQTT messages.

I connected the ESP32 to serial to inspect its output. Before stopping sending MQTT messages, it output a few esp_mqtt: lwmqtt_publish: -1, which corresponds to a buffer too short to the best of my knowledge.

After a few esp_mqtt: lwmqtt_publish: -1 errors, the log look like this:

E (234658) esp_mqtt: lwmqtt_publish: -1
E (235938) BT: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0008
I (235948) BLE: Connection closed, reason = 0x8
I (235948) BLE2MQTT: Disconnected from device: d9:60:eb:5f:df:e3
E (248718) BT: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=259 reason=0x0100
E (248718) BT: p_conn is NULL in bta_gattc_conn_cback

E (248728) BLE: Open failed, status = 0x85
I (248748) BLE2MQTT: Discovered BLE device: d9:60:eb:5f:df:e5, connecting
E (278758) BT: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0100

The Thingy:52 sends a lot of notifications–a few dozens per second. Could it be related to a buffer overflow because the ESP32 can't send MQTT messages as fast as it receives notifications?

Crash while connecting to miscale

Hi,

I'm getting this from my MI_SCALE. Any idea?
Thank you.

I (12533) BLE2MQTT: Discovered BLE device: c8:0f:10:c7:6f:e1, connecting
I (18433) BLE2MQTT: Connected to device: c8:0f:10:c7:6f:e1, scanning
I (19003) BLE2MQTT: Publishing: c8:0f:10:c7:6f:e1/GenericAccess/DeviceName = MI_SCALE
I (19063) BLE2MQTT: Publishing: c8:0f:10:c7:6f:e1/GenericAccess/Appearance = 3200
I (19093) BLE2MQTT: Publishing: c8:0f:10:c7:6f:e1/GenericAccess/PeripheralPrivacyFlag = false
I (19183) BLE2MQTT: Publishing: c8:0f:10:c7:6f:e1/GenericAccess/PeripheralPreferredConnectionParameters = 100,200,0,2000
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x400d66ca  PS      : 0x00060430  A0      : 0x800d4f05  A1      : 0x3ffe9ad0
0x400d66ca: chartoa at E:/projectx/site/iot/esp32-ble2mqtt/main/ble_utils.c:765

A2      : 0x00000000  A3      : 0x3ffcc4e8  A4      : 0x400d66c7  A5      : 0x00000000
0x400d66c7: chartoa at E:/projectx/site/iot/esp32-ble2mqtt/main/ble_utils.c:765

A6      : 0x3ffc0e28  A7      : 0x00000000  A8      : 0x800d64fc  A9      : 0x3ffe9ab0
A10     : 0x3ffc0e28  A11     : 0x00000018  A12     : 0x00000000  A13     : 0x00000000
A14     : 0x3ffcc910  A15     : 0x3f406040  SAR     : 0x0000000c  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000005  LBEG    : 0x400012e5  LEND    : 0x40001309  LCOUNT  : 0x8017ea37

Backtrace: 0x400d66ca:0x3ffe9ad0 0x400d4f02:0x3ffe9b00 0x400d4fd9:0x3ffe9b30 0x400d5009:0x3ffe9b50 0x40093d55:0x3ffe9b80
0x400d66ca: chartoa at E:/projectx/site/iot/esp32-ble2mqtt/main/ble_utils.c:765

0x400d4f02: ble_on_device_characteristic_value at E:/projectx/site/iot/esp32-ble2mqtt/main/ble2mqtt.c:420

0x400d4fd9: ble2mqtt_handle_event at E:/projectx/site/iot/esp32-ble2mqtt/main/ble2mqtt.c:537

0x400d5009: ble2mqtt_task at E:/projectx/site/iot/esp32-ble2mqtt/main/ble2mqtt.c:559

0x40093d55: vPortTaskWrapper at E:/portable/esp32/esp-idf/components/freertos/port.c:403


Rebooting...

Unable to compile

C:/msys32/home/User/esp/esp32-ble2mqtt/build/spiffs\libspiffs.a(spiffs_api.o):(.data.TAG+0x0): multiple definition of `TAG'
C:/msys32/home/User/esp/esp32-ble2mqtt/build/main\libmain.a(beacons.o):(.data.TAG+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [C:\msys32\home\User\esp\esp-idf/make/project.mk:407: /home/User/esp/esp32-ble2mqtt/build/ble2mqtt.elf] Ошибка 1

ESP-IDF ver 3.2-dev

What i do wrong?

ESP32 wifi power save

The ESP32 apparently suffers from some WiFi power save bug, the issue is described here

This seems to impacts UDP logging and MQTT data for me, as RTT is bad and I think I also have packet loss because of this.

Do you think the fix discussed there (Esp_wifi_set_ps (WIFI_PS_NONE);) could help? Might be nice to be able to enable and disable this via config, to also have the option to keep it on if power consumption is an issue.

PS just noticed @jamesfcurran in #26 also mentions WiFi issues. Could be related.

Whitelisting mac address doesn't seem to have an effect

I'm only interested in receiving broadcasts from one single mac address, so I changed config.json to reflect this:

	"ble": {
		"whitelist": [
			"c5:11:8c:ba:55:ef"],
...

But when using serial monitor I still see a lot more action going on where BLE2MQTT is trying to connect all sorts of BLE devices after scanning. Is it possible to only listen for broadcasts, to save on power usage?

Force passkey auth?

Is there a way to force the use of the passkey?
Looks like my device do not requests passkey-auth but shows only basic services/characteristics then.
(at least I think so - I'm not a ble expert)

I've added service and characteristics definitions to config and gatt.c but they are not discovered.

My config:

{
  "wifi": {
    "ssid": "xxx",
    "password": "xxx"
  },
  "mqtt": {
    "server": {
      "host": "192.168.x.x",
      "port": 1883,
      "username": "user",
      "password": "xxx",
      "client_id": "xxx"
    },
    "publish": {
      "retain": true
    },
    "topics": {
      "prefix": "xxx/",
      "get_suffix": "/get",
      "set_suffix": "/set"
    },
    "ble": {
      "passkeys": {
        "16:0e:72:xx:xx:xx": xxxxxx,
        "0D:7e:32:xx:xx:xx": xxxxxx
      },
      "whitelist": [
        "16:0e:72:xx:xx:xx",
        "0D:7e:32:xx:xx:xx"
      ],
      "services": {
        "definitions": {
          "47e9ee00-47e9-11e4-8939-164230d1df67": {
            "name": "ThermostatService"
          }
        },        
        "whitelist": [
          "47e9ee00-47e9-11e4-8939-164230d1df67"
        ]
      },
      "characteristics": {
        "definitions": {
          "47e9ee2b-47e9-11e4-8939-164230d1df67": {
            "name": "Temperature",
            "types": [
              "CHAR_TYPE_UINT8","CHAR_TYPE_UINT8","CHAR_TYPE_UINT8","CHAR_TYPE_UINT8","CHAR_TYPE_UINT8","CHAR_TYPE_UINT8","CHAR_TYPE_UINT8"
            ]
          }
        },
        "whitelist": [
          "47e9ee2b-47e9-11e4-8939-164230d1df67"
        ]
      }
    }
  }  
}

MAC Whitelist / Blacklist / Passkey wildcard support

I have a lot of devices and the whitelist / blacklist function administration by address can cause lot of pain. It can be easier if I can specify that per manufacturer. For example:

"whitelist": [ "aa:bb:cc:*:*:*" ]

Roadmap and Latest IDF and WiFi issues

Hi Assaf,
Not sure if this is the best way to contact you but here goes..

Was wondering if you have a roadmap for this project as it seems to fill a valuable niche.

Also, I am having significant troubles even with recent IDF releases with WiFi dropping out every few minutes. Seems like people attribute this to the shared WiFi/Bluetooth hardware. Not sure if you have seen this or have advice.

Thanks,
Jim

BLE characteristic can only be set once

Hi @shmuelzon!

I noticed that setting a characteristic more than once triggers the following error (first time always work):
Failed writing characteristic, status = 0x3

esp32-ble2mqtt/main/ble.c

Lines 744 to 750 in ea67a23

case ESP_GATTC_WRITE_CHAR_EVT:
need_dequeue = 1;
if (param->write.status != ESP_GATT_OK)
{
ESP_LOGE(TAG, "Failed writing characteristic, status = 0x%x",
param->write.status);
}

It seems that 0x03 is ESP_GATT_WRITE_NOT_PERMIT.

This error is not a false positive since my device doesn't update its characteristic value.

Do you have any idea about what can cause this issue?

433Mhz Radio and other custom developed module support?

I'm planning that using these chips also for receiving / transmitting radio codes over MQTT. Maybe I will use that as a module in other project - but on that case some refactor needed to able to use as an external module in other projects. Is there any recommended practice how to do that?

Remote logging does not appear to be working

Hi, I am trying to troubleshoot some issues with a BLE device losing connection. To do so I'd like to enable logging. I've tried various host and port combinations and ran packet captures on both the target and the router, and I can't see this log traffic.

I've done a make clean / make flash etc - any ideas?

Redacted config below:

{
  "wifi": {
    "ssid": "ssid",
    "password": "password"
  },
  "mqtt": {
    "server": {
      "host": "host",
      "port": 1883,
      "username": "esp32-ble2mqtt",
      "password": "password"
    },
    "publish": {
      "retain": true
    },
    "topics" :{
      "prefix": "ble2mqtt/",
      "get_suffix": "/get",
      "set_suffix": "/set"
    }
  },
  "log": {
    "host": "224.0.0.200",
    "port": 5000
  }
}

Unable to compile

I am very interested in your code, but am a novice in C (I am a .NET developer). When I run make, it appears to compile fine until ble_utils.o

In function 'ble_atotype':

/home/ubuntu/projects/esp32-ble2mqtt/main/./ble_utils.c:178:22: error: 'CHAR_TYPE_BOOLEAN' undeclared (first use in this function)
{ "boolean", CHAR_TYPE_BOOLEAN },

There is a similar error for each item in the struct.

Compilation error - BLE downloaded definitions extended type

CC /private/tmp/esp32-ble2mqtt/build/main/ble_utils.o
/private/tmp/esp32-ble2mqtt/main/ble_utils.c: In function 'chartoa':
/private/tmp/esp32-ble2mqtt/main/ble_utils.c:249:9: error: enumeration value 'CHAR_TYPE_UINT128' not handled in switch [-Werror=switch]
         switch (*types)
         ^
/private/tmp/esp32-ble2mqtt/main/ble_utils.c: In function 'atochar':
/private/tmp/esp32-ble2mqtt/main/ble_utils.c:430:9: error: enumeration value 'CHAR_TYPE_UINT128' not handled in switch [-Werror=switch]
         switch (*types)
         ^

make: xtensa-esp32-elfgcc: Command not found

This isnt probably the problem with this library but I didn't find any other place.
So it says xtensa-esp32-elfgcc not found but the file in ztensa-esp32-elf is xtensa-esp32-elf-gcc not xtensa-esp32-elfgcc.

All examples run fine.

taavi@taavi-ThinkPad-T430:~/projects/oss/esp32-ble2mqtt$ make
make: xtensa-esp32-elfgcc: Command not found
expr: syntax error
/bin/sh: 1: xtensa-esp32-elfgcc: not found
/bin/sh: 1: xtensa-esp32-elfgcc: not found
Toolchain path:
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
make[1]: xtensa-esp32-elfgcc: Command not found
expr: syntax error
/bin/sh: 1: xtensa-esp32-elfgcc: not found
/bin/sh: 1: xtensa-esp32-elfgcc: not found
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
CC build/bootloader/bootloader_support/src/bootloader_flash.o
make[2]: xtensa-esp32-elfgcc: Command not found
/media/taavi/Apps/applications/esp/esp-idf/make/component_wrapper.mk:291: recipe for target 'src/bootloader_flash.o' failed
make[2]: *** [src/bootloader_flash.o] Error 127
/media/taavi/Apps/applications/esp/esp-idf/make/project.mk:527: recipe for target 'component-bootloader_support-build' failed
make[1]: *** [component-bootloader_support-build] Error 2
/media/taavi/Apps/applications/esp/esp-idf/components/bootloader/Makefile.projbuild:41: recipe for target '/home/taavi/projects/oss/esp32-ble2mqtt/build/bootloader/bootloader.bin' failed
make: *** [/home/taavi/projects/oss/esp32-ble2mqtt/build/bootloader/bootloader.bin] Error 2

Pincode/passcode

In the readme i see the following:

"passkeys": {
  "aa:bb:cc:dd:ee:ff": 000000,
  "00:11:22:??:??:??": 123456
}

If i place this in the data/config.json file i get a json validation error.
Adding quotes seems to resolve the issue.

"passkeys": {
  "aa:bb:cc:dd:ee:ff": "000000",
  "00:11:22:??:??:??": "123456"
}

Compiler errors with newer version of ESP-IDF

Hello and many thanks for this quality project
With the slight older ESP-IDF from Espressif everything work fine, but i'm having compiler Errors with the newer version when try to build a new clone of the project
Ich have already tried things like fresh installation of IDF or fresh clone of project and confirmed the same problems on multiple devices.

Thanks for your hardwork!

CC build/lwip/port/esp32/debug/lwip_debug.o AR build/lwip/liblwip.a CC build/main/broadcasters.o In file included from C:/msys32/home/esp/esp32-ble2mqtt/main/broadcasters.c:8:0: C:/msys32/home/esp/esp32-ble2mqtt/main/broadcasters.c: In function 'ibeacon_is_b roadcaster': C:/msys32/home/esp/esp-idf/components/wpa_supplicant/port/include/endian.h:78:20 : error: implicit declaration of function '__bswap16' [-Werror=implicit-function -declaration] #define bswap16(x) __bswap16(x) ^ C:/msys32/home/esp/esp-idf/components/wpa_supplicant/port/include/endian.h:116:2 0: note: in expansion of macro 'bswap16' #define le16toh(x) bswap16((x)) ^ C:/msys32/home/esp/esp32-ble2mqtt/main/broadcasters.c:85:12: note: in expansion of macro 'le16toh' return le16toh(beacon->company_id) == 0x004C /* Apple */ && ^ C:/msys32/home/esp/esp32-ble2mqtt/main/broadcasters.c: At top level: cc1.exe: warning: unrecognized command line option '-Wno-frame-address' cc1.exe: some warnings being treated as errors make[1]: *** [/home/esp/esp-idf/make/component_wrapper.mk:290: broadcasters.o] F ehler 1 make: *** [C:/msys32/home/esp/esp-idf/make/project.mk:582: component-main-build] Fehler 2

Reconnect upon disconnection

Hi again @shmuelzon and sorry for spamming issues!

Is there a simple way to reconnect BLE devices if they get disconnected? It typically happens after a few hours with my devices and I have to reset the ESP32 in order for it to reconnect.

Note that I did not investigate on this at all yet. Maybe you already give some thoughts about it?

Build failing with syntax error

line 794 in main/ble.c is missing a semi-colon
ESP_ERROR_CHECK(esp_ble_gattc_register_callback(esp_gattc_cb))
should be
ESP_ERROR_CHECK(esp_ble_gattc_register_callback(esp_gattc_cb));

CmakeLists.txt is missing

Hi,

When I tried to idf.py menuconfig, it reported error that CmakeLists.txt is missing. Am I supposed to create one? If so, what are supposed to be inside the file? and where to put it. I saw some sample project coding, CmakeLists.txt appears in two places, one in the "main" folder, and the other one outside the "main" folder.

After I created (by imitating coding from some sample project and not sure it was correct. In the CmakeLists.txt, I use ble2mqtt.c as main source, correct?), I can enter into the config, then issue command "idf.py build". It was compiling a lot before displaying errors about missing "ble2mqtt_ver". I don't know how to proceed.

Thanks in advance for your help.

Can't run firmware..

  1. Install new ESP-IDF 3.1.2
  2. git clone --recursive https://github.com/shmuelzon/esp32-ble2mqtt
  3. make flash
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5828
load:0x40078000,len:9176
load:0x40080000,len:6008
entry 0x4008032c
�[0;32mI (28) boot: ESP-IDF v3.1.2 2nd stage bootloader�[0m
�[0;32mI (29) boot: compile time 21:14:11�[0m
�[0;32mI (29) boot: Enabling RNG early entropy source...�[0m
�[0;32mI (33) boot: SPI Speed      : 40MHz�[0m
�[0;32mI (37) boot: SPI Mode       : DIO�[0m
�[0;32mI (41) boot: SPI Flash Size : 4MB�[0m
�[0;32mI (45) boot: Partition Table:�[0m
�[0;32mI (49) boot: ## Label            Usage          Type ST Offset   Length�[0m
�[0;32mI (56) boot:  0 nvs              WiFi data        01 02 00009000 00004000�[0m
�[0;32mI (64) boot:  1 otadata          OTA data         01 00 0000d000 00002000�[0m
�[0;32mI (71) boot:  2 phy_init         RF data          01 01 0000f000 00001000�[0m
�[0;32mI (79) boot:  3 ota_0            OTA app          00 10 00010000 00180000�[0m
�[0;32mI (86) boot:  4 ota_1            OTA app          00 11 00190000 00180000�[0m
�[0;32mI (93) boot:  5 storage          Unknown data     01 82 00310000 00080000�[0m
�[0;32mI (101) boot: End of partition table�[0m
�[0;32mI (105) boot: No factory image, trying OTA 0�[0m
�[0;32mI (110) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x2fe10 (196112) map�[0m
�[0;32mI (188) esp_image: segment 1: paddr=0x0003fe38 vaddr=0x3ffc0000 size=0x001d8 (   472) load�[0m
�[0;32mI (188) esp_image: segment 2: paddr=0x00040018 vaddr=0x400d0018 size=0xd6908 (878856) map�[0m
�[0;32mI (502) esp_image: segment 3: paddr=0x00116928 vaddr=0x3ffc01d8 size=0x056e0 ( 22240) load�[0m
�[0;32mI (511) esp_image: segment 4: paddr=0x0011c010 vaddr=0x3ffc58b8 size=0x00000 (     0) load�[0m
�[0;32mI (511) esp_image: segment 5: paddr=0x0011c018 vaddr=0x40080000 size=0x00400 (  1024) load�[0m
�[0;32mI (521) esp_image: segment 6: paddr=0x0011c420 vaddr=0x40080400 size=0x15a44 ( 88644) load�[0m
�[0;32mI (566) esp_image: segment 7: paddr=0x00131e6c vaddr=0x400c0000 size=0x00000 (     0) load�[0m
�[0;32mI (566) esp_image: segment 8: paddr=0x00131e74 vaddr=0x50000000 size=0x00000 (     0) load�[0m
�[0;32mI (586) boot: Loaded app from partition at offset 0x10000�[0m
�[0;32mI (586) boot: Disabling RNG early entropy source...�[0m
�[0;32mI (587) cpu_start: Pro cpu up.�[0m
�[0;32mI (590) cpu_start: Starting app cpu, entry point is 0x40080ff8�[0m
�[0;32mI (0) cpu_start: App cpu up.�[0m
�[0;32mI (601) heap_init: Initializing. RAM available for dynamic allocation:�[0m
�[0;32mI (608) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM�[0m
�[0;32mI (614) heap_init: At 3FFD5170 len 0000AE90 (43 KiB): DRAM�[0m
�[0;32mI (620) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM�[0m
�[0;32mI (626) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
�[0;32mI (633) heap_init: At 40095E44 len 0000A1BC (40 KiB): IRAM�[0m
�[0;32mI (639) cpu_start: Pro cpu start user code�[0m
�[0;32mI (321) cpu_start: Starting scheduler on PRO CPU.�[0m
�[0;32mI (0) cpu_start: Starting scheduler on APP CPU.�[0m
�[0;32mI (364) BLE2MQTT: Version: v0.6.0�[0m
�[0;32mI (364) Config: Initializing configuration�[0m
�[0;32mI (404) Config: version: cf462b4463eb8ea897527476344f66b6�[0m
�[0;32mI (404) OTA: Initializing OTA�[0m
I (404) wifi: wifi driver task: 3ffdef04, prio:23, stack:3584, core=0
I (414) wifi: wifi firmware version: d5da5a5
I (414) wifi: config NVS flash: enabled
I (414) wifi: config nano formating: disabled
�[0;32mI (424) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
�[0;32mI (434) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
I (454) wifi: Init dynamic tx buffer num: 32
I (454) wifi: Init data frame dynamic rx buffer num: 32
I (454) wifi: Init management frame dynamic rx buffer num: 32
I (454) wifi: Init static rx buffer size: 1600
I (464) wifi: Init static rx buffer num: 10
I (464) wifi: Init dynamic rx buffer num: 32
�[0;32mI (474) BTDM_INIT: BT controller compile version [0e46ff6]
�[0m
�[0;32mI (474) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m

Brownout detector was triggered

ets Jun  8 2016 00:22:57

2 same ESP32 Wemos WiFi and battery..((
Try 5 times..

Queued and dequeued operations mismatch

Hi,

  1. I'm trying to troubleshoot indications callback and have added an id field to struct operation.
  2. I used a global static queue_id which is incremented inside ble_operation_enqueue()
  3. Notice how the characteristics don't match up in the Enqueue vs Dequeue
W (23350) BLE: Enqueue: id: 2, type: 0, device: 28:fd:80:07:b5:25, char: 00002a01-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0

vs

W (24700) BLE: Dequeue: id: 2, type: 0, device: 28:fd:80:07:b5:25, char: 00002a00-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0

Could you verify this at your end? Thank you.

Full logs:

D (17220) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (17320) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (17430) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (17530) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (17530) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (18940) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (20780) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (21700) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (21800) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (21810) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (21910) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
I (21910) BLE2MQTT: Discovered BLE device: 28:fd:80:07:b5:25, connecting
D (21920) BLE: Received GAP event 18 (ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT)
W (22120) BLE: Received GATTC event 40 (ESP_GATTC_CONNECT_EVT), gattc_if 1
W (22120) BLE: GATTC event 40 wasn't handled
W (22120) BLE: Received GATTC event 2 (ESP_GATTC_OPEN_EVT), gattc_if 1
D (22130) BLE: Received GAP event 7 (ESP_GAP_BLE_SCAN_START_COMPLETE_EVT)
D (22250) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (22320) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (22320) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (22430) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (22540) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (22850) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (22960) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (23060) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
W (23110) BLE: Received GATTC event 18 (ESP_GATTC_CFG_MTU_EVT), gattc_if 1
I (23110) BLE2MQTT: Connected to device: 28:fd:80:07:b5:25, scanning
D (23120) MQTT: Subscribing to 28:fd:80:07:b5:25/Connected
D (23120) MQTT_CLIENT: mqtt_enqueue id: 33995, type=8 successful
D (23130) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/Connected, id: 53441, type=8 successful
W (23140) BLE: Received GATTC event 7 (ESP_GATTC_SEARCH_RES_EVT), gattc_if 1
W (23140) BLE: GATTC event 7 wasn't handled
W (23150) BLE: Received GATTC event 7 (ESP_GATTC_SEARCH_RES_EVT), gattc_if 1
W (23160) BLE: GATTC event 7 wasn't handled
W (23160) BLE: Received GATTC event 7 (ESP_GATTC_SEARCH_RES_EVT), gattc_if 1
W (23170) BLE: GATTC event 7 wasn't handled
D (23170) MQTT_CLIENT: msg_type=9, msg_id=53441
W (23170) BLE: Received GATTC event 7 (ESP_GATTC_SEARCH_RES_EVT), gattc_if 1
D (23180) MQTT_CLIENT: msg_type=9, msg_id=53441
W (23180) BLE: GATTC event 7 wasn't handled
D (23190) MQTT_CLIENT: pending_id=53441, pending_msg_count = 1
W (23190) BLE: Received GATTC event 6 (ESP_GATTC_SEARCH_CMPL_EVT), gattc_if 1
D (23200) MQTT_CLIENT: Subscribe successful
D (23210) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (23210) BLE2MQTT: Services discovered on device: 28:fd:80:07:b5:25
D (23220) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (23230) BLE2MQTT: Found new characteristic!
D (23240) BLE2MQTT:   Service: 00001800-0000-1000-8000-00805f9b34fb
D (23240) BLE2MQTT:   Characteristic: 00002a00-0000-1000-8000-00805f9b34fb
D (23250) MQTT: Subscribing to 28:fd:80:07:b5:25/GenericAccess/DeviceName/Get
D (23260) MQTT_CLIENT: mqtt_enqueue id: 53441, type=8 successful
D (23260) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/GenericAccess/DeviceName/Get, id: 19104, type=8 successful
D (23270) MQTT_CLIENT: msg_type=9, msg_id=19104
D (23280) MQTT_CLIENT: msg_type=9, msg_id=19104
W (23280) BLE: Enqueue: id: 1, type: 0, device: 28:fd:80:07:b5:25, char: 00002a00-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23280) MQTT_CLIENT: pending_id=19104, pending_msg_count = 1
D (23300) BLE2MQTT: Found new characteristic!
D (23300) MQTT_CLIENT: Subscribe successful
D (23300) BLE2MQTT:   Service: 00001800-0000-1000-8000-00805f9b34fb
D (23310) BLE2MQTT:   Characteristic: 00002a01-0000-1000-8000-00805f9b34fb
D (23320) MQTT: Subscribing to 28:fd:80:07:b5:25/GenericAccess/Appearance/Get
D (23330) MQTT_CLIENT: mqtt_enqueue id: 19104, type=8 successful
D (23340) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/GenericAccess/Appearance/Get, id: 4312, type=8 successful
W (23350) BLE: Enqueue: id: 2, type: 0, device: 28:fd:80:07:b5:25, char: 00002a01-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23360) MQTT_CLIENT: msg_type=9, msg_id=4312
D (23360) BLE2MQTT: Found new characteristic!
D (23370) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (23360) MQTT_CLIENT: msg_type=9, msg_id=4312
D (23370) BLE2MQTT:   Service: 00001800-0000-1000-8000-00805f9b34fb
D (23380) MQTT_CLIENT: pending_id=4312, pending_msg_count = 1
D (23390) BLE2MQTT:   Characteristic: 00002a02-0000-1000-8000-00805f9b34fb
D (23390) MQTT_CLIENT: Subscribe successful
D (23400) MQTT: Subscribing to 28:fd:80:07:b5:25/GenericAccess/PeripheralPrivacyFlag/Get
D (23410) MQTT_CLIENT: mqtt_enqueue id: 4312, type=8 successful
D (23420) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/GenericAccess/PeripheralPrivacyFlag/Get, id: 59304, type=8 successful
D (23420) MQTT_CLIENT: msg_type=9, msg_id=59304
W (23430) BLE: Enqueue: id: 3, type: 0, device: 28:fd:80:07:b5:25, char: 00002a02-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23430) MQTT_CLIENT: msg_type=9, msg_id=59304
D (23450) MQTT_CLIENT: pending_id=59304, pending_msg_count = 1
D (23450) MQTT: Subscribing to 28:fd:80:07:b5:25/GenericAccess/PeripheralPrivacyFlag/Set
D (23450) MQTT_CLIENT: Subscribe successful
D (23470) MQTT_CLIENT: mqtt_enqueue id: 59304, type=8 successful
D (23470) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/GenericAccess/PeripheralPrivacyFlag/Set, id: 19378, type=8 successful
D (23480) MQTT_CLIENT: msg_type=9, msg_id=19378
D (23490) BLE2MQTT: Found new characteristic!
D (23490) BLE2MQTT:   Service: 00001800-0000-1000-8000-00805f9b34fb
D (23490) MQTT_CLIENT: msg_type=9, msg_id=19378
D (23500) MQTT_CLIENT: pending_id=19378, pending_msg_count = 1
D (23510) BLE2MQTT:   Characteristic: 00002a04-0000-1000-8000-00805f9b34fb
D (23510) MQTT_CLIENT: Subscribe successful
D (23520) MQTT: Subscribing to 28:fd:80:07:b5:25/GenericAccess/PeripheralPreferredConnectionParameters/Get
D (23530) MQTT_CLIENT: mqtt_enqueue id: 19378, type=8 successful
D (23540) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/GenericAccess/PeripheralPreferredConnectionParameters/Get, id: 3525, type=8 successful
D (23540) MQTT_CLIENT: msg_type=9, msg_id=3525
D (23560) MQTT_CLIENT: msg_type=9, msg_id=3525
W (23560) BLE: Enqueue: id: 4, type: 0, device: 28:fd:80:07:b5:25, char: 00002a04-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23560) MQTT_CLIENT: pending_id=3525, pending_msg_count = 1
D (23580) MQTT_CLIENT: Subscribe successful
D (23580) BLE2MQTT: Found new characteristic!
D (23590) BLE2MQTT:   Service: 00001801-0000-1000-8000-00805f9b34fb
D (23590) BLE2MQTT:   Characteristic: 00002a05-0000-1000-8000-00805f9b34fb
D (23600) BLE2MQTT: Found new characteristic!
D (23600) BLE2MQTT:   Service: 0000180a-0000-1000-8000-00805f9b34fb
D (23610) BLE2MQTT:   Characteristic: 00002a29-0000-1000-8000-00805f9b34fb
D (23620) MQTT: Subscribing to 28:fd:80:07:b5:25/DeviceInformation/ManufacturerNameString/Get
D (23630) MQTT_CLIENT: mqtt_enqueue id: 3525, type=8 successful
D (23630) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/DeviceInformation/ManufacturerNameString/Get, id: 56390, type=8 successful
D (23640) MQTT_CLIENT: msg_type=9, msg_id=56390
D (23650) MQTT_CLIENT: msg_type=9, msg_id=56390
W (23650) BLE: Enqueue: id: 5, type: 0, device: 28:fd:80:07:b5:25, char: 00002a29-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23650) MQTT_CLIENT: pending_id=56390, pending_msg_count = 1
D (23670) BLE2MQTT: Found new characteristic!
D (23670) MQTT_CLIENT: Subscribe successful
D (23680) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (23680) BLE2MQTT:   Service: 0000180a-0000-1000-8000-00805f9b34fb
D (23690) BLE2MQTT:   Characteristic: 00002a24-0000-1000-8000-00805f9b34fb
D (23700) MQTT: Subscribing to 28:fd:80:07:b5:25/DeviceInformation/ModelNumberString/Get
D (23710) MQTT_CLIENT: mqtt_enqueue id: 56390, type=8 successful
D (23720) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/DeviceInformation/ModelNumberString/Get, id: 16472, type=8 successful
D (23720) MQTT_CLIENT: msg_type=9, msg_id=16472
W (23730) BLE: Enqueue: id: 6, type: 0, device: 28:fd:80:07:b5:25, char: 00002a24-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23730) MQTT_CLIENT: msg_type=9, msg_id=16472
D (23750) MQTT_CLIENT: pending_id=16472, pending_msg_count = 1
D (23750) BLE2MQTT: Found new characteristic!
D (23750) MQTT_CLIENT: Subscribe successful
D (23760) BLE2MQTT:   Service: 0000180a-0000-1000-8000-00805f9b34fb
D (23770) BLE2MQTT:   Characteristic: 00002a26-0000-1000-8000-00805f9b34fb
D (23780) MQTT: Subscribing to 28:fd:80:07:b5:25/DeviceInformation/FirmwareRevisionString/Get
D (23780) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (23780) MQTT_CLIENT: mqtt_enqueue id: 16472, type=8 successful
D (23800) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/DeviceInformation/FirmwareRevisionString/Get, id: 28639, type=8 successful
D (23800) MQTT_CLIENT: msg_type=9, msg_id=28639
W (23810) BLE: Enqueue: id: 7, type: 0, device: 28:fd:80:07:b5:25, char: 00002a26-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23810) MQTT_CLIENT: msg_type=9, msg_id=28639
D (23830) BLE2MQTT: Found new characteristic!
D (23830) MQTT_CLIENT: pending_id=28639, pending_msg_count = 1
D (23840) BLE2MQTT:   Service: 0000180a-0000-1000-8000-00805f9b34fb
D (23840) MQTT_CLIENT: Subscribe successful
D (23850) BLE2MQTT:   Characteristic: 00002a28-0000-1000-8000-00805f9b34fb
D (23860) MQTT: Subscribing to 28:fd:80:07:b5:25/DeviceInformation/SoftwareRevisionString/Get
D (23870) MQTT_CLIENT: mqtt_enqueue id: 28639, type=8 successful
D (23870) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/DeviceInformation/SoftwareRevisionString/Get, id: 23875, type=8 successful
D (23880) MQTT_CLIENT: msg_type=9, msg_id=23875
D (23890) MQTT_CLIENT: msg_type=9, msg_id=23875
W (23890) BLE: Enqueue: id: 8, type: 0, device: 28:fd:80:07:b5:25, char: 00002a28-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23890) MQTT_CLIENT: pending_id=23875, pending_msg_count = 1
D (23910) BLE2MQTT: Found new characteristic!
D (23910) MQTT_CLIENT: Subscribe successful
D (23920) BLE2MQTT:   Service: 0000180a-0000-1000-8000-00805f9b34fb
D (23930) BLE2MQTT:   Characteristic: 00002a23-0000-1000-8000-00805f9b34fb
D (23930) MQTT: Subscribing to 28:fd:80:07:b5:25/DeviceInformation/SystemID/Get
D (23940) MQTT_CLIENT: mqtt_enqueue id: 23875, type=8 successful
D (23950) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/DeviceInformation/SystemID/Get, id: 20371, type=8 successful
W (23960) BLE: Enqueue: id: 9, type: 0, device: 28:fd:80:07:b5:25, char: 00002a23-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (23960) MQTT_CLIENT: msg_type=9, msg_id=20371
D (23980) MQTT_CLIENT: msg_type=9, msg_id=20371
D (23980) BLE2MQTT: Found new characteristic!
D (23980) MQTT_CLIENT: pending_id=20371, pending_msg_count = 1
D (23990) BLE2MQTT:   Service: 0000180a-0000-1000-8000-00805f9b34fb
D (23990) MQTT_CLIENT: Subscribe successful
D (24000) BLE2MQTT:   Characteristic: 00002a50-0000-1000-8000-00805f9b34fb
D (24010) MQTT: Subscribing to 28:fd:80:07:b5:25/DeviceInformation/PnPID/Get
D (24010) MQTT_CLIENT: mqtt_enqueue id: 20371, type=8 successful
D (24020) MQTT_CLIENT: Sent subscribe topic=28:fd:80:07:b5:25/DeviceInformation/PnPID/Get, id: 18699, type=8 successful
D (24030) MQTT_CLIENT: msg_type=9, msg_id=18699
D (24040) MQTT_CLIENT: msg_type=9, msg_id=18699
W (24040) BLE: Enqueue: id: 10, type: 0, device: 28:fd:80:07:b5:25, char: 00002a50-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
D (24040) MQTT_CLIENT: pending_id=18699, pending_msg_count = 1
D (24060) MQTT_CLIENT: Subscribe successful
D (24060) BLE2MQTT: Found new characteristic!
D (24070) BLE2MQTT:   Service: 00001810-0000-1000-8000-00805f9b34fb
D (24070) BLE2MQTT:   Characteristic: 00002a35-0000-1000-8000-00805f9b34fb
I (24080) BLE: Indication registered: 00002a35-0000-1000-8000-00805f9b34fb
W (24080) BLE: Received GATTC event 38 (ESP_GATTC_REG_FOR_NOTIFY_EVT), gattc_if 1
W (24090) BLE: Enqueue: id: 11, type: 2, device: 28:fd:80:07:b5:25, char: 00002a35-0000-1000-8000-00805f9b34fb, len: 2, val: 0x3ffd37d4
D (24110) BLE2MQTT: Found new characteristic!
D (24110) BLE2MQTT:   Service: 00001810-0000-1000-8000-00805f9b34fb
D (24120) BLE2MQTT:   Characteristic: 00002a49-0000-1000-8000-00805f9b34fb
D (24380) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
W (24610) BLE: Queue timer expired
W (24610) BLE: Dequeue: id: 1, type: 0, device: 28:fd:80:07:b5:25, char: 00002a00-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
W (24700) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (24700) BLE: Dequeue: id: 2, type: 0, device: 28:fd:80:07:b5:25, char: 00002a00-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (24700) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/GenericAccess/DeviceName = BC85
W (24760) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (24760) BLE: Dequeue: id: 3, type: 0, device: 28:fd:80:07:b5:25, char: 00002a01-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (24760) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/GenericAccess/Appearance = 0
W (24790) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (24790) BLE: Dequeue: id: 4, type: 0, device: 28:fd:80:07:b5:25, char: 00002a02-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (24790) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/GenericAccess/PeripheralPrivacyFlag = false
W (24880) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (24880) BLE: Dequeue: id: 5, type: 0, device: 28:fd:80:07:b5:25, char: 00002a04-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (24880) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/GenericAccess/PeripheralPreferredConnectionParameters = 8,16,0,100
W (24980) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (24980) BLE: Dequeue: id: 6, type: 0, device: 28:fd:80:07:b5:25, char: 00002a24-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (24980) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/DeviceInformation/ManufacturerNameString = Dialog Semi
W (25030) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (25030) BLE: Dequeue: id: 7, type: 0, device: 28:fd:80:07:b5:25, char: 00002a24-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (25030) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/DeviceInformation/ModelNumberString = DA14580
W (25070) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (25080) BLE: Dequeue: id: 8, type: 0, device: 28:fd:80:07:b5:25, char: 00002a26-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (25080) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/DeviceInformation/FirmwareRevisionString = v8.1
W (25150) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (25150) BLE: Dequeue: id: 9, type: 0, device: 28:fd:80:07:b5:25, char: 00002a28-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (25150) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/DeviceInformation/SoftwareRevisionString = v_3.150.1.5
W (25190) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (25190) BLE: Dequeue: id: 10, type: 0, device: 28:fd:80:07:b5:25, char: 00002a23-0000-1000-8000-00805f9b34fb, len: 0, val: 0x0
I (25190) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/DeviceInformation/SystemID = 18446744073698423826,14597274
W (25240) BLE: Received GATTC event 3 (ESP_GATTC_READ_CHAR_EVT), gattc_if 1
W (25240) BLE: Dequeue: id: 11, type: 2, device: 28:fd:80:07:b5:25, char: 00002a50-0000-1000-8000-00805f9b34fb, len: 2, val: 0x3ffd37d4
I (25240) BLE2MQTT: Publishing: 28:fd:80:07:b5:25/DeviceInformation/PnPID = 1,210,1408,256
W (25390) BLE: Received GATTC event 9 (ESP_GATTC_WRITE_DESCR_EVT), gattc_if 1
D (25700) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (26630) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (26950) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27230) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27330) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27370) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27530) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27640) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27740) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27850) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (27950) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
W (28070) BT_APPL: bta_gattc_conn_cback() - cif=1 connected=0 conn_id=1 reason=0x0013
W (28070) BLE: Received GATTC event 41 (ESP_GATTC_DISCONNECT_EVT), gattc_if 1
W (28080) BLE: GATTC event 41 wasn't handled
W (28080) BLE: Received GATTC event 5 (ESP_GATTC_CLOSE_EVT), gattc_if 1
I (28090) BLE: Connection closed, reason = 0x13
I (28100) BLE2MQTT: Disconnected from device: 28:fd:80:07:b5:25
D (28100) MQTT: Unsubscribing from 28:fd:80:07:b5:25/Connected
D (28110) MQTT_CLIENT: mqtt_enqueue id: 18699, type=8 successful
D (28110) MQTT_CLIENT: unsubscribe, topic"28:fd:80:07:b5:25/Connected", id: 58361
D (28120) MQTT_CLIENT: Sent Unsubscribe topic=28:fd:80:07:b5:25/Connected, id: 58361, successful
D (28130) MQTT_CLIENT: msg_type=11, msg_id=58361
D (28140) MQTT_CLIENT: msg_type=11, msg_id=58361
D (28140) MQTT_CLIENT: pending_id=58361, pending_msg_count = 1
D (28150) MQTT_CLIENT: UnSubscribe successful
D (28160) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28370) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28480) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28580) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28670) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28690) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28780) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28790) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (28900) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29000) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29110) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29220) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29320) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29420) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29520) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29620) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29720) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29800) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (29930) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (30030) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)
D (30130) BLE: Received GAP event 3 (ESP_GAP_BLE_SCAN_RESULT_EVT)

No ESP_GATTC_NOTIFY_EVT received

Hi,

  1. I have a blood pressure device https://www.beurer.com/web/gb/products/medical/blood-presure/upper-arm-blood-pressure-monitors/bm-85.php that operates offline and stores measurements in its memory
  2. The measurements can be retrieved by registering for indications from characteristics 0x2A35 and writing 0x0002 to it's 0x2902 descriptor
  3. On another piece of BLE ESP32 code, after doing .2, I immediately get a series of callback via ESP_GATTC_NOTIFY_EVT with all stored measurements. This tells me the ESP32 and BP are good.
  4. However, in esp32-ble2mqtt, after doing .2, there are no ESP_GATTC_NOTIFY_EVT received
  5. Further however, esp32-ble2mqtt does receive ESP_GATTC_NOTIFY_EVT when connected to another device, i.e. mi_scale

Any idea where I can start?

[pending bluetooth.org] Cannot download GATT specifications

Unfortunately, the Bluetooth SIG have made some modifications to their web site which makes it a problem to download the GATT specifications (services and characteristic definitions) during build.
The first is that they're blocking the Python script from accessing the resources (easily fixed by changing the User-Agent). The second, and more problematic, is that their GATT characteristic page shows the same content of the GATT definitions page and does not include the list of official characteristics.

I don't want to commit the auto-generated files in the repository, so I'm opening this issue with the hopes that people find it and attaching the generated files here, see link below. Place both gatt.h and gatt.inc in the main/ directory and the project should compile fine.

gatt.zip

Update: The web-site now correctly displays the list of characteristics however, some of them (e.g. org.bluetooth.characteristic.gap.device_name) are missing the XML definition so I cannot parse the data types. Since most of these characteristics are part of the Generic Access service that all devices expose, I’m still waiting on them to fix it. If it won’t be fixed in the near future, I might add these definitions to the default configuration just so the compilation won’t fail.

Remote-monitor display RSSI

Hi,

I notice that it would be user-friendly to output the rssi value to the remote-monitor.
I have many devices being discovered. I suspect that a device caused the ble2mqtt bridge to crash.
For this i have to use a whitelist to prevent the other devices being discovered.

With the whitelist i do see devices being discovered, but now it's hard to find out which mac-address belongs to which device.

Incorrect behavior with CHAR_TYPE_FLOAT64

There is an incorrect behavior when the characteristic type is float64.

memcpy(&tmp.d, tmp.b, 8);

Moreover, if the compiler use release (-0s) optimization level, the compilation fails:

/home/duranda/esp32-ble2mqtt/main/ble_utils.c:367:18: error: 'tmp.d' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             p += sprintf(p, "%f,", tmp.d);

I think it could be fixed with something like this (not tested):

double tmp;
memcpy(&tmp, data + i, 8);

p += sprintf(p, "%f,", tmp);

error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]

Hey guys, what did i do wrong here :D

/home/user/Desktop/esp32-ble2mqtt/main/config.c: In function 'config_log_port_get': /home/user/Desktop/esp32-ble2mqtt/main/config.c:393:12: warning: returning 'void *' from a function with return type 'uint16_t' {aka 'short unsigned int'} makes integer from pointer without a cast [-Wint-conversion] return NULL; ^~~~ CC build/main/ota.o CC build/main/wifi.o CC build/main/ble2mqtt.o CC build/main/broadcasters.o /home/user/Desktop/esp32-ble2mqtt/main/broadcasters.c: In function 'ibeacon_metadata_get': /home/user/Desktop/esp32-ble2mqtt/main/broadcasters.c:96:19: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=] sprintf(s, "%u", be16toh(beacon->major)); ^ /home/user/Desktop/esp32-ble2mqtt/main/broadcasters.c:96:5: note: 'sprintf' output between 2 and 6 bytes into a destination of size 5 sprintf(s, "%u", be16toh(beacon->major)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/Desktop/esp32-ble2mqtt/main/broadcasters.c:98:19: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=] sprintf(s, "%u", be16toh(beacon->minor)); ^ /home/user/Desktop/esp32-ble2mqtt/main/broadcasters.c:98:5: note: 'sprintf' output between 2 and 6 bytes into a destination of size 5 sprintf(s, "%u", be16toh(beacon->minor)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[1]: *** [/home/user/esp/esp-idf/make/component_wrapper.mk:292: broadcasters.o] Error 1 make: *** [/home/user/esp/esp-idf/make/project.mk:584: component-main-build] Error 2

Remote UDP Logging

I would like to log to remote syslog server over UDP. The ESP-IDF gives API to be able to set it up. I found a github project to achieve it:

https://github.com/MalteJ/embedded-esp32-component-udp_logging

I suggest to make config entry, when server is set, the init is run (after WIFI connection is made)

{
  "log": {
         "server" : {
               "host" : "host",
               "port" : port
          }            
  }

What do you think?

mkspiffs: Permission denied

I'am able to build after installing the toolchain, but doing make flash at the end i get a permission issue.

fabio@imacfabio esp32-ble2mqtt % make flash
Toolchain path: /Users/fabio/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
Compiler version: 5.2.0
Python requirements from /Users/fabio/esp/esp-idf/requirements.txt are satisfied.
make: /Users/fabio/Downloads/esp32-ble2mqtt/mkspiffs: Permission denied
make: *** [/Users/fabio/Downloads/esp32-ble2mqtt/build/spiffs.bin] Error 1

Of course mkspiffs directory exists...as i cloned recursively this project
I think somehow it's a problem with Mac os catalina... but how can i solve?

Can't find spiffs.bin

Hi,

I saw the image download command is

python /root/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xd000 /root/esp/esp32-ble2mqtt/build/ota_data_initial.bin 0x1000 /root/esp/esp32-ble2mqtt/build/bootloader/bootloader.bin 0x10000 /root/esp/esp32-ble2mqtt/build/ble2mqtt.bin 0x8000 /root/esp/esp32-ble2mqtt/build/partitions.bin 0x310000 /root/esp/esp32-ble2mqtt/build/spiffs.bin

But, I cann't found spiffs.bin file, is it correctly?

Add IPV6 Support

For my IOT network I'm using dual stack network. Is there any reason that IPV6 support is not enabled (size, stability etc.)? I've made some modification in WIFI.C and it works well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.