diff --git a/.vscode/settings.json b/.vscode/settings.json index 748816bb..082b286d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,4 +12,8 @@ "rust-analyzer.linkedProjects": [ "examples/rpi-pico-w/Cargo.toml", ], + "rust-analyzer.server.extraEnv": { + "WIFI_NETWORK": "foo", + "WIFI_PASSWORD": "foo", + } } \ No newline at end of file diff --git a/README.md b/README.md index 8ee0c235..5d4347e9 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,7 @@ TODO: - `cargo install probe-run` - `cd examples/rpi-pico-w` -- Edit `src/main.rs` with your Wifi network's name and password. -- `cargo run --release` +- `WIFI_NETWORK=MyWifiNetwork WIFI_PASSWORD=MyWifiPassword cargo run --release` After a few seconds, you should see that DHCP picks up an IP address like this diff --git a/examples/rpi-pico-w/src/main.rs b/examples/rpi-pico-w/src/main.rs index 633c1b2b..3e966d21 100644 --- a/examples/rpi-pico-w/src/main.rs +++ b/examples/rpi-pico-w/src/main.rs @@ -71,8 +71,8 @@ async fn main(spawner: Spawner, p: Peripherals) { let net_device = control.init(clm).await; - //control.join_open("MikroTik-951589").await; - control.join_wpa2("DirbaioWifi", "HelloWorld").await; + //control.join_open(env!("WIFI_NETWORK")).await; + control.join_wpa2(env!("WIFI_NETWORK"), env!("WIFI_PASSWORD")).await; let config = embassy_net::ConfigStrategy::Dhcp; //let config = embassy_net::ConfigStrategy::Static(embassy_net::Config {