Skip to content

feat: run cloud shell commands on the ESP32-C6 Modbus full image - #23

Merged
reubenmiller merged 1 commit into
mainfrom
feat/c6-cloud-shell
Nov 11, 2026
Merged

reubenmiller merged 1 commit into
mainfrom
feat/c6-cloud-shell

Conversation

@reubenmiller

Copy link
Copy Markdown
Contributor

The ESP32-C6 Modbus tedge-full image didn't offer c8y_Command. The shell-diagnostics extra that the S3 builds use costs 15.9 KB of RAM and 120 KB of flash on the C6, which puts the image at 82.4 % of its slot (budget 80 %).

What changes

  • release/extras/shell-lean.conf: goes after shell-diagnostics.conf and trims the shell to what a cloud command uses. It drops history, completion, VT100, the shell log backend, the device and log shells, stack painting, and the network and Wi-Fi shells. The shell thread gets 1.5 KB, and the output buffers are cut to 256 B, because a result is cut at about 220 bytes anyway.
  • tedge net (lib/common/net.c, CONFIG_APP_NET_SHELL_CMD, off by default): one short answer with Wi-Fi state, SSID, channel, RSSI, address/prefix, gateway, DNS server, and gateway ping count. It replaces net iface and wifi status, which print more than a result holds.
  • Allow-list on the C6: kernel uptime, kernel version, kernel heap, tedge net, tedge params list, tedge diag, tedge identify. kernel heap shows the kernel heap the Wi-Fi driver and the tunnel allocate from.
  • release/devices.yml: the C6 Modbus full build uses both extras and is now a pr: true build.
  • Docs: DEVICES.md has the measurements, and README.md and cumulocity/README.md list the C6 commands.

Cost (against 0.11.1)

Image Flash RAM (sram0) malloc arena
modbus tedge-full (0.11.1) 959,692 B 435,312 B 74,128 B
+ full shell extra 1,080,508 B (82.4 %) +15,928 B 63,280 B
+ lean shell extra (this PR) 966,203 B (73.7 %) +9,360 B 64,768 B

The largest single item is the command thread's 4 KB stack, tiny-edge's unmeasured default. The Wi-Fi driver allocates from the fixed kernel heap (about 55 KB), not the malloc arena the shell's RAM comes from. Other release builds are unchanged: the new option is off unless the lean extra sets it.

Testing

  • scripts/release/build.sh modbus-server-tedge-full-esp32c6-devkitc --write-baseline passes the size checks, and the baseline is updated for that build only.
  • scripts/release/matrix.py validates, and scripts/release/tests pass (43).
  • On the board (eu-latest, ESP32-C6): the test image 0.11.1-shelltest.1 (same configuration and code) installed over the air and confirmed, and the device lists c8y_Command.
  • Not yet done: running the commands from the Shell tab, a refused command, and a 30-minute run with a firmware download and a tunnel. That run is where the full extra failed on the C6 agent image in September. DEVICES.md notes it as pending.

🤖 Generated with Claude Code

The C6 Modbus tedge-full image had no c8y_Command: the shell-diagnostics
extra costs 16 KB of RAM and 120 KB of flash there, past the image's 80 %
flash budget. release/extras/shell-lean.conf goes after it and trims the
shell to what a cloud command uses (no history, completion, terminal
handling, log backend or network and Wi-Fi shells), with smaller output
buffers, since a result is cut at about 220 bytes anyway.

`tedge net` (CONFIG_APP_NET_SHELL_CMD) replaces `net iface` and `wifi
status` with one short answer: Wi-Fi state, SSID, channel, RSSI, address,
gateway, DNS server and gateway pings. `kernel heap` joins the C6
allow-list to show the kernel heap the Wi-Fi driver uses.

Cost against 0.11.1: +9,360 B RAM (malloc arena 74 KB -> 65 KB), +6.5 KB
flash (73.7 % of the slot). Other builds are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reubenmiller
reubenmiller merged commit c048d81 into main Nov 11, 2026
20 checks passed
@reubenmiller
reubenmiller deleted the feat/c6-cloud-shell branch November 11, 2026 01:53
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