Closed lboue closed 7 months ago
bool CSystem::initialize()
{
/* *** */
// start matter
ret = esp_matter::start(matter_event_callback);
if (ret != ESP_OK) {
GetLogger(eLogType::Error)->Log("Failed to start matter (ret: %d)", ret);
return false;
}
// prevent endpoint id increment when board reset
matter_set_min_endpoint_id(1);
GetLogger(eLogType::Info)->Log("Matter started");
CDevice *dev = new CDeviceFanControlDCMotor();
if (dev && dev->matter_add_endpoint()) {
m_device_list.push_back(dev);
dev->matter_update_all_attribute_values();
} else {
return false;
}
GetMemory()->Initialize();
GetLogger(eLogType::Info)->Log("System Initialized");
print_system_info();
return true;
}
@lboue
I guess that crash had occurred when creating CDeviceFanControlMotor
instance but I'm not sure.
(There are no logs after calling esp_matter::start())
I'll look further as soon as possible with my esp32 devkit.
Yes, I'll take a look at it myself. I will add some log message CDeviceFanControlMotor . Thanks.
I don't know exactly why, but I don't have this boot loop issue since I change Motor pin to GPIO21:
#define GPIO_PIN_MOTOR_PWM 21
I (2152) logger: Checking m_motor_pwm_driver: TRUE
I (2162) NimBLE: adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=40 adv_itvl_max=40
I (2162) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 1| Intr:0
I (2172) NimBLE:
I (2182) logger: ----- END: Checking m_motor_pwm_driver -----
I (2192) chip[DL]: CHIPoBLE advertising started
I (2202) logger: [CSystem::matter_event_callback] Commissioning window opened [system.cpp:391]
I (2212) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000003's Attribute 0x00000001 is 0 **********
I (2222) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000004's Attribute 0x00000000 is 128 **********
I (2232) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000004's Attribute 0x0000FFFC is <invalid type: 0> **********
I (2242) esp_matter_core: Dynamic endpoint 1 added
I (2252) logger: [CSystem::matter_update_attribute] Try to update matter attribute (endpoint: 1, cluster: 0x0202, attribute: 0x0000, value: 0) [system.cpp:353]
I (2262) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2282) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: FanMode(0x0000), value: 0 [device_fanctrl_dcmotor.cpp:122]
I (2302) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2302) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2322) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentSetting(0x0002), value: 0 [device_fanctrl_dcmotor.cpp:144]
I (2332) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2342) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2362) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x0000FFFC is 0 **********
I (2372) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000003 is 0 **********
I (2382) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentCurrent(0x0003), value: 0 [device_fanctrl_dcmotor.cpp:152]
I (2402) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x0000FFFC is 0 **********
I (2412) logger: [CSystem::matter_update_attribute] Try to update matter attribute (endpoint: 1, cluster: 0x0202, attribute: 0x0002, value: 0) [system.cpp:353]
I (2422) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2432) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentSetting(0x0002), value: 0 [device_fanctrl_dcmotor.cpp:144]
I (2452) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2462) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2472) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x0000FFFC is 0 **********
I (2492) logger: [CSystem::matter_update_attribute] Try to update matter attribute (endpoint: 1, cluster: 0x0202, attribute: 0x0003, value: 0) [system.cpp:353]
I (2502) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000003 is 0 **********
I (2512) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentCurrent(0x0003), value: 0 [device_fanctrl_dcmotor.cpp:152]
I (2532) logger: [CSystem::initialize] System Initialized [system.cpp:100]
I (2542) logger: [CSystem::print_system_info] System Info [system.cpp:248]
I (2542) logger: ----- ESP32 -----
I (2552) logger: Project Name: yogyui-matter-esp32-dcmotor
I (2552) logger: App Version: 1.0.0.0
I (2562) logger: CPU Core(s): 2
I (2562) logger: Revision: 1.0
I (2572) logger: Flash Size: 4 MB (embedded)
I (2572) logger: Heap Free Size: 79208
@lboue That's very interesting (and also embarrassing...)
when I had flashed firmware with no change (GPIO 16
as PWM output), there was no problem like below
I (2228) logger: [CSystem::matter_set_min_endpoint_id] Set minimum endpoint id as 1 [system.cpp:315]
I (2228) chip[DL]: Done driving station state, nothing else to do...
I (2238) logger: [CSystem::initialize] Matter started [system.cpp:88]
I (2258) gpio: GPIO[16]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 1| Intr:0
I (2278) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000003's Attribute 0x00000001 is 0 **********
I (2278) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000004's Attribute 0x00000000 is 128 **********
I (2288) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000004's Attribute 0x0000FFFC is <invalid type: 0> **********
I (2308) esp_matter_core: Dynamic endpoint 1 added
I (2308) logger: [CSystem::matter_update_attribute] Try to update matter attribute (endpoint: 1, cluster: 0x0202, attribute: 0x0000, value: 0) [system.cpp:353]
I (2328) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2338) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: FanMode(0x0000), value: 0 [device_fanctrl_dcmotor.cpp:118]
I (2358) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2368) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2378) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentSetting(0x0002), value: 0 [device_fanctrl_dcmotor.cpp:140]
I (2398) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2408) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2418) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x0000FFFC is 0 **********
I (2428) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000003 is 0 **********
I (2438) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentCurrent(0x0003), value: 0 [device_fanctrl_dcmotor.cpp:148]
I (2458) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x0000FFFC is 0 **********
I (2468) logger: [CSystem::matter_update_attribute] Try to update matter attribute (endpoint: 1, cluster: 0x0202, attribute: 0x0002, value: 0) [system.cpp:353]
I (2488) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2498) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentSetting(0x0002), value: 0 [device_fanctrl_dcmotor.cpp:140]
I (2508) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000002 is 0 **********
I (2528) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000000 is 0 **********
I (2538) esp_matter_attribute: ********** R : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x0000FFFC is 0 **********
I (2548) logger: [CSystem::matter_update_attribute] Try to update matter attribute (endpoint: 1, cluster: 0x0202, attribute: 0x0003, value: 0) [system.cpp:353]
I (2558) esp_matter_attribute: ********** W : Endpoint 0x0001's Cluster 0x00000202's Attribute 0x00000003 is 0 **********
I (2578) logger: [CDeviceFanControlDCMotor::matter_on_change_attribute_value] cluster: FanControl(0x0202), attribute: PercentCurrent(0x0003), value: 0 [device_fanctrl_dcmotor.cpp:148]
I (2588) logger: [CSystem::initialize] System Initialized [system.cpp:100]
I (2598) logger: [CSystem::print_system_info] System Info [system.cpp:248]
I (2608) logger: ----- ESP32 -----
I (2608) logger: Project Name: yogyui-matter-esp32-dcmotor
I (2618) logger: App Version: 1.0.0.0
I (2618) logger: CPU Core(s): 2
I (2628) logger: Revision: 1.1
I (2628) logger: Flash Size: 4 MB (external)
I (2628) logger: Heap Free Size: 155040
I (2638) logger: ----- Network -----
I (2638) logger: IPv4 Address: 0.0.0.0
I (2648) logger: Gateway: 0.0.0.0
I (2648) logger: MAC Address: D8:BC:38:40:97:B0
I (2658) logger: ----- Matter -----
I (2658) logger: Vendor ID: 0xFFF2
I (2668) logger: Product ID: 0x8001
I (2668) logger: Setup Discriminator: 3841
I (2668) main_task: Returned from app_main()
I'm glad that problem is solved easily, but it's worth debugging why this happened.
@lboue That's very interesting (and also embarrassing...) when I had flashed firmware with no change (GPIO
16
as PWM output), there was no problem like belowI'm glad that problem is solved easily, but it's worth debugging why this happened.
Which board type did you flash? I tried with 2 ESP32-PICO boards:
I didn't find GPIO16 in ESP32-PICO schematic.
@lboue I used ESP32-WROOM32E-32D with download kit. GPIO pin number should be modified following hardware limitation :)
Boot loop with Matter Fan Control Example
Hello,
I am facing a bootlop with the Matter Fan Control Example from this repo.
Build an flash
Boot log
system.cpp#L88
Full log
boot_esp32_fan_dac.log