Get wifi credentials from envvars in example.
This commit is contained in:
parent
726d68a706
commit
92505f53e2
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -12,4 +12,8 @@
|
||||
"rust-analyzer.linkedProjects": [
|
||||
"examples/rpi-pico-w/Cargo.toml",
|
||||
],
|
||||
"rust-analyzer.server.extraEnv": {
|
||||
"WIFI_NETWORK": "foo",
|
||||
"WIFI_PASSWORD": "foo",
|
||||
}
|
||||
}
|
@ -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
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user