guild icon
Toit
#BLE stops wroking after multiple read/write to characteristics
Thread channel in help
theHuanter
theHuanter 07/24/2023 08:05 AM
I am running 2 ESP32 Devices where one is broadcasting a BLE Service with some characteristics and is waiting in a task for the readings. The second device writes its value once every second to this characteristic of the first device. After about ~10 writes the second device crashes with
NimBLE error, Type: client, error code: 0x07.
which accorcing to the link provided for error codes is: BLE_HS_ENOTCONN 0x07 a lost connection.
The server device is still running and waiting for inputs but if I try to connect via nRF Connect App, I can not connect anymore to the device but the device is still broadcasting.

If I then restart the device by hard-reset it crashes with a OOM, reboots and then it starts working again. So this seems like a OOM issue in the characteristic read/receive mechanism I assume.
The Server device never crashes until I reboot.

@MikkelD have you maybe also seen this before?
theHuanter
theHuanter 07/24/2023 09:11 AM
it is pretty much exactly 10 readings. Hard-Reset does not trigger the OOM but a re-install of the container (using artemis)

[artemis.scheduler] INFO: job started {job: container:station} [station] DEBUG: ProductId: 0.1 [station] DEBUG: Config: 215 [station] DEBUG: MODE: USB powered [station] DEBUG: Starting RiWa Station [ble] DEBUG: Advertising: 610e8afe-0618-49f4-a49c-7330da8607d5 with name RiWa-Station [artemis.synchronize] INFO: synchronized state to broker [artemis.synchronize] INFO: synchronized Guru Meditation Error: Core 0 panic'ed (StoreProhibited). Exception was unhandled. Core 0 register dump: PC : 0x40089120 PS : 0x00060633 A0 : 0x8008923d A1 : 0x3ffd4940 A2 : 0xdeadf1ee A3 : 0x00000000 A4 : 0x000000e7 A5 : 0x0000001c A6 : 0x003fffff A7 : 0x00001000 A8 : 0x00000000 A9 : 0x3ffd4940 A10 : 0x00000003 A11 : 0x00060623 A12 : 0x00060620 A13 : 0x3ffcedac A14 : 0x0000004b A15 : 0x00000000 SAR : 0x00000004 EXCCAUSE: 0x0000001d EXCVADDR: 0xdeadf1ee LBEG : 0x40097974 LEND : 0x40097990 LCOUNT : 0xffffffff ****************************************************************************** Decoding by `jag`, device has version <2.0.0-alpha.90> ****************************************************************************** Backtrace: 0x4008911d:0x3ffd4940 0x4008923a:0x3ffd4960 0x400892f8:0x3ffd4990 0x4008949d:0x3ffd49b0 0x400895d9:0x3ffd49e0 0x40088c76:0x 3ffd4a00 0x40088c89:0x3ffd4a20 0x40088cb6:0x3ffd4a40 0x4009e4b9:0x3ffd4a60 0x4011654c:0x3ffd4a80 0x40116ed6:0x3ffd4aa0 0x4011ade0:0x3f fd4ac0 0x400dc5e9:0x3ffd4b00 0x400e2743:0x3ffd4b20 0x4011633d:0x3ffd4b50 jag: Failed to decode line. ****************************************************************************** ELF file SHA256: faf8cfb4d658c68f
MikkelD
MikkelD 07/24/2023 10:35 AM
I have had issues with two ESP32's talking on BT too. I dont think I ever got it to work properly.
MikkelDMikkelD
I have had issues with two ESP32's talking on BT too. I dont think I ever got it to work properly.
theHuanter
theHuanter 07/24/2023 10:58 AM
I made a similar version where the client only send one value every 1 minute and this seems to work, but it is very strange how the server just stops receiving while still advertising but no error at all except the connection lost error on the client side
4 messages in total