OpenMQTTGateway icon indicating copy to clipboard operation
OpenMQTTGateway copied to clipboard

BLE on ESP32 is not working anymore after a few hours

Open rolfberkenbosch opened this issue 8 years ago • 105 comments

Hi All,

Does anybody know's why the BLE on the ESP32 is not working anymore after a few hours. I need to turn off the power and power it again. Below the messages when it is not working anymore:

Data stored E (4452082) BT: btc_search_callback BLE observe complete. Num Resp 0

BT Task running on core 0 E (4482287) BT: btc_search_callback BLE observe complete. Num Resp 0

BT Task running on core 0 E (4512492) BT: btc_search_callback BLE observe complete. Num Resp 0

BT Task running on core 0

When it is working i see the following:

BT Task running on core 0 Get ManufacturerData  Get RSSI home/BTtoMQTT/3165909E9745 -47 Get ManufacturerData ⸮ Get RSSI home/BTtoMQTT/7E8538567669 -81 Get service data 0000000000000000000000000000000000000000 Get service data UUID 0000fe9f-0000-1000-8000-00805f9b34fb Get ManufacturerData ⸮ Get RSSI home/BTtoMQTT/57FB4DB4D297 -68 Get service data 0000000000000000000000000000000000000000 Get service data UUID 0000fe9f-0000-1000-8000-00805f9b34fb Get Name Flower care Get RSSI home/BTtoMQTT/C47C8D661011 -87 Get service data 71209800821110668d7cc40d0710034e0000 Get service data UUID 0000fe95-0000-1000-8000-00805f9b34fb Processing mi flora data

Does anybody has a fix for this or know how to solve this ?

rolfberkenbosch avatar Feb 04 '18 19:02 rolfberkenbosch

Hello,

I'm investigating on this issue, the same issue was reported on home assistant forum

1technophile avatar Feb 04 '18 19:02 1technophile

Ok, let me know if I can do anything for you to help.

rolfberkenbosch avatar Feb 04 '18 20:02 rolfberkenbosch

thanks for proposing, could you change l117 of ZgatewayBT and replace 1 by 0 Current

                          1,          /* Priority of the task */

New

                          0,          /* Priority of the task */

and try again

In the meanwhile I'm doing another test

1technophile avatar Feb 04 '18 20:02 1technophile

Hi, I have tried that but the same problem accour after a few hours._

rolfberkenbosch avatar Feb 05 '18 19:02 rolfberkenbosch

I’m having the same problem, also after the change l117 Thank you in advance for a fix

alpat59 avatar Feb 07 '18 07:02 alpat59

Hi all, using a doit esp32 I have the same problem, after a few hours the board becomes totally unresponsive. When you are using the BLE options other components fail as well (RF433). Thanks in advance

betonishard avatar Feb 12 '18 17:02 betonishard

I`m also have the same problem with ESP32 that i lose connection after some time. I tried to find cause, but right now i have only found out that it is the wifi connection that fails after some time. Tried to ping the IP adress but no answer, but i can see in the seriall monitor that everyting else works.

Boxter83 avatar Feb 13 '18 22:02 Boxter83

Thanks for the infos, i will take a look on it in a few days

1technophile avatar Feb 14 '18 06:02 1technophile

It seems that there is a memory leak somewhere, i have the available ram decreasing continuously. I have to isolate now where it comes from.

1technophile avatar Feb 16 '18 17:02 1technophile

@all could you test last version from master please, I did a modification after @nkolban advices

1technophile avatar Feb 17 '18 07:02 1technophile

@1technophile replaced the ZgatewayBT.ino file in my current setup and test is running.

I will post my findings

betonishard avatar Feb 17 '18 09:02 betonishard

I tryed the new ZgatewayBT.ino but then it dosen't finde my Miflora anymore. Anymore else how made it work better than me?

Boxter83 avatar Feb 17 '18 11:02 Boxter83

I tried too and it doesn't find BLE devices. Thank you for your support

alpat59 avatar Feb 17 '18 12:02 alpat59

sorry .. the behaviour changed just now after 3/4 reboot (why?). Now I can see BLE devices. I'll check if it will work stable.

alpat59 avatar Feb 17 '18 12:02 alpat59

Hello @all. Actually it works good now in my setup. Maybe if I would share my setup it could be helpfull to others. I have a DOIT ESP32, with an RF receiver connected to gpio 27 and a rf sender connected to gpio 12. I have 2 bluetoothe beacons (nut) and they get detected as well as my miFlora which is working also properly sinds this morning (for 7 hours straight now).

betonishard avatar Feb 17 '18 15:02 betonishard

@alpat59 you mean with the new code it didn't find your beacons or it is the first time you tried with openmqttgateway. If you are in the second case you should better go to the chat room and gives infis about your setup

1technophile avatar Feb 17 '18 17:02 1technophile

@alpat59 haven t seen your last post. Forget my comment.

1technophile avatar Feb 17 '18 17:02 1technophile

Hi My problem was that i loses wifi connector after some time. I could see that reconnect to wifi was the problem. My dirty fix was to move [client.loop()] to the begin of the [void loop] , than i added [setup_wifi ()] in the while loop of [boolean reconnect ()] Now it has been working more than 10 hours soo far.

Boxter83 avatar Feb 17 '18 21:02 Boxter83

@1technophile I'm trying it also right now. There is indeed a problem with the wifi connection. I have made a ugly fix fix for it. I will push the fix to git tomorrow.

rolfberkenbosch avatar Feb 18 '18 10:02 rolfberkenbosch

@betonishard are you also having a problem with the wifi connection ?

1technophile avatar Feb 18 '18 11:02 1technophile