Commit Graph
26 Commits
Author SHA1 Message Date
mangavalkandClaude Opus 5.5 7bb102676b Notes: idea of custom firmware on the display, and the bricking risk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:51:04 +01:00
mangavalkandClaude Opus 5.5 85422a1ef4 tft: firmware files from a local firmware/ folder, checked by SHA-256
Nextion's seven firmware files cannot be in the repo, so the repo now
ships their SHA-256 hashes (src/nxhmi/firmware.sha256, Editor
1.68.2.3035) and every build checks the files against them. The files
live in the git-ignored firmware/ folder; `nxhmi firmware --from
<Editor folder>` copies them, `nxhmi firmware` reports ok / missing /
wrong hash. build-tft and the MCP tool take --firmware-dir /
firmware_dir (also NXHMI_FIRMWARE_DIR) instead of the Editor folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:47:16 +01:00
mangavalkandClaude Fable 5.2 0287cf21e4 tft: picture, crop, progress bar, checkbox, radio; page RAM header fix; README sub-goals
- five more Basic types in tft_types (default variants; others refused)
- the page RAM image starts with 4 x FF + one FF per component (padded to 4)
- README: .tft status split into sub-goals with a stated basis each
- sample generator: display direction and gradient pictures; regression test
  walks sub-folders (84 Editor samples reproduced)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 23:31:12 +01:00
mangavalkandClaude Fable 5.2 a8622e7462 tft: generic type engine (tft_types), number and button; notes on the Editor inspection
Record slots follow the Editor's visible attribute list; generated scripts are
templates compiled by the normal script compiler. Number (all backgrounds and
border styles) and button (solid background, all five styles) are byte-identical.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 19:16:21 +01:00
mangavalkandClaude Fable 5.2 b5eaa68298 tft: text (plain) and touch cap; 55 Editor samples reproduced byte for byte
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 18:29:12 +01:00
mangavalkandClaude Fable 5.2 0532a59120 tft: MCP tool build_tft, skill note, sample generator, notes for the next types
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 18:25:18 +01:00
mangavalkandClaude Fable 5.2 99a5240af0 tft: script tokens, global variables, timers, control flow
build-tft now reproduces 35 Editor-made samples byte for byte: assignments,
arithmetic, 27 commands, system variables and colours, attribute references,
Program.s globals, all page/hotspot/timer events, if/else/while/for.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 18:23:14 +01:00
mangavalkandClaude Fable 5.2 f66c902443 tft: page section format, pictures/fonts, first builder (nxhmi build-tft)
Byte-identical to Nextion Editor 1.68.2 for NX4832T035 projects made of pages,
hotspots and int variables with any pictures and fonts. Firmware files are read
from the user's Editor folder at build time. FORMAT.md section 7 documents the
header, resource area, code blob, attribute records, page table and objects.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 18:13:11 +01:00
mangavalkandClaude Fable 5.2 7337e693a5 tft: all four checksums solved (three header CRCs, trailer for any length)
0x44 = CRC of the resource area, 0xC4 = CRC of header [0,0xC4), 0x18C = CRC of
[0xC8,0x18C); trailer = CRC of the whole file ^ (len & 0xFF) ^ 0x56. tft.seal()
recomputes all of them. Verified against 24 Editor-made files of 8 lengths.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 16:54:59 +01:00
mangavalkandClaude Opus 5.5 6b2835334a Docs: Edge supports the JPEG picture variant (verified)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:36:40 +01:00
mangavalkandClaude Opus 5.5 ec35ceb615 All five display series; exact component colours; Editor's literal rule for format 4
- 15 more models (Discovery, Enhanced, Edge, NX8048P043): ids and series bytes 1/6/100 from the
  Editor; native orientation per series; Discovery/Enhanced/Edge use the Basic templates
- per series picture format and storage direction: Enhanced like Basic, Edge format 4,
  Discovery format 3 (20 zero bytes + raw RGB565) always stored row by row; fonts likewise
- component colours are scaled (v*255//31) on every series -- exact against the canvas with zero
  tolerance; format-0 pictures stay bit-replicated
- format-4 encoder: literal pixels when the next 8 runs cover <= 10 pixels (7+ runs), 8 pixels at
  a time -- reproduces the Editor on 12 designed patterns plus the 28 earlier samples

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:35:50 +01:00
mangavalkandClaude Opus 5.5 922ca21f0f Switch knob: scanline model from 42 measured sizes
Integer radius (h-1)//2 with fixed sub-pixel offsets, 4 sub-rows x 1/8 px spans, 1/32 coverage
in linear light; closer to the simulator than the previous distance model on the knob test page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:52:40 +01:00
mangavalkandClaude Opus 5.5 0138a0ba56 Multi-byte fonts: GB2312, Big5, Shift-JIS, KS C 5601, UTF-8
Font Creator output decoded (lead/trail ranges and gaps in the header, map codes = bytes as
little-endian u16 or Unicode code points) and round-tripped byte for byte; from_ttf(chars=)
builds them; the renderer splits text like the simulator (any byte >= 0x81 starts a pair,
missing characters advance one space) -- pixel-exact for all five encodings.
Intelligent glyph data is 8-byte aligned (was 4). CLI add-font --chars/--chars-file, MCP chars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:42:50 +01:00
mangavalkandClaude Opus 5.5 c102157ac2 Pictures with compressed quality < 100 (JPEG variant of format 4)
Header byte 1 = quality; data type 0 = baseline JPEG of the picture padded with black to
multiples of 16 and then rotated for the display direction (libjpeg/Pillow, 4:2:0, 96 dpi),
byte-identical to the Editor for opaque pictures (18/18); alpha runs cover the padded picture.
add_picture(quality=), CLI add-picture -q, MCP add_picture quality; decoder in to_image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:22:25 +01:00
mangavalkandClaude Opus 5.5 55c2f9d6b6 Fonts: anti-aliasing flag, overhanging glyphs, Font Creator byte 18
The Font Creator's anti-aliased fonts are 1-bit glyphs with header flag 0x1E (the simulator draws
them with two colours). Map bytes 3/4 are extra columns left/right of the advance width; glyphs
are drawn starting 'left' px early. Editor-generated fonts now round-trip byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:42:03 +01:00
mangavalkandClaude Opus 5.5 6616b47cb4 Readable value names for all Intelligent types; TextSelect lines follow dis
Value lists read from the Editor's attribute notes with an Intelligent model: drag, load effect
(page has two more), transparency background, switch direction, ComboBox arrow/expansion,
TextSelect lines, scroll bars, DataRecord options, media source/state/looping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:34:11 +01:00
mangavalkandClaude Opus 5.5 49fee337d7 Render Intelligent-only components; fonts follow the display direction
- SLText, TextSelect, DataRecord, FileBrowser pixel-exact against the Intelligent simulator;
  ComboBox and Switch with approximate anti-aliased edges; media/file components draw nothing
- fonts: header byte 3 = 0x0A + direction, glyphs in the direction's pixel order, Intelligent
  glyph data 4-byte aligned -- reproduces the Editor's own font conversion byte for byte
- Intelligent 3D frames: left edge drawn over the bottom edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:26:27 +01:00
mangavalkandClaude Opus 5.5 56062e1a3e Intelligent colour expansion and alpha blending, measured in the simulator
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:56:58 +01:00
mangavalkandClaude Opus 5.5 193bcd5d97 Intelligent pictures (format 4) and direction-aware picture order
Format 4 decoded from Editor output: control words of eight 4-bit ops
(runs up to 13, 12-bit long runs, literal blocks) over 8 colour slots,
plus a run-length 7-bit alpha section. The encoder reproduces all 28
Editor samples byte for byte and the Editor keeps our pictures as is.

Pictures are stored rotated by the display direction, byte 0 of N.i is
0x0A + direction; this applies to format 0 too. add_picture now writes
the right format and order for the project; the renderer decodes format
4 and blends alpha.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:49:01 +01:00
mangavalkandClaude Opus 5.5 a93cb58b96 Display direction and character encoding in main.HMI
Byte 12 is the display direction (90-degree steps) and byte 13 the
character encoding -- the docs had them swapped. Basic panels are
portrait at 0 degrees, Intelligent ones landscape, so new Intelligent
projects used to open in portrait. new_project takes portrait= and
encoding=; all 24 Editor encodings are mapped; parse_main reports both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:36:10 +01:00
mangavalkandClaude Opus 5.5 842591a14c Render QR codes pixel-exact with an own encoder
nxhmi.qr is a dependency-free QR encoder. Measured in the Editor
simulator: numeric/alphanumeric/byte mode by content, level L, mask 0,
smallest version; scaled to w - 2*dis by width (not clipped to h), last
column run one pixel narrower, logo centred, nothing when too small.
Basic rendering is now 20/20 pixel-exact.

Also: unknown component kinds give a clean CLI error instead of a
traceback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:17:23 +01:00
mangavalkandClaude Opus 5.5 f0bcc608b1 Render gauge needles pixel-exact
The needle is the display's own routine, measured on 112 needles in the
Editor simulator: tip from quadrant-reduced sin/cos, truncated; line from
tip to centre with a biased DDA; wider needles stamp wid x wid squares
along a line shortened by wid - 1. Length follows the height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:05:41 +01:00
mangavalkandClaude Opus 5.5 9b50eea03f Radio rendering pixel-exact: the display's circle routine
Harvested the cir/cirs output for every radius 1..159 from Nextion
Editor's simulator and derived the incremental midpoint rule that
reproduces all of them; radio = width-sized circle clipped to the box,
dot radius r//2. Basic rendering coverage 18/20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:53:13 +01:00
mangavalkandClaude Opus 5.5 b9d7410716 README: coverage percentages with stated basis; counting rules in COVERAGE.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:20:59 +01:00
mangavalkandClaude Opus 5.5 82ab4177d1 Document the tested Nextion Editor version (1.68.2.3035)
TESTED_EDITOR_VERSION constant, README compatibility section with the
check to run after an Editor update, CLAUDE.md rules for other builds,
canary test on the fixture's version marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:20:27 +01:00
mangavalkandClaude Opus 5.5 69e22cfb06 openhmi-nx: decode, encode, render Nextion HMI projects; .tft research
Black-box reverse-engineered .HMI format (container, three checksums,
pages, all 31 component types, pictures, fonts), readable JSON, page
renderer matching Nextion Editor, demo project built from code and a
test suite (66 tests). See docs/COVERAGE.md for status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:11:02 +01:00