From 10140a35223de918327b0e85071c7d25d9e6912b Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Wed, 26 Jun 2024 11:14:05 +0200 Subject: [PATCH] build(server): :construction_worker: configure `platformIO` and `Wokwi` for testing sources --- server/.gitignore | 3 +++ server/diagram.json | 34 ++++++++++++++++++++++++++++++++++ server/platformio.ini | 15 +++++++++++++++ server/wokwi.toml | 9 +++++++++ 4 files changed, 61 insertions(+) create mode 100644 server/.gitignore create mode 100644 server/diagram.json create mode 100644 server/platformio.ini create mode 100644 server/wokwi.toml diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..72b7d79 --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,3 @@ +.pio +.vscode/launch.json +.vscode/c_cpp_properties.json \ No newline at end of file diff --git a/server/diagram.json b/server/diagram.json new file mode 100644 index 0000000..ccd8522 --- /dev/null +++ b/server/diagram.json @@ -0,0 +1,34 @@ +{ + "version": 1, + "author": "Uri Shaked", + "editor": "wokwi", + "parts": [ + { "type": "wokwi-esp32-devkit-v1", "id": "esp", "top": 0, "left": 0, "attrs": {} }, + { "type": "wokwi-resistor", "id": "r1", "top": 90.3, "left": -73.17, "attrs": {} }, + { "type": "wokwi-resistor", "id": "r2", "top": 101.63, "left": -63.17, "attrs": {} }, + { + "type": "wokwi-led", + "id": "led1", + "top": 50.3, + "left": -106.5, + "attrs": { "color": "blue" } + }, + { + "type": "wokwi-led", + "id": "led2", + "top": 68.96, + "left": -127.84, + "attrs": { "color": "green" } + } + ], + "connections": [ + [ "esp:TX0", "$serialMonitor:RX", "", [] ], + [ "esp:RX0", "$serialMonitor:TX", "", [] ], + [ "r1:1", "led1:A", "green", [ "v0.07", "h-10" ] ], + [ "r2:1", "led2:A", "green", [ "v0" ] ], + [ "esp:GND.2", "led2:C", "black", [ "h0" ] ], + [ "esp:GND.2", "led1:C", "black", [ "h0" ] ], + [ "esp:D26", "r1:2", "green", [ "h0" ] ], + [ "r2:2", "esp:D27", "green", [ "v0" ] ] + ] + } \ No newline at end of file diff --git a/server/platformio.ini b/server/platformio.ini new file mode 100644 index 0000000..e10a7f1 --- /dev/null +++ b/server/platformio.ini @@ -0,0 +1,15 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:esp32] +platform = espressif32 +framework = arduino +board = esp32dev +lib_deps = me-no-dev/ESP Async WebServer@^1.2.4 diff --git a/server/wokwi.toml b/server/wokwi.toml new file mode 100644 index 0000000..595b028 --- /dev/null +++ b/server/wokwi.toml @@ -0,0 +1,9 @@ +[wokwi] +version = 1 +elf = ".pio/build/esp32/firmware.elf" +firmware = ".pio/build/esp32/firmware.bin" + +# Forward http://localhost:8180 to port 80 on the simulated ESP32: +[[net.forward]] +from = "localhost:8180" +to = "target:80" \ No newline at end of file