ESP32 BLE: _IRQ_GATTS_WRITE not getting called on peripheral when characteristic written on central
Posted: Thu May 12, 2022 11:10 pm
Hi,
I'm pretty new to BLE, and MicroPython's implementation, so I've been playing around and augmenting/modifying the ble_temperature and ble_temperature_central demo scripts. Everything has been working just great in that writing to characteristics by the Central device (an ESP32) has called the appropriate _IRQ_GATTS_WRITE interrupt event on the Peripheral (another ESP32).
Just recently, without having changed any of the interrupt-handling code (to my knowledge), _IRQ_GATTS_WRITE in the BLE().irq() event handler ceases to be called when a Central writes to a characteristic. To my knowledge, within MicroPython's implementation of BLE, there is no way to 'turn off' these interrupts, and in any event I didn't want to. For the record, my GATTS setup is large and includes eight services with 70 characteristics distributed among them (not including the GEN_ACCESS and GEN_ATTRIBUTE services). While the Central sometimes doesn't discover all characteristics (another general question: why?), the Peripheral has previously detected the Central writing to a characteristic, with no problems.
It's really important that I find out what might be hindering the interrupt call, as I need to know when Centrals are writing to characteristics, and to which ones. Without the _IRQ_GATTS_WRITE interrupt, I have no idea which handle has been written to, or if/when. If any of you have encountered any similar behaviour or have any insight about what's wrong, please let me know!
Thanks very much for anybody's/everybody's insights!
- Andrew
I'm pretty new to BLE, and MicroPython's implementation, so I've been playing around and augmenting/modifying the ble_temperature and ble_temperature_central demo scripts. Everything has been working just great in that writing to characteristics by the Central device (an ESP32) has called the appropriate _IRQ_GATTS_WRITE interrupt event on the Peripheral (another ESP32).
Just recently, without having changed any of the interrupt-handling code (to my knowledge), _IRQ_GATTS_WRITE in the BLE().irq() event handler ceases to be called when a Central writes to a characteristic. To my knowledge, within MicroPython's implementation of BLE, there is no way to 'turn off' these interrupts, and in any event I didn't want to. For the record, my GATTS setup is large and includes eight services with 70 characteristics distributed among them (not including the GEN_ACCESS and GEN_ATTRIBUTE services). While the Central sometimes doesn't discover all characteristics (another general question: why?), the Peripheral has previously detected the Central writing to a characteristic, with no problems.
It's really important that I find out what might be hindering the interrupt call, as I need to know when Centrals are writing to characteristics, and to which ones. Without the _IRQ_GATTS_WRITE interrupt, I have no idea which handle has been written to, or if/when. If any of you have encountered any similar behaviour or have any insight about what's wrong, please let me know!
Thanks very much for anybody's/everybody's insights!
- Andrew