Skip to main content

Nextion NX3224T028: Dashboard Template (Gate 107)

This page is a deterministic build sheet for creating a working Nextion HMI in Nextion Editor for the display NX3224T028 (2.8" 320×240 touch).

Target firmware/driver: sensor_nx3224t028_nextion_uart on Gate 107.

0) Assumptions

  • Display: NX3224T028 (touch)
  • UART baud: 9600
  • MCU: RAK3112 UART mapping: TX=GPIO9, RX=GPIO10
  • Note: RAK3112 does not expose GPIO15/GPIO16.

1) Project setup (Nextion Editor)

  • Create a new project
    • Device: NX3224T028
    • Resolution: 320×240
    • Baud: 9600

Required project settings (don’t skip)

Enable ID reporting so the firmware receives 0x65 touch events:

  • Send Component ID: ON
  • Return Page ID: ON
  • Prefer Release events (not Press) for all buttons

2) Pages

Create exactly two pages:

  • page0Dashboard (page id 0)
  • page1Config (page id 1)

Page preinitialize events (required)

Set these in Nextion Editor:

  • page0 Preinitialize:
    sendme
  • page1 Preinitialize:
    sendme

3) Component map (names + fixed IDs)

page0 (Dashboard)

NameTypeComponent IDNotes
bStartButton2Start streaming
bStopButton3Stop streaming
bCfgButton4Go to config page
tStatText6Status text
tLastText7Last parsed event / last touch
nTxNumber8TX counter
nRxNumber9RX counter
nPgNumber10Current page indicator
tErrText11Debug/error string (recommended)

page1 (Config)

NameTypeComponent IDNotes
bHomeButton5Return to dashboard

Why fixed IDs? It prevents drift and makes debugging repeatable across project edits.

4) Event behavior map (what each button does)

Use Release event handlers.

page0 events

  • bStart (id=2) release → board sets stream RUN
  • bStop (id=3) release → board sets stream STOP
  • bCfg (id=4) release → board sends page 1

page1 events

  • bHome (id=5) release → board sends page 0

Note: The firmware is the source of truth for navigation. The HMI should emit events; the board decides actions.

Set these once in the editor:

  • tStat.txt = "BOOT"
  • tLast.txt = "P- C- E-"
  • tErr.txt = "" (empty)
  • nTx.val = 0
  • nRx.val = 0
  • nPg.val = 0

6) Build + upload

  1. Compile in Nextion Editor.
  2. Upload generated .tft:
    • SD card, or
    • serial upload
  3. Reboot the display.

7) Firmware run + validation

cd firmware
source ~/esp/esp-idf/export.sh
idf.py -B build_nx3224t028_nextion -p /dev/cu.usbmodem11101 flash monitor

Expected indicators:

  • APP_MAIN: active_gate=107
  • NX3224: Nextion init ok ... map:start(p0,c2),stop(p0,c3),cfg(p0,c4),home(p1,c5)
  • sensor=nx3224t028_nextion ... touch_count:<n> ... last_touch_page:<n> ... last_touch_comp:<n> ...

Troubleshooting:

  • If touch_count never increments:
    • project settings likely not emitting 0x65 (Component/Page ID reporting not enabled), or
    • UART wiring/baud mismatch.
  • If last_code:0x1A appears repeatedly:
    • dashboard is missing one or more widgets (tStat, tLast, nTx, nRx, nPg, tErr), or
    • component names/IDs don’t match exactly.

Printable Nextion Editor Checklist (NX3224T028 / Gate 107)

Print this page (browser Print → “Save as PDF”) and use it as a shop-floor checklist.

A) Project

  • New project created
  • Device set to NX3224T028 (320×240)
  • Baud set to 9600
  • Settings: Send Component ID = ON
  • Settings: Return Page ID = ON

B) Pages

  • page0 exists, page id = 0
  • page1 exists, page id = 1
  • page0 Preinitialize contains sendme
  • page1 Preinitialize contains sendme

C) Components + IDs

page0

  • bStart Button id=2
  • bStop Button id=3
  • bCfg Button id=4
  • tStat Text id=6
  • tLast Text id=7
  • nTx Number id=8
  • nRx Number id=9
  • nPg Number id=10
  • tErr Text id=11

page1

  • bHome Button id=5

D) Defaults

  • tStat.txt = BOOT
  • tLast.txt = P- C- E-
  • tErr.txt = ""
  • nTx.val = 0
  • nRx.val = 0
  • nPg.val = 0

E) Build + flash

  • Compile OK (no editor errors)
  • .tft uploaded
  • Display rebooted

F) Firmware validation

  • Serial log shows active_gate=107
  • Touch events increment touch_count
  • last_touch_page + last_touch_comp match expectations