Skip to content

raft new: hardware routes, connectivity, OTA, sensor sets; raft detect; saved answers - #5

Merged
robdobsn merged 1 commit into
mainfrom
feature/raft-new-questions
Oct 25, 2026
Merged

robdobsn merged 1 commit into
mainfrom
feature/raft-new-questions

Conversation

@robdobsn

Copy link
Copy Markdown
Owner

Implements devdocs/raft-new-questions-and-defaults-review.md. Needs robdobsn/RaftCore#30 and robdobsn/RaftSysMods#11 merged first: apps made by this raft new use raftcore:@common and RAFT_NO_NETWORKING, which their main must have.

Hardware (one question, four routes)

  • Detect: from a connected board, using esptool flash-id (v4 and v5 output). Also available on its own as raft detect (--json). Under WSL it uses Windows raft.exe detect, or the Windows esptool with an older raft.exe.
  • Dev board: a preset (src/new_data/boards.json) gives the chip, flash, PSRAM and I2C connector pins.
  • Module: by Espressif ordering code (src/new_data/modules.json). N8R2 gives 8 MB flash and 2 MB PSRAM; the family gives the PSRAM mode (octal for S3 R8) and reserved pins, which are refused for I2C.
  • Chip, or "I don't know": safe defaults (4 MB, no PSRAM). The summary says what was assumed.
  • PSRAM is written to sdkconfig.defaults again (the question had been commented out since 2024-11).

Other questions

  • Connectivity: WiFi+BLE / WiFi / BLE / none. Without WiFi, RAFT_NO_NETWORKING goes in features.cmake, and NetMan and WebServer are left out of SysTypes.json.
  • BLE role, web server.
  • OTA: the partition table follows from flash size and OTA, with app slots up to 3 MB and at least 512 KB of file system.
  • I2C and sensors: RaftCore's @common (the new default), @extended, all, none built in, or no I2C.
  • Runtime decoding: of sensors added later from a type file.
  • Advanced only (--advanced): SysType name, SysMod name, main task core, ESP-IDF version.
  • Old --set keys (use_raft_ble, flash_size_for_partition_table, …) are translated.

Also

  • A summary before generating: hardware, partitions, and an estimated app size from measured builds (×1.16 for RISC-V chips), with suggestions when there's little room.
  • AP password: a random WiFi AP password instead of raftpassword.
  • Saved answers: answers saved as .raftnew.json.
    • raft new --answers <file> reproduces an app.
    • raft update-project --set key=value re-renders: unedited files are updated, and edited ones get <file>.raftnew.

Testing

  • 144 tests: routes, modules, esptool parsing, layouts, estimates, connectivity, sets, PSRAM, reserved pins, saved answers, re-render, legacy keys.
  • raft detect on two real ESP32-S3 boards (WSL): 8 MB + 2 MB PSRAM, and 16 MB + 8 MB.
  • Interactive flow through a pseudo-terminal with detection: 12 prompts, summary, generated app.
  • Generated and built (local branches of the libraries): defaults; WROOM-1-N8R8 with no networking and no OTA; FeatherS3 BLE only; ESP32-C6 WiFi. Estimates were within about 1%, except the C6, which gave the RISC-V factor.

Not yet done

  • Flashing generated apps to boards.
  • Checking the board and module data marked "verify".

🤖 Generated with Claude Code

…, OTA, sensor sets, decoding; raft detect; saved answers

- Hardware: detected from a connected board (esptool flash-id; raft detect), a dev board preset, an Espressif module
  by ordering code (N<flash>R<PSRAM>, PSRAM mode and reserved pins), or the chip with safe defaults. PSRAM is set in
  sdkconfig again
- Questions: connectivity (WiFi+BLE / WiFi / BLE / none - RAFT_NO_NETWORKING without WiFi), BLE role, web server,
  OTA (one or two app slots), I2C and sensors (RaftCore's common / extended sets, all, none built in, no I2C),
  runtime decoding; SysType name, SysMod name, main task core and ESP-IDF version only with --advanced
- Partition table from the flash size and OTA; a random WiFi AP password; a summary with an estimated app size
- Answers saved in .raftnew.json: raft new --answers, and raft update-project --set to change an answer and update
  unedited files (edited ones get <file>.raftnew)
- Older --set keys are translated
- devdocs/raft-new-questions-and-defaults-review.md: the measurements, design and implementation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robdobsn
robdobsn merged commit 55cb75a into main Oct 25, 2026
6 checks passed
@robdobsn
robdobsn deleted the feature/raft-new-questions branch October 25, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant