Nextion display for a hotspot: wiring and firmware

Category: HotspotsDifficulty: ★★★~9 min

A 0.96" OLED screen shows the callsign and status — and that's already useful. But the Nextion — a smart colour TFT with a touch panel and its own processor — displays it all at once: the caller's callsign and DMR ID, the talkgroup name, BER, RSSI, the time of the last QSO, and a clock when idle. The screen runs autonomously: the host sends it short commands over UART, and the Nextion renders all the graphics itself. On a hotspot running the RadioStar image, Pi-Star or WPSD this works out of the box — you only need to wire and configure it correctly.

What a Nextion is and how it differs from an OLED

An OLED (typically 128×64, I²C) is a passive display: the host draws every pixel itself, constantly refreshing the buffer. A Nextion is a smart TFT: inside is an ARM controller with flash memory that holds the interface (images, fonts, widgets). The host (Raspberry Pi / MMDVMHost) sends short text commands like t0.txt="R3ABC" over UART, and the Nextion updates the relevant field by itself. This lowers the load on the Pi and gives smooth, flicker-free animation.

The interface is flashed into the Nextion with a .tft file (a compiled project from the Nextion Editor). That is exactly why "flashing the display" and "flashing the host" are two different operations.

Choosing a model: size and series

Three diagonal sizes are the most common for MMDVM hotspots:

By series: Basic (T) — for example, NX4024T032 — is enough for a hotspot. Enhanced (K) costs more but adds an RTC, more flash and a faster UART. For an amateur node there is practically no difference.

Tip When buying a Nextion from a marketplace, check the markings on the board against the description — clones are sometimes flashed as a different model. If the display reports a different model during flashing, flash exactly the .tft it names.

Wiring: UART and power

The Nextion talks to the host over a serial UART interface: four wires — power (+5V and GND) and data (TX, RX). The standard colour coding of the display's cable:

Important: TX and RX cross over — the output of one device goes to the input of the other. A mistake here is the single most common cause of "the display doesn't respond".

Matching 5V and 3.3V levels

The Raspberry Pi works with 3.3V logic. Most Basic-series Nextions actually output 3.3V on the TX line, which is directly compatible with the Pi. However, the screen's power must be 5V: the 3.3V GPIO pin cannot drive the backlight, so you need a 5V pin (pin 2 or 4 on the Raspberry Pi GPIO header).

Important Do not feed 5V into a Raspberry Pi GPIO input (the Pi RX line). If your Nextion outputs a real 5V on TX (Enhanced series or a non-standard clone), use a voltage divider (two resistors) or a level shifter. Feeding 5V into a 3.3V Pi input will destroy the processor.

If the display connects not directly to the Pi GPIO but to an MMDVM hat (HS_Hat, Nano_Hat and similar), check the hat's documentation — some boards have a built-in Nextion connector with levels already matched and 5V power. In that case you simply plug in the supplied cable.

Connecting via a USB-UART adapter

If the Pi's hardware UART is occupied by a DVMega modem or another device, use a USB-UART adapter (CH341, CP2102). The Nextion connects to the adapter, the adapter into a Pi USB port. The system will detect it as /dev/ttyUSB0 (or ttyUSB1, ttyUSB2 — depending on the order of connection); check with:

dmesg | grep ttyUSB

Flashing the display with a .tft file

A Nextion is flashed in two ways: via a microSD card (simpler and more reliable) or over UART from the host (requires a Python script). microSD is recommended.

Method 1: microSD

  1. Format a blank microSD card as FAT32.
  2. Copy a single .tft file for your display model onto the card. Nothing else should be on the card.
  3. Insert the card into the Nextion slot (on the back of the board).
  4. Power up the display. The screen will detect the file automatically and begin flashing — a progress bar appears.
  5. Wait for the success message, power off, and remove the card.
Where to get a .tft Ready-made layouts for MMDVM are published by the community on GitHub (the WA6HXG/MMDVM-Nextion-Screen-Layouts repository). Download the archive, find the folder for your model, and take the .tft file of the layout you want. To edit a layout, use the Nextion Editor (free, Windows) and compile via File → Compile.

Method 2: over UART from the Pi command line

If a microSD isn't available, you can upload the firmware with a script:

sudo python3 nextion.py NX4024T032.tft /dev/ttyAMA0

The nextion.py script is in the same WA6HXG repository. Before running it, make sure MMDVMHost is stopped and the port is free.

Configuring Pi-Star

Go to Pi-Star → Configuration → MMDVM Configuration → Display. Set:

After saving, Pi-Star restarts MMDVMHost. If the display comes to life and shows "Idle" or a clock, everything is working.

If the screen stays blank First check the TX/RX crossover. Then check that the port is correct in the settings. Run pistar-mmdvmhostd restart over SSH and watch the log /var/log/pi-star/MMDVM-*.log for Nextion lines — an error will appear there if the port failed to open.

Configuring WPSD

WPSD has native Nextion support built in — no additional scripts are needed. Open Admin → Configuration → Display:

WPSD follows a rolling-release model; with each nightly update the Nextion driver is also updated automatically.

Configuring it in the RadioStar image (DMRhub)

The RadioStar image is based on the same foundation as Pi-Star. The Nextion configuration is edited in the /etc/mmdvmhost file manually over SSH or through the web interface of the panel. The relevant sections:

[General]
Display=Nextion

[Nextion]
Port=/dev/ttyUSB0
Brightness=50
DisplayClock=1
UTC=0
IdleBrightness=20

After editing, restart the service:

sudo systemctl restart mmdvmhost

The Brightness parameter is brightness as a percentage (0–100). IdleBrightness is the brightness when idle, useful for prolonging the life of the screen. DisplayClock=1 shows a clock when idle.

Build a hotspot with a Nextion today

On the "Build image" page you choose the board type, download a ready-made RadioStar image for the Raspberry Pi, and flash it in 10 minutes. The Nextion can be connected right away — the image supports it without any extra packages. And the DMRhub contact lists with the callsigns of network operators are downloaded from your account.

Sources

  1. The MMDVM-Nextion layouts repository with flashing and wiring instructions — github.com/WA6HXG
  2. Connecting a Nextion to MMDVMHost (Marrold's Blog, hands-on with USB-UART) — marrold.co.uk
  3. Nextion + MMDVM + Raspberry Pi tutorial (F5UII), UART parameters and config — f5uii.net
  4. Updating the Nextion firmware for Pi-Star (Ailunce Blog) — ailunce.com