How to stabilize the Bluetooth connection and avoid frequent disconnections?
Last Updated on:2024-02-18 06:46:20
Check if the product hardware and module antenna are obstructed, or if there are devices such as inductors nearby causing interference.
Check if there are frequent interrupts occupying the Application (such as Timer interrupts). High-frequency interrupts will prevent Bluetooth interrupts from entering normally, leading to unstable Bluetooth connections. Currently, most platforms used by Mesh do not support interrupt nesting and priority, so it is recommended that the Timer interrupt period should be over 10ms, and it should be enabled as needed and turned off when not in use, in order to minimize the impact on Bluetooth interrupts.
Reduce the code execution time in the interrupt callback, and cache the data to be processed later in theOPERATE_RET tuya_main_loop(VOID_T); function.