Open TimmyRB opened 5 months ago
I also have this issue. Followed the guide to the dot and unable to connect but ESP Launch Pad works flawlessly.
I got stuck at this point as well. I noticed in the WWDC video that they had pre-connected to Matter. This makes me wonder if this is a known issue.
I was wondering if this perhaps could be due to there not being a Threads Border router in the network?
I have a thread border router on my network and I still have this issue.
I got stuck at this point as well. I noticed in the WWDC video that they had pre-connected to Matter. This makes me wonder if this is a known issue.
I put together the tutorial while following the exact steps listed in it. The setup I used was an Airport Express (2012), a HomePod (2018) both updated to the latest firmware and an iPhone running the latest version of iOS 17 at the time. All devices were setup from scratch.
Note: I did end up using idf.py erase-flash
at least once to restart the paring process from scratch.
The original post in this thread does include a crash in the log which is definitely interesting and not something I encountered.
0x4200af3a: $s10__idf_main6MatterO4NodeC12eventHandler4type8endpoint7cluster9attribute5valueyAA0C14AttributeEventO_AA8EndpointVAA7ClusterVs6UInt32VSpySo21esp_matter_attr_val_taGSgtF at ??:?
0x4200b3be: $s10__idf_main8RootNodeV9attribute8identifyACSgyAA20MatterAttributeEventO_AA8EndpointVAA7ClusterVs6UInt32VSpySo21esp_matter_attr_val_taGSgtc_ySo0m1_N0O14identificationO13callback_typeV_s6UInt16Vs5UInt8VA0_tctcfcs5Int32VAtDOAWV_Az2nRSvSgtcfU_ at ??:?
Hopefully I or someone else can try to find time next week to reproduce this crash and see if it the root issue.
Same problem with same logs here...
I have got the same problem but it seems that the issue is with Swifts automatic resource management.
When running the example, I noticed the message app_main() finished
.
From the Backtrace i suspect the error to be in this code snippet
struct RootNode {
init?(attribute: @escaping AttributeCallback, identify: @escaping identifyCallback) {
[...]
let context = Context(attribute: attribute, identify: identify)
withUnsafeMutablePointer(to: &nodeConfig.root_node)
// Transfer ownership to the node. This is a leak for now, but we don't expect nodes to be created and destroyed repeatedly.
_ = esp_matter.endpoint.root_node.create(node, $0, 0x00, Unmanaged.passRetained(context).toOpaque())
}
[...]
}
}
(Disclaimer: I don't know anything about this kind of debugging, this is just an uneducated guess based on the readable words in the trace)
Because the example finished app_main()
without errors, this code is not outright flawed but probably more subtile.
If app_main()
finishes, all local variables declared would get wiped, including the app
and led
-objects. Passing references to these objects (or parts of it) back to the idf-matter library would result in chaos. And indeed, in the Matter-wrapper-code the cleanup is prevented by throwing Unmanaged.passRetained()
at everything and a healthy memory leak but it'll be fine
-comment.
To get around Swifts Resource Management I just appended a while true { sleep(1) }
to the app_main()
. After that, i was able to see the glory that is Matter Accessory Connection in HomeKit and finally a working Matter Device from Embedded Swift 😱.
Hope that helps someone.
@anders0nmat makeshift solution is working for me
I can also confirm that @anders0nmat's infinite loop solution works on my end.
@anders0nmat great digging, are you interested in putting a pr for this workaround while we find a better solution?
Note: I think we should keep these crash-related issues open until a real solution is found.
ESP-IDF: v5.2.1 ESP-Matter: v1.2 Swift Toolchain: org.swift.59202406131a Swift Version: 6.0-dev (LLVM 57177aa1b91540b, Swift 8be62863326595c) Target: arm64-apple-macosx15.0
I setup my environment following the steps here
I then cloned the examples and followed the steps for the smart light example here
My ESP32C6 gets flashed and runs the example fine until I enter the setup code in the Home app then it encounters a Load Access Fault and restarts itself, the Home app then displays "Unable to Connect to Network" "Make sure the network can reach your accessory, reset the accessory and try adding to your home again"
Here is the output logs
Since the ESP32C6 only supports 2.4Ghz I have tried disabling both the 5Ghz and 6Ghz networks on my router but to no avail, I was however able to get it commissioned with Espressif's own matter light example even when the 5Ghz & 6Ghz networks were enabled.
Any help would be greatly appreciated!