Closed Zercerium closed 11 months ago
build.rs
file in the root of your binary crate, as generated by esp-idf-template
?export RUST_BACKTRACE=1
before running the build)I'm working on it, I think I got some deps wrong, will update as soon as I make progress.
Make sure to have a direct dependency on esp-idf-sys
and on embuild
in your binary crate - even if you don't use esp-idf-sys
directly.
ok finally, got it working thanks for your work
# didnt touched things above from the template in the Cargo.toml file
[dependencies]
log = { version = "0.4.17", default-features = false }
embassy-futures = "0.1" #use embassy
async-io = { version = "=1.12" } #use async-io
esp-idf-sys = { version = "0.33", optional = true, default-features = false, features = [
"native",
] }
esp-idf-hal = { version = "0.41", optional = true, features = [
"embassy-sync",
"critical-section",
] }
esp-idf-svc = { version = "0.46", optional = true, features = [
"embassy-time-driver",
] }
embedded-svc = { version = "0.25", optional = true }
rs-matter = { path = "../rs-matter/rs-matter", default-features = false, features = [
"esp-idf", # use needed features
] }
[target.'cfg(target_os = "espidf")'.dev-dependencies]
esp-idf-sys = { version = "0.33", default-features = false, features = [
"binstart",
] }
[build-dependencies]
embuild = "0.31.2"
# For compatibility with ESP IDF
[patch.crates-io] # Patch crates
polling = { git = "https://github.com/esp-rs-compat/polling" }
socket2 = { git = "https://github.com/esp-rs-compat/socket2" }
only use export WIFI_SSID=ssid;export WIFI_PASS=pass; cargo build
sadly I have an out of memory error
E (902) pthread: Failed to create task!
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 12, kind: OutOfMemory, message: "Not enough space" }', src/main.rs:51:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
--release
main
, by 10 - 20KOh and one more thing: since you've created a separate binary crate - put in your Cargo.toml
:
[profile.release]
opt-level = 3
[profile.dev]
debug = true
opt-level = 3
... and delete the existing ones. You really need opt-level = 3 for all the memory optimizations to kick-in. And by default, the esp-idf-template
uses z
and s
which are not good enough. The above would also allow you to stick to debug builds.
thanks a lot, changed opt-level and after some testing, set it to .stack_size(140 * 1024)
what worked now
but the search is going on 🙈
I (8259) rs_matter::transport::core: Comissioning started
I (8259) rs_matter::transport::core: Creating queue for 1 exchanges
I (8269) rs_matter::transport::core: Creating 8 handlers
I (8269) rs_matter::transport::core: Handlers size: 9992
I (8279) rs_matter::transport::core: Transport: waiting for incoming packets
I (8289) rs_matter::transport::udp::async_io: Listening on [::]:5353
I (8299) rs_matter::transport::udp::async_io: Joined IPV6 multicast ff02::fb/2
I (8299) rs_matter::transport::udp::async_io: Joined IP multicast 224.0.0.251/192.168.178.59
I (8319) rs_matter::mdns::builtin: Broadcasting mDNS entry to 224.0.0.251:5353
I (8329) rs_matter::mdns::builtin: Broadcasting mDNS entry to ff02::fb:5353
W (8329) rs_matter::transport::udp::async_io: Error on the network: Os { code: 118, kind: HostUnreachable, message: "Host is unreachable" }
Error: Error::Network
You are hitting #100. To workaround it, temporarily downgrade to esp idf v4.4.
After that, if you are using a Google Controller, you'll likely hit #102 as well, which we are analyzing right now.
Ok, thanks. I tried the onoff_light example on my Host and yeah with the chip-tool everything works fine, but with Alexa I also got an error.
@Zercerium Can you try if #107 fixes the provisioning issue for you? Note that provisioning might still generate an error at the end (device not found - that's an old issue because we don't properly implement true subscriptions) but the device should afterwards be nevertheless visible.
ofc I switched to your main and run the onoff_light example
The Alexa App says: "Something gone wrong, an unexpected error occurred, please try again later" (Translated)
following the log, say if u need more infos
OK the culprit is this one:
[2023-10-03T15:07:59Z ERROR rs_matter::secure_channel::case] Certificate Chain doesn't match: Invalid:
... which means it fails just before it can establish a valid CASE session, and this is very different from the problem I fixed in my branch
Can you open a new issue for this? Something like "Provisioning with Alexa/Echo Hub fails with Invalid Cert error during the Case3 step".
I still don't have an Echo device, but I'll order soon. Perhaps other folks can shed some light (@kedars?).
yeah, opened an issue for it. #109
cargo generate esp-rs/esp-idf-template cargo
export MCU=esp32; export CARGO_TARGET_XTENSA_ESP32_ESPIDF_LINKER=ldproxy; export RUSTFLAGS="-C default-linker-libraries"; export WIFI_SSID=ssid;export WIFI_PASS=pass; cargo build --no-default-features --target xtensa-esp32-espidf -Zbuild-std=std,panic_abort
expected: successful build outcome:
error: failed to run custom build command for rs-matter v0.1.1
Error: environment variable not found
quite not sure which env variable is not set