Skip to content

Commit

Permalink
feat: Remove web Wokwi simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Jan 10, 2025
1 parent c7325fa commit 46e9d0f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 160 deletions.
91 changes: 0 additions & 91 deletions .github/workflows/wokwi_projects.yml

This file was deleted.

22 changes: 15 additions & 7 deletions book/src/02_0_preparations.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ Anchor comments can be ignored, they are only used to introduce those parts of c
## Simulating Projects

Certain projects can be simulated with [Wokwi][wokwi]. Look for indications in the book to identify projects available for simulation. Simulation can be accomplished through two methods:
- Using wokwi.com: Conduct the build process and code editing directly through the browser.
- Using [Wokwi VS Code extension][wokwi-vscode]: Leverage VS Code to edit projects and perform builds. Utilize the Wokwi VS Code extension to simulate the resulting binaries.
- This approach requires some [installation][wokwi-installation]
- This approach assumes that the project is built in debug mode
- This approach allows [debugging the project][wokwi-debug]
Certain projects can be simulated, or at least partially simulated, with [Wokwi][wokwi]. Here is the list of projects that support Wokwi simulation:
- `intro/hello-world`
- `intro/http-client`
- `advanced/i2c-sensor-reading`
- `advanced/i2c-driver`
- `advanced/button-interrupt`

Before jumping into any simulation project, you need to [setup the extension][wokwi-installation]. To simulate one project:

1. Press F1, select `Wokwi: Select Config File`, and choose the `wokwi.toml` of the project you want to simulate.
1. Edit the corresponding `wokwi.toml` file to simulate the exercise or the solution project.
2. Build your project in `debug` mode.
3. Press F1 again and select `Wokwi: Start Simulator`.

You can also [debug the project][wokwi-debug].

[wokwi]: https://wokwi.com/
[wokwi-vscode]: https://docs.wokwi.com/vscode/getting-started
[wokwi-installation]: https://docs.wokwi.com/vscode/getting-started#installation
[wokwi-debug]: https://docs.wokwi.com/vscode/debugging

Expand Down
9 changes: 0 additions & 9 deletions book/src/02_4_hello_board.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ You can also monitor the device without flashing it with the following command:
espflash monitor
```

## Simulation

This project is available for simulation through two methods:
- [Wokwi project](https://wokwi.com/projects/360342886675214337?build-cache=disable)
- Wokwi VS Code extension:
1. Press F1, select `Wokwi: Select Config File`, and choose `intro/hardware-check/wokwi.toml`.
2. Build your project.
3. Press F1 again and select `Wokwi: Start Simulator`.

## Troubleshooting

### Build Errors
Expand Down
13 changes: 0 additions & 13 deletions book/src/03_3_2_http_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@ The status error can be returned with the [Anyhow](https://docs.rs/anyhow/latest

✅ Write a custom `Error` enum to represent these errors. Implement the `std::error::Error` trait for your error.


## Simulation

This project is available for simulation through two methods:
- Wokwi projects:
- [Exercise](https://wokwi.com/projects/360722140931768321?build-cache=disable)
- [Solution](https://wokwi.com/projects/333372159510446675?build-cache=disable)
- Wokwi files are also present in the project folder to simulate it with Wokwi VS Code extension:
1. Press F1, select `Wokwi: Select Config File` and choose `intro/http-client/wokwi.toml`
- Edit the `wokwi.toml` file to select between exercise and solution simulation
2. Build you project
3. Press F1 again and select `Wokwi: Start Simulator`

## Troubleshooting

- `missing WiFi name/password`: ensure that you've configured `cfg.toml` according to `cfg.toml.example` - a common problem is that the package name and config section name don't match.
Expand Down
14 changes: 0 additions & 14 deletions book/src/04_3_1_i2c.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,3 @@ GYRO: X: 0.00 Y: 0.00 Z: 0:00
TEMP: [local temperature] °C
HUM: [local humidity] %
```

## Simulation

This project is available for simulation through two methods:
- Wokwi projects
- [Exercise](https://wokwi.com/projects/360623713943950337?build-cache=disable)
- [Solution Part 2](https://wokwi.com/projects/360344742047853569?build-cache=disable)
- Wokwi files are also present in the project folder to simulate it with Wokwi VS Code extension:
1. Press F1, select `Wokwi: Select Config File` and choose `advanced/i2c-sensor-reading/wokwi.toml`
- Edit the `wokwi.toml` file to select between exercise and solutions simulation
2. Build you project
3. Press F1 again and select `Wokwi: Start Simulator`

When simulating this project, expect the following hardcoded values: `TEMP: 24.61 °C | HUM: 36.65 % | GYRO: X= 0.00 Y= 0.00 Z= 0.00`
13 changes: 0 additions & 13 deletions book/src/04_3_2_i2c.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,3 @@ Registers can have different meanings, in essence, they are **a location that ca
In this specific context, we are using an external device (since it is a sensor, even if it is on the same PCB). It is addressable by I2C, and we are reading and writing to its register addresses. The addresses each identify a unique location that contains some information. In this case, we want the address for the location that contains the current temperature, as read by the sensor.

You can find the register map of the ICM-42670 in [section 14](https://invensense.tdk.com/wp-content/uploads/2021/07/DS-000451-ICM-42670-P-v1.0.pdf) should you want to try to get other interesting data from this sensor.



## Simulation

This project is available for simulation through two methods:
- Wokwi projects
- [Exercise](https://wokwi.com/projects/360728357589094401?build-cache=disable)
- [Solution](https://wokwi.com/projects/333375074521317970?build-cache=disable)
- Wokwi files are also present in the project folder to simulate it with Wokwi VS Code extension:
1. Press F1, select `Wokwi: Select Config File` and choose `advanced/i2c-driver/wokwi.toml`
2. Build you project
3. Press F1 again and select `Wokwi: Start Simulator`
13 changes: 0 additions & 13 deletions book/src/04_4_1_interrupts.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,3 @@ cargo run --example solution
🔎 In this exercise we are using notifications, which only give the latest value, so if the interrupt is triggered
multiple times before the value of the notification is read, you will only be able to read the latest one. Queues,
on the other hand, allow receiving multiple values. See `esp_idf_hal::task::queue::Queue` for more details.

## Simulation

This project is available for simulation through two methods:
- Wokwi projects
- [Exercise](https://wokwi.com/projects/360623288920412161?build-cache=disable)
- [Solution](https://wokwi.com/projects/333374799393849940?build-cache=disable)
- The Solution project contains solution for [Random LED Color on pushinig a Button](./04_4_2_interrupts.md)
- Wokwi files are also present in the project folder to simulate it with Wokwi VS Code extension:
1. Press F1, select `Wokwi: Select Config File` and choose `advanced/button-interrupt/wokwi.toml`
- Edit the `wokwi.toml` file to select between exercise and solution simulation
2. Build you project
3. Press F1 again and select `Wokwi: Start Simulator`

0 comments on commit 46e9d0f

Please sign in to comment.