Skip to content

Add ONX3248G035 board support - #43

Open
weiweihaoyouwei wants to merge 2 commits into
MatixYo:mainfrom
OpenNextion:add-ONX3248G035-support
Open

Add ONX3248G035 board support#43
weiweihaoyouwei wants to merge 2 commits into
MatixYo:mainfrom
OpenNextion:add-ONX3248G035-support

Conversation

@weiweihaoyouwei

Copy link
Copy Markdown

Add support for OpenNextion ONX3248G035

Summary

This PR adds a first-pass board target for the OpenNextion ONX3248G035 ESP32-S3 display board while keeping the original Plane Radar UI behavior intact.

The ONX3248G035 has a 3.5 inch 320x480 ST7796U SPI display, so this implementation keeps the original 240x240 circular radar view and centers it on the rectangular panel. This avoids redesigning the radar UI in the initial board-support PR.

Because a full 320x480 16-bit frame sprite is too large for internal RAM on this target, the ONX3248G035 frame sprite is allocated in PSRAM to keep the existing double-buffered radar rendering path and avoid flicker.

Changes

  • Add a custom PlatformIO board definition for onx3248g035.
  • Add a PlatformIO environment for onx3248g035.
  • Add conditional display configuration for the ONX3248G035 ST7796U panel.
  • Add minimal ONX board initialization for I2C, PCF8574, LCD reset, SDCS release, and LCD backlight.
  • Keep the original circular radar UI centered in a 240x240 viewport on the 320x480 screen.
  • Allocate the 320x480 frame sprite in PSRAM to avoid internal-RAM allocation failure and radar flicker.
  • Keep the existing BOOT button behavior:
    • short press cycles the radar range
    • long press clears Wi-Fi/location/unit settings and reboots into setup

Build / Flash

This PR intentionally leaves the public README unchanged. If this board target is accepted, the maintainer can decide whether and how to expose it in the README.

Build the ONX3248G035 firmware with:

pio run -e onx3248g035

Flash it with:

pio run -e onx3248g035 -t upload --upload-port <PORT>

Create a merged image with:

pio run -e onx3248g035 -t merge

Hardware

Item Value
Board OpenNextion ONX3248G035
MCU ESP32-S3R8
Flash 16 MB
PSRAM 8 MB OPI PSRAM
Display 3.5 inch ST7796U SPI TFT
Resolution 320x480
Touch controller CST826, not used in this PR
I/O expander PCF8574 at 0x38
LCD reset PCF8574 EXIO6
LCD backlight GPIO6
LCD SCLK GPIO5
LCD MOSI GPIO1
LCD CS GPIO2
LCD DC GPIO3
BOOT button GPIO0

Validation

  • Builds with pio run -e onx3248g035
  • Flashes successfully on ONX3248G035 hardware
  • Radar screen opens and basic functionality works
  • LCD displays the centered radar UI correctly
  • Wi-Fi connection works with previously saved NVS credentials
  • Radar view displays and updates with ADS-B fetch logs
  • ADS-B fetch can return aircraft, for example adsb: 1 aircraft and adsb: 2 aircraft
  • Frame sprite allocation no longer fails after enabling PSRAM
  • Radar flicker resolved after moving the full-screen frame sprite to PSRAM
  • BOOT short press range cycling verified
  • BOOT long press Wi-Fi reset verified
  • Photo or screenshot attached
  • Serial boot log attached

Notes

  • This PR intentionally does not add a new rectangular-screen UI layout or bottom status bar.
  • This PR does not add touch input support yet.
  • This PR does not add SD card support yet.
  • The board exposes a CST826 touch controller, but the original project currently uses the BOOT button for range/reset input.
  • Saved Wi-Fi/location/range settings are stored in NVS and are intentionally preserved by normal app-only flashing.

Logs / Screenshots

Serial boot log:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0

Plane Radar
[  1671][E][Preferences.cpp:50] begin(): nvs_open failed: NOT_FOUND
[  1676][E][Preferences.cpp:50] begin(): nvs_open failed: NOT_FOUND
Connecting to WiFi (portal opens if needed)...
Connected: fangxiao_CH2_vpn  IP 192.168.1.234
LAN config: http://plane-radar.local or http://192.168.1.234
adsb: 5 aircraft

Radar screen photo:
main

Wi-Fi setup photo:
init

wifi_manager35 wifi_list35

BOOT short press range log:

adsb: 8 aircraft
Range: 5km (outer ~7 km)
adsb: 1 aircraft
Range: 10km (outer ~13 km)
Range: 15km (outer ~20 km)
adsb: 2 aircraft
Range: 25km (outer ~33 km)
adsb: 8 aircraft
Range: 5km (outer ~7 km)

BOOT long press reset log:

BOOT held — resetting WiFi
[129732][E][Preferences.cpp:96] remove(): nvs_erase_key fail: lat NOT_FOUND
[129739][E][Preferences.cpp:96] remove(): nvs_erase_key fail: lon NOT_FOUND
[129744][E][Preferences.cpp:96] remove(): nvs_erase_key fail: useMiles NOT_FOUND
[129750][E][Preferences.cpp:96] remove(): nvs_erase_key fail: showRwys NOT_FOUND
WiFi credentials, location, and units cleared
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x420bf07a
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0

Plane Radar
Opening WiFi setup portal (after reset)
Setup portal: http://plane-radar.local (or http://192.168.4.1)

@weiweihaoyouwei
weiweihaoyouwei force-pushed the add-ONX3248G035-support branch from f8ec933 to 3ae02c6 Compare July 3, 2026 10:26
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.

2 participants