diff --git a/code/nrf-connect/samples/zigbee/prj.conf b/code/nrf-connect/samples/zigbee/prj.conf index 5583e41..4c52f54 100644 --- a/code/nrf-connect/samples/zigbee/prj.conf +++ b/code/nrf-connect/samples/zigbee/prj.conf @@ -61,8 +61,10 @@ CONFIG_FILE_SYSTEM=y CONFIG_FILE_SYSTEM_LITTLEFS=y # Uncomment for debug log level. -# CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_LOG_DEFAULT_LEVEL=4 # Factory reset method selection. Only hardware revision 2.0.0+ has button SW1. Earlier # revisions must select a different method. See Kconfig for options. # CONFIG_PRST_ZB_FACTORY_RESET_VIA_SW1=y + +CONFIG_PRST_ZB_SLEEP_DURATION_SEC=1 diff --git a/code/nrf-connect/samples/zigbee/src/main.c b/code/nrf-connect/samples/zigbee/src/main.c index 20cbe9f..96c647e 100644 --- a/code/nrf-connect/samples/zigbee/src/main.c +++ b/code/nrf-connect/samples/zigbee/src/main.c @@ -143,6 +143,14 @@ void update_sensors_cb(zb_uint8_t arg) { } prst_debug_counters_increment("sensors_read_after"); + // Bug reproduction - simulates an error in the i2c reading in shtc3.c that would create an infinite loop. + // - Since we have a k_msleep() there, the loop would still be energy efficient, so it wouldn't drain the battery. + // - Other ZB functionality still works + // - Even though we called ZB_SCHEDULE_APP_ALARM earlier, the scheduled callback is never called. Maybe because the same callback is still running? + while (true) { + k_msleep(10); + } + // Battery voltage in units of 100 mV. uint8_t batt_voltage = sensors.batt.adc_read.millivolts / 100; prst_zb_set_attr_value(ZB_ZCL_CLUSTER_ID_POWER_CONFIG,