Stack smashing protect failure and Circular reboot

My device is an ESP32 Wroom-32 DevKit v4.

I’m using just the OMG ble module.

On boot it appears to crash and reboot when it hits a certain bluetooth device (I can’t determine which one as it’s not printed to the console). It circular reboots every 90 seconds having never fully completed a scan.

I found that by issuing the whitelist command (for the EA2C98FE9060 device listed below) I could prevent the circular rebooting. It’s tricky because I need to issue the whitelist command at just the right (unknown) moment to prevent the circular rebooting. The MQTT retain flag prints the “Hey I got a callback…” message on each reboot but it’s not applying at that stage of execution. I need to randomly issue the command constantly and eventually (after multiple reboots) it takes effect. Once applied (and everything is working) the whitelist does not survive a reboot. I’m not sure if this is by design or a bug?

I’m happy to help troubleshot the core error. What do you need me to provide? The console print out of the crash is below. The scanned device right before the crash is my whitelisted device which once applied can run for several hours without issue.

In the meantime, is there a way I can make the whitelist survive a reboot? Is there somewhere in the config files I can hard code it?


device detected
EA2C98FE9060
BLErssi
-79
txPower
4
BLE DISTANCE :
ovf
Pub json into:
home/home_presence/OpenMQTTGateway_ESP32_BLE
{“id”:“ea:2c:98:fe:90:60”,“name”:“MiniBeacon_28427”,“manufacturerdata”:“L”,“rssi”:-79,“txpower”:4,“distance”:9.029652e12}
Pub data per topic
id
ea:2c:98:fe:90:60
name
MiniBeacon_28427
manufacturerdata
L
rssi
-79
txpower
4
distance
ovf

Stack smashing protect failure!

abort() was called at PC 0x40164907 on core 0

Backtrace: 0x40092244:0x3ffe5bd0 0x40092475:0x3ffe5bf0 0x40164907:0x3ffe5c10 0x400d2765:0x3ffe5c30 0x400d46c5:0x3ffe5c60 0x400d50a1:0x3ffe5fb0 0x400d650b:0x3ffe5ff0 0x400e5471:0x3ffe6370 0x400e46ae:0x3ffe6450 0x400f4e55:0x3ffe64a0 0x400f2932:0x3ffe64c0 0x4008e189:0x3ffe64f0

Rebooting…

ets Jun 8 2016 00:22:57

Hello,

The version of OMG used and if it comes from binary of pio.

It seems that there is an overflow in the distance calculation.

Are you using home assistant ? If not you can try to comment the roompresence macro in config_BT.h.

This will enable to isolate the issue.

Thanks for the quick response.

The version is 0.9.2 and it comes from pio.

I’m not using home assistant and after commenting out line 45 of config_BT.h it’s working fine - Thanks very much.

I’m happy to keep troubleshooting the root issue. Please let me know how I can assist.

Pete