Awesome
Experimental demo using ESP32-wrover kit and Rust
The main goal of the demo is to display line directions and departure times of public transport vehicles in Brno.
What the project does:
- Establish WiFi connection
- Configure ILI9341 display, HTTP Client and SNTP Client
- parse data from website (web scraping)
- init RTC and display current time with parsed data
Hardware setup
HW: Wrover-kit
Used pins
ILI9341 | Wrover-kit |
---|---|
RST | GPIO18 |
CLK | GPIO19 |
D_C | GPIO21 |
CS | GPIO22 |
MOSI | GPIO23 |
MISO | GPIO25 |
HW: ESP32 with ILI9341 display
<img width="723" alt="wokwi" src="https://user-images.githubusercontent.com/43887390/170480059-b26ba8f8-fe7b-49c7-80c2-91c5f25cc8f3.png">Wokwi
Used pins
ILI9341 | ESP32-DevKitS-V1.1 | Cable color |
---|---|---|
GND | GND | black |
3.3V | 3.3V | red |
RST | GPIO4 | green |
CLK | GPIO18 | orange |
D_C | GPIO2 | purple |
CS | GPIO15 | blue |
MOSI | GPIO23 | yellow |
MISO | GPIO25 | cyan |
diagram.json
{
"version": 1,
"author": "Juraj Sadel",
"editor": "wokwi",
"parts": [
{
"type": "wokwi-esp32-devkit-v1",
"id": "esp",
"top": 0,
"left": 0.67,
"attrs": { "builder": "esp32-rust" }
},
{ "type": "wokwi-ili9341", "id": "lcd1", "top": -354.05, "left": 182.84, "attrs": {} }
],
"connections": [
[ "esp:TX0", "$serialMonitor:RX", "", [] ],
[ "esp:RX0", "$serialMonitor:TX", "", [] ],
[ "esp:D4", "lcd1:RST", "green", [ "h0" ] ],
[ "esp:3V3", "lcd1:VCC", "red", [ "v-1.02", "h132.77" ] ],
[ "esp:GND.1", "lcd1:GND", "black", [ "h141.9", "v-1.79" ] ],
[ "esp:D15", "lcd1:CS", "blue", [ "h0" ] ],
[ "esp:D2", "lcd1:D/C", "purple", [ "h0" ] ],
[ "esp:D18", "lcd1:SCK", "orange", [ "h0" ] ],
[ "esp:D25", "lcd1:MISO", "cyan", [ "h-26.13", "v-106.89", "h328.67" ] ],
[ "lcd1:MOSI", "esp:D23", "yellow", [ "v0" ] ],
[ "lcd1:LED", "esp:3V3", "pink", [ "v226.59", "h-190.8" ] ]
],
"serialMonitor": { "display": "terminal" }
}
Wokwi project link
https://wokwi.com/projects/332616143815574099
Devcontainers
The repository supports:
<!-- GIPOR LINK NEEDS TO BE UPDATED WHEN MERGED -->Build
-
Terminal approach:
./build.sh [debug | release]
If no argument is passed,
release
will be used as default -
UI approach:
The default build task is already set to build the project, and it can be used in VsCode and Gitpod:
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Build Task
command. Terminal
->Run Build Task
in the menu.- With
Ctrl-Shift-B
orCmd-Shift-B
. - From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Task
command and selectBuild
. - From UI: Press
Build
on the left side of the Status Bar.
- From the Command Palette (
Flash
Note When using GitHub Codespaces, we need to make the ports public, see instructions.
- Terminal approach:
-
Using custom
runner
in.cargo/config.toml
:cargo +esp run [--release]
-
Using
flash.sh
script:./flash.sh [debug | release]
If no argument is passed,
release
will be used as default
-
- UI approach:
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Task
command and selectBuild & Flash
. - From UI: Press
Build & Flash
on the left side of the Status Bar.
- From the Command Palette (
Wokwi Simulation
-
Terminal approach:
./run-wokwi.sh [debug | release]
If no argument is passed,
release
will be used as default -
UI approach:
The default test task is already set to build the project, and it can be used in VsCode and Gitpod:
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Test Task
command - With
Ctrl-Shift-,
orCmd-Shift-,
Note: This Shortcut is not available in Gitpod by default.
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Task
command and selectBuild & Run Wokwi
. - From UI: Press
Build & Run Wokwi
on the left side of the Status Bar.
- From the Command Palette (
Debuging with Wokwi
Wokwi offers debugging with GDB.
- Terminal approach:
$HOME/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb target/xtensa-esp32-espidf/release/brno-public-transport -ex "target remote localhost:9333"
- UI approach:
Debug using with VsCode or Gitpod is also possible:
- Run the Wokwi Simulation in
debug
profileNote that the simulation will pause if the browser tab is on the background
- Go to
Run and Debug
section of the IDE (Ctrl-Shift-D or Cmd-Shift-D
) - Start Debugging (
F5
) - Choose the proper user:
esp
when using VsCode or GitHub Codespacesgitpod
when using Gitpod
- Run the Wokwi Simulation in