"Cargo run" command using a standard template fails to compile

gavin@gavin-ubuntu:~/gavin-rust-1$ cargo run
   Compiling esp-idf-sys v0.34.1
   Compiling esp-idf-hal v0.43.1
   Compiling esp-idf-svc v0.48.1
error[E0425]: cannot find value `WIFI_FEATURE_CAPS` in this scope
   --> /home/gavin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.48.1/src/wifi.rs:546:27
    |
546 |             feature_caps: WIFI_FEATURE_CAPS as _,
    |                           ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `wifi_event_home_channel_change_t` in this scope
    --> /home/gavin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.48.1/src/wifi.rs:2002:66
     |
2002 | ...onst wifi_event_home_channel_change_t)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0412, E0425.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `esp-idf-svc` (lib) due to 2 previous errors

I created the project and this is the first time I have compiled a program. It appears to be a problem with the Wifi.rs and esp-idf-svc files have a problem locating the WIFI_FEATURE_CAPS

It appears that there is a version issue. How do I go about solving this problem?

What template did you use?

1 Like

I will check it out. I need to check in the tutorial.

I started with cargo generate esp-rs/esp-idf-template

Which version of esp-idf did you install? And did you make sure to select the right version when cargo generate asked you?

I am not sure which version I originally installed. How do I check the version? I ran a "cargo check" in the project directory and it compiles everything and then crashes esp-idf-svc file.

Can I redo the project from scratch and see what happens (cargo generate)

I have posted this as a software bug on https://github.com/esp-rs/esp-idf-svc/issues

Your link isn't working. Here a working link to the issue you opened:

Thanks I will update it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.