Commit Graph

394 Commits

Author SHA1 Message Date
David Montero Crespo 9a954c3314 feat: Mark subproject commits as dirty in rp2040js and wokwi-elements 2026-04-12 00:37:33 -03:00
David Montero Crespo c736e6e789 feat: Add compiler flag for BitOrder restoration in Arduino CLI; mark subproject commits as dirty 2026-04-12 00:23:06 -03:00
David Montero Crespo e82ff3900f feat: Add installation of QEMU shared-library dependencies in backend E2E tests; mark subproject commits as dirty 2026-04-12 00:13:03 -03:00
David Montero Crespo d62d82b1a8 feat: Update Node.js version to 22 in backend E2E tests; mark subproject commits as dirty 2026-04-12 00:06:22 -03:00
David Montero Crespo 0078511d20 feat: Remove unused backend and frontend startup scripts; mark subproject commits as dirty 2026-04-11 23:56:44 -03:00
David Montero Crespo ce3c5f8cf5 feat: Increase timeout for backend E2E tests; add logging for backend startup and show logs on failure; mark subproject commits as dirty 2026-04-11 23:53:44 -03:00
David Montero Crespo d4a48e6e1e feat: Skip real paths test in CI; mark subproject commits as dirty 2026-04-11 15:49:32 -03:00
David Montero Crespo 830aa138ae feat: Update dependencies in requirements.txt; mark subproject commits as dirty and add pip installation log 2026-04-11 15:45:50 -03:00
David Montero Crespo 382e13cfe7 feat: Update components metadata timestamp and mark subproject commits as dirty; add diagnostic test for real library paths 2026-04-11 15:42:38 -03:00
David Montero Crespo 2ba8020438 feat: Enhance ESPIDFCompiler library resolution logic; add support for dynamic library detection and patching in CMakeLists.txt
refactor: Update wiring examples for E32 OLED integration; correct pin mappings for VCC, GND, DATA, and CLK
test: Improve unit tests for ESPIDFCompiler; add scenarios for library resolution and CMake patching
chore: Mark subproject commits as dirty for wokwi-libs
2026-04-11 15:25:40 -03:00
David Montero Crespo 6b161eab34 feat: Enhance CI workflows for backend unit and e2e tests; add environment setup and skip timing-sensitive tests in CI 2026-04-10 23:47:25 -03:00
David Montero Crespo 7971743174 Add unit tests for I2C slave devices, MCP tools, and WiFi/BLE status parser
- Implement tests for BMP280, DS1307, DS3231, I2CWriteSink, and MPU6050 slaves in test_i2c_slaves.py.
- Create test suite for Velxio MCP server tools in test_mcp_tools.py, covering Wokwi utilities and circuit management functions.
- Add tests for parsing WiFi and BLE serial output in test_wifi_status_parser.py, ensuring correct status events are captured.
2026-04-10 23:39:51 -03:00
David Montero Crespo d2e1e04def Add comprehensive documentation for ESP32 GPIO sensor simulation
This commit introduces a detailed markdown document outlining the process of simulating DHT22 and HC-SR04 sensors on the ESP32 platform using Velxio's QEMU fork. The documentation covers the context of the simulation, key callbacks, problems encountered, and solutions implemented for both sensors. It includes architectural details, end-to-end testing procedures, and guidelines for adding new GPIO-timed sensors. The aim is to provide maintainers with a thorough understanding of the GPIO logic and the challenges faced during development.
2026-04-10 22:51:56 -03:00
David Montero Crespo 44dcac1059 feat: Mark subproject commits as dirty for wokwi-libs; add documentation for ESP32 I2C slave simulation and debugging journey 2026-04-09 15:10:32 -03:00
David Montero Crespo 46e459f51b Refactor I2C slave tests for ESP32: update event handling and improve accuracy of ACK/NACK responses; add full end-to-end test for MPU-6050 I2C simulation; update components metadata timestamp; mark subproject commits as dirty for wokwi-libs. 2026-04-09 15:06:39 -03:00
David Montero Crespo 5795b1d506 Fix MPU6050Slave I2C handling and add comprehensive tests
- Updated the threshold for switching to data mode in MPU6050Slave from 2 to 3 WHO_AM_I reads to ensure correct chip identification.
- Enhanced comments in the code to clarify the sequence of I2C events during initialization.
- Added a new test file `test_mpu6050_emulation.py` to validate the MPU6050Slave state machine and ensure it handles the full Adafruit_MPU6050::begin() event sequence correctly.
- Updated existing tests to reflect the changes in the I2C handling logic.
- Modified `components-metadata.json` to update the generated timestamp.
- Marked submodules `rp2040js` and `wokwi-elements` as dirty to reflect local changes.
2026-04-09 02:04:41 -03:00
David Montero 75c4ead6de Merge remote-tracking branch 'origin/master' 2026-04-09 02:36:06 +02:00
David Montero 6c95013f24 fix: prevent save to /api/projects/none when project ID is invalid
Two bugs causing "can't save project" reports:

1. SaveProjectModal: validate currentProject.id is a real UUID before
   calling updateProject. If id is "none" or any non-UUID string, fall
   through to createProject instead, avoiding PUT /api/projects/none.

2. ProjectByIdPage: call clearCurrentProject() when the project fetch
   fails (404/403/error). Prevents stale project IDs from a previous
   session polluting the store and triggering spurious update calls.
2026-04-09 02:34:43 +02:00
David Montero Crespo 4667c8bb3b feat: Enhance MPU6050Slave I2C handling with improved WHO_AM_I read tracking; update tests for clarity 2026-04-08 08:48:14 -03:00
David Montero Crespo a76f7b51fd
Merge pull request #106 from davidmonterocrespo24/feature/micropython-rp2040
Feature/micropython rp2040
2026-04-08 00:11:59 -03:00
David Montero Crespo a64b14c94e Merge branch 'master' into feature/micropython-rp2040
# Conflicts:
#	.gitignore
#	frontend/src/components/editor/EditorToolbar.tsx
#	frontend/src/components/simulator/SerialMonitor.tsx
#	frontend/src/types/board.ts
2026-04-08 00:11:23 -03:00
David Montero Crespo d03ce7df24
Merge pull request #105 from davidmonterocrespo24/feature/shareable-urls
Feature/shareable urls
2026-04-08 00:06:44 -03:00
David Montero Crespo 71fa6eae4a Merge branch 'master' into feature/shareable-urls
# Conflicts:
#	.gitignore
2026-04-08 00:03:59 -03:00
David Montero Crespo ca6520e48d feat: Update I2C event handling and improve MPU-6050 slave emulation; enhance README and tests 2026-04-08 00:02:54 -03:00
David Montero Crespo 0f2c39f23b feat: Add I2C sensor support and implement ESP32 I2C slave emulation
- Introduced I2C_SENSOR_MAP for pre-registering I2C sensors in the simulator store.
- Implemented I2C slave state machines for MPU6050, BMP280, DS1307, and DS3231 sensors in esp32_i2c_slaves.py.
- Added unit tests for I2C slave functionality covering BMP280, DS1307, DS3231, and I2CWriteSink.
- Updated the simulator store to handle I2C address resolution and sensor data management.
- Marked submodules as dirty in wokwi-libs for rp2040js and wokwi-elements.
2026-04-08 00:02:43 -03:00
David Montero Crespo 689f8e71db feat: Add I2C slave emulation for MPU-6050 and BMP280 sensors
- Implemented _MPU6050Slave and _BMP280Slave classes for I2C communication.
- Enhanced main function to register these sensors and handle I2C events.
- Updated sensor management to support MPU-6050, BMP280, DS1307, DS3231, SSD1306, and PCF8574.
- Added frontend examples for BMP280 weather station and SSD1306 OLED display.
- Modified Esp32Bridge to handle new I2C transaction events.
- Updated ProtocolParts to support ESP32 path for I2C devices.
- Enhanced useSimulatorStore to manage I2C transaction listeners.
2026-04-07 15:43:09 -03:00
David Montero Crespo 9761aad0be feat: enhance Arduino library handling by detecting external libraries and creating IDF components, add tests for library resolution logic 2026-04-07 14:59:51 -03:00
David Montero Crespo d789a2c7e2 fix: update version to 2.0.1, enhance Discord release notification workflow, and mark subproject commits as dirty 2026-04-07 14:12:10 -03:00
David Montero Crespo 4b473ade6a feat: add Discord release merge notification workflow 2026-04-07 14:11:46 -03:00
David Montero Crespo f43c9d019d fix: update generatedAt timestamp, improve wire properties, and mark subproject commits as dirty 2026-04-07 13:27:54 -03:00
David Montero Crespo 9e117ee5c7 feat: enhance wire connection handling and GND checks for components 2026-04-07 13:08:15 -03:00
David Montero Crespo 4f3236437a feat: implement component metadata overrides and enhance property controls 2026-04-07 11:33:34 -03:00
David Montero Crespo e489a10255 fix: update generatedAt timestamp and clean up component metadata defaults
feat: enhance wire tracking in DynamicComponent for better event handling
chore: mark subproject commits as dirty for rp2040js and wokwi-elements
2026-04-07 11:19:48 -03:00
David Montero Crespo 0e366ee5dc Add comprehensive documentation for Velxio Docker infrastructure
- Created `docker-infrastructure.md` detailing the Docker build system, CI/CD pipelines, multi-architecture support, and deployment configuration.
- Included sections on architecture diagram, multi-stage Docker builds, QEMU ESP32 build pipeline, Docker publish CI/CD pipeline, entrypoint script, Nginx reverse proxy configuration, and Docker Compose setup.
- Provided a quick start guide and troubleshooting tips for common issues.
2026-04-07 10:49:05 -03:00
David Montero Crespo a3db014d2d feat: multi-arch Docker (amd64+arm64) and fix LED ground check
Docker multi-arch:
- Dockerfile downloads arch-specific QEMU .so via TARGETARCH
- docker-publish.yml adds setup-qemu-action and platforms: linux/amd64,linux/arm64
- qemu-lcgamboa submodule updated (matrix build for both architectures)

LED fix:
- LEDs now require cathode wired to GND (or LOW GPIO) to light up
- Previously LEDs turned on with anode HIGH regardless of cathode connection
- Updated tests to verify anode+cathode behavior
2026-04-07 03:58:52 -03:00
David Montero Crespo 97f8f6cd52 feat: add protocol selection and editable properties in component dialogs 2026-04-07 03:58:17 -03:00
David Montero 5e372f1418 docs: add wiki — ESP32/C3 WiFi emulation investigation and fixes
Detailed document covering the full debugging process and three root
causes fixed to make WiFi association work in QEMU emulation:
  1. channel=0 in wifi_pkt_rx_ctrl_t
  2. wrong AP lookup due to beacon timer race
  3. DMA ring resetting to 0 after firmware clears next pointers
2026-04-07 04:36:06 +02:00
David Montero Crespo c697aa261d
Merge pull request #102 from davidmonterocrespo24/feature/load-precompiled-firmware
Feature/load precompiled firmware
2026-04-06 23:04:01 -03:00
David Montero ef299ba7fa fix: align ESP32 WiFi SSID/channel with QEMU access_points[] array
Two fixes for ESP32 WiFi not connecting in production:

1. espidf_compiler.py: Change WiFi normalization from 'Velxio-GUEST' on
   channel 6 to 'Espressif' on channel 5. The lcgamboa QEMU binary
   downloaded from GitHub Releases only contains the original three APs:
   PICSimLabWifi (ch1), Espressif (ch5), MasseyWifi (ch10). Channel 6
   had no matching AP, so the beacon timer's channel-match condition never
   fired → firmware scanned forever and never connected.

2. esp32_worker.py: Redirect fd 1 to /dev/null before loading QEMU so
   raw UART bytes from QEMU's -nographic mux don't corrupt the JSON
   event pipe. The real pipe fd is saved and sys.stdout is rebound so
   _emit() continues to work. This also prevents stdout pipe back-pressure
   from stalling qemu_main_loop() (and thus REALTIME timers).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 06:11:29 +02:00
David Montero 2a386f99b0 fix: SaveProjectModal uses active board files/kind and better error messages
Two bugs fixed:
1. SaveProjectModal was reading from the legacy global `files` array instead
   of the active board's file group, causing projects to be saved with the
   wrong board_type (e.g. 'arduino-uno' for ESP32 projects).
   Now reads from fileGroups[activeBoard.activeFileGroupId] and uses
   activeBoard.boardKind for board_type.

2. Error handling was always showing "Save failed." — now shows:
   - "Server unreachable. Check your connection and try again." for network errors
   - "Not authenticated. Please log in and try again." for 401 responses
   - The server's detail message (with status code) for other errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 22:27:17 +02:00
David Montero 32acf80e0d fix: propagate has_wifi from compiler to startBoard for reliable WiFi detection
Frontend WiFi detection via file-content scanning was unreliable because
fileGroups[board.activeFileGroupId] could be an empty array (not null),
bypassing the ?? fallback to editorState.files.

Fix: the ESP-IDF compiler now returns has_wifi:bool in its compile response.
The frontend stores this on the BoardInstance and uses it in startBoard()
instead of scanning file contents. The file-content scan is kept as a
fallback for boards that haven't been compiled in this session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 22:14:40 +02:00
David Montero 7c755ca3d1 fix: use board's file group for WiFi auto-detection instead of legacy global files
startBoard() was reading useEditorStore.getState().files (the legacy global
array with the default Arduino sketch) instead of the board's specific file
group. This caused hasWifi to always be false for ESP32 boards, so QEMU
never received the -nic flag and WiFi never connected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 21:36:04 +02:00
David Montero 1298be72b2 fix: add RISC-V toolchain paths to build env for ESP32-C3 compilation
_build_env() on Linux only set IDF_TOOLS_PATH but never added the tool
binary directories to PATH, so cmake could not find riscv32-esp-elf-g++
when compiling for ESP32-C3. Also improve ninja failure logging to show
stdout (where build errors actually appear) instead of empty stderr.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 20:55:38 +02:00
David Montero Crespo 0d83b09dd9
Merge pull request #93 from davidmonterocrespo24/feature/vscode-extension
feat: enhance logging for library loading and WiFi progress; update s…
2026-04-05 00:50:00 -03:00
David Montero Crespo b0fe5b5d14 feat: enhance logging for library loading and WiFi progress; update subproject commits 2026-04-05 00:49:25 -03:00
David Montero Crespo 79865ab289
Merge pull request #92 from davidmonterocrespo24/feature/vscode-extension
feat: enhance ESP32 boot stability with deterministic instruction cou…
2026-04-05 00:17:42 -03:00
David Montero Crespo 7ccd5a7b63 feat: enhance ESP32 boot stability with deterministic instruction counting and mark subprojects as dirty 2026-04-05 00:16:40 -03:00
David Montero Crespo 669fbe7e5c
Merge pull request #91 from davidmonterocrespo24/feature/vscode-extension
Feature/vscode extension
2026-04-04 23:32:28 -03:00
David Montero Crespo 4d87ea9bb9 feat: add ARDUINO_ESP32_PATH to docker-compose and mark subprojects as dirty 2026-04-04 23:32:09 -03:00
David Montero Crespo 826c207970 feat: update workflows for ESP-IDF toolchain and Docker image publishing 2026-04-04 23:28:06 -03:00