BLE and ESP32 dev environment

… and to exactly know what caused this disconnect… we would highly need a serial output :slight_smile: I also faced that on USB on my Laptop and Arduino Serial output it seemed more stable than on jzs a USB power plug… I use inwall UBS Sockets with 2.1 A by the way

Yes, I know about the problems of cheap power supplies (I use 8 OpenMQTT gateways around the house on ESP8266 and I had to place fairly good 5V adapters as otherwise the boards would reset).

Actually there is no need for a 2 A+ power supply as the board uses ways less than 1 A but it should be stable enough to drive that 1 A.

1 A is guaranteed so from this perspective there shouldn’t be a problem. I got issues above but surprisingly it now works with changed code. Could you please attach your ESP to serial and provide output as soon as it hangs?

Yes you should reverse it for your test

Hmm strange, I suppose with the latest version of OMG?

Hi Florian,

Yes, latest version. MQTT connection is made however there’s no info in the serial connection (and Arduino boards don’t have the option for compiling with debug flag).

So, compiled without the vTaskDelay and on core 1 instead of 0. It worked for about 12 hours then it got disconnected.

[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAE (4065634) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (4065634) task_wdt:  - IDLE0 (CPU 0)
E (4065634) task_wdt: Tasks currently running:
E (4065634) task_wdt: CPU 0: wifi
E (4065634) task_wdt: CPU 1: loopTask
E (4070634) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (4070634) task_wdt:  - IDLE0 (CPU 0)
E (4070634) task_wdt: Tasks currently running:
E (4070634) task_wdt: CPU 0: wifi
E (4070634) task_wdt: CPU 1: loopTask

and so on…

Previously it dropped the MQTT connection however it did recover:

BT Task running on core 1
[D][WiFiClient.cpp:452] connected(): Disconnected: RES: 0, ERR: 128
MQTT connection...
Connected to broker
Subscription OK to the subjects
[D][BLEScan.cpp:196] start(): >> start(duration=10)
[D][BLEScan.cpp:221] start(): << start()
[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
[D][BLEUtils.cpp:1229] dumpGapEvent(): [status: 0]
[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_START_COMPLETE_EVT
[D][BLEUtils.cpp:1305] dumpGapEvent(): [status: 0]
[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_RESULT_EVT

Thanks for the info, I take a look

I’ve tested bit without serial output and it seems working so far but rebooting .unfortunately I don’t know the cause. I might attach it again on the laptop to debig but as long as it reboots and works it’s fine for me I used vtask delay and using core one option .

the other option that I’m testing right now is (if you don’t use RF) to deactivate multicore by commenting the following line:

As my environment doesn’t enable me to reproduce watchdog issue, if you could test with:
-multicore disabled
-without vtaskdelay

It could help us

I’ll try it once I’m at home again this afternoon. ESP just went offline. Will revert :slight_smile:

I compiled mine with BT and mqtt as the only services and deactivated multicore
so far my uptime is "uptime":100751

when i left multicore enabled, core 1 would be crashing the chip periodically

1 Like

Still :running_man:? Would like having a feedback

it was running for over 48 hrs without reboots

Hello @blakadder adder,

Since your last post is it still running?

@thundergreen

Could you test to add in the begining of OpenMQTTGateway.ino at the begining:

#include "soc/timer_group_struct.h"
#include "soc/timer_group_reg.h"

and in the loop

TIMERG0.wdt_wprotect=TIMG_WDT_WKEY_VALUE;
TIMERG0.wdt_feed=1;
TIMERG0.wdt_wprotect=0;

This will enable to test the tip given by @akshar001

You have to restore a fresh ZgatewayBT.ino to cancel your previous changes

Unfortunately my Arduino broke… Can’t start it …have exception error…no idea what happened need to compile online I guess…I’ll try that.please always post the exact file location as an example as I’m noob with programming…I really wanna help but need assistance…sorry for this dumbness

Edit: sorry u did add th file and indicator to change :wink:

Current uptime 87 hrs

1 Like

So i want use ESP32 and BT. What version i must use? Is all this changes implemented or i must correct it?

you can take v0.8 and deactivate multicore.

If you want to participate I’m also interested by your feedback with multicore activated.