Skip to content

Commit

Permalink
Document bench example
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Nov 1, 2023
1 parent c4da1d6 commit 9db53d3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions esp-wifi/examples/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const UPLOAD_DOWNLOAD_PORT: u16 = 4323;

#[entry]
fn main() -> ! {
// #[cfg(feature = "log")]
// esp_println::logger::init_logger(log::LevelFilter::Info);
#[cfg(feature = "log")]
esp_println::logger::init_logger(log::LevelFilter::Info);

let peripherals = Peripherals::take();

Expand Down
24 changes: 23 additions & 1 deletion examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,26 @@ cargo esp32c3 --release ...
- open http://192.168.2.1:8080/ in your browser
- on Android you might need to choose _Keep Accesspoint_ when it tells you the WiFi has no internet connection, Chrome might not want to load the URL - you can use a shell and try `curl` and `ping`

`cargo $CHIP --example embassy_access_point --release --features "async,embedded-svc,wifi,embassy-net"`
`cargo $CHIP --example embassy_access_point --release --features "async,embedded-svc,wifi,embassy-net"`

## Benchmarking

A prerequisite to running the benchmark examples is to run the benchmark server on your local machine. Simply run the following commands to do so.

```
cd extras/bench-server
cargo run --release
```

### bench

- Run a test of download, upload and download+upload in a blocking fashion.
- Ensure you have set the IP of your local machine in the `HOST_IP` env variable. E.g `HOST_IP="192.168.0.24"`

`cargo $CHIP --example bench --release --features "wifi"`

### embassy_bench

- Run a test of download, upload and download+upload in a async fashion.

`cargo $CHIP --example embassy_bench --release --features "wifi,embassy-net"`

0 comments on commit 9db53d3

Please sign in to comment.