Skip to content

system/vncviewer: add VNC viewer for LCD display#3463

Merged
cederom merged 1 commit intoapache:masterfrom
JianyuWang0623:vncviewer
Apr 24, 2026
Merged

system/vncviewer: add VNC viewer for LCD display#3463
cederom merged 1 commit intoapache:masterfrom
JianyuWang0623:vncviewer

Conversation

@JianyuWang0623
Copy link
Copy Markdown
Contributor

Summary

Add examples/vncviewer — a lightweight VNC viewer that renders a remote desktop on an LCD display via the NuttX LCD character device interface (/dev/lcd0).

  • RFB 3.8 protocol with VNC Authentication (pure software DES, no external library)
  • Auto-detect pixel format from LCD driver
  • Raw encoding with row-by-row rendering — minimal RAM usage
  • Automatic reconnection on disconnect
  • CLI: vncviewer [-p password] [-d lcd_devno] <host> [port]

Tested on ESP32-S3 (lckfb-szpi-esp32s3) with ST7789 320×240 SPI LCD over WiFi. Board-side defconfig will be submitted separately to nuttx repo.

Impact

New example application only. No impact on existing code.

Testing

  • Host: Ubuntu 22.04 x86_64, xtensa-esp-elf-gcc
  • Target: lckfb-szpi-esp32s3 (ESP32-S3-WROOM-1-N16R8), ST7789 320×240 LCD
  • VNC server: x11vnc on Ubuntu
  • vncviewer (Device): vncviewer -p mypasswd xxx.xxx.xxx.xxx 5901
  • vncviewer (Host): vncviewer localhost:5901 & # Enter password in the UI

Three server modes verified:

  1. Xvfb virtual desktop (:1, 320×240x16 + openbox + xterm) — pixel-perfect 1:1
# vncserver (Host)
Xvfb :1 -screen 0 320x240x16 &
DISPLAY=:1 openbox &
DISPLAY=:1 xterm -geometry 38x11+0+0 -fa Monospace -fs 10 -T bash -e 'bash --rcfile /tmp/vnc-bashrc' &
x11vnc -display :1 -rfbport 5901 -passwd mypasswd -shared -forever -xkb -add_keysyms -bg
Screenshot from 2026-04-23 22-26-23 20260423-223730
  1. Physical desktop clip (-clip 320x240+0+0) — top-left region, no scaling
# vncserver (Host)
x11vnc -display :0 -rfbport 5901 -passwd mypasswd -shared -forever -xkb -add_keysyms -bg -clip 320x240+0+0
20260423-223724
  1. Physical desktop scale (-scale 320x240) — full desktop scaled to LCD
# vncserver (Host)
x11vnc -display :0 -rfbport 5901 -passwd mypasswd -shared -forever -xkb -add_keysyms -bg -scale 320x240
20260423-223716

@cederom
Copy link
Copy Markdown
Contributor

cederom commented Apr 23, 2026

Wow! This is amazing big thank you @JianyuWang0623 :-)

I am wondering if this should go to apps/examples or better to apps/system ? :-)

@acassis
Copy link
Copy Markdown
Contributor

acassis commented Apr 23, 2026

@JianyuWang0623 WOW!!!

@JianyuWang0623
Copy link
Copy Markdown
Contributor Author

Wow! This is amazing big thank you @JianyuWang0623 :-)

I am wondering if this should go to apps/examples or better to apps/system ? :-)

Either way works for me. I'll go with whatever you all think is better. :-)

@cederom
Copy link
Copy Markdown
Contributor

cederom commented Apr 23, 2026

What do you think folks? I think this tool suits better to apps/system right? :-)

@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented Apr 23, 2026

Sorry @raiden00pl: Install NTFC is failing at git clone, could you retry if it fails? Then sync it to NuttX Repo and NuttX Apps Repo? (NuttX Apps is missing the pip install ntfc retry) Thanks :-) FYI @simbit18

https://github.com/apache/nuttx-apps/actions/runs/24843435684/job/72727760891#step:10:134

$ git clone -b release-0.0.1 https://github.com/szafonimateusz-mi/nuttx-testing
fatal: unable to access 'https://github.com/szafonimateusz-mi/nuttx-testing/': The requested URL returned error: 500

Add a minimal VNC viewer application that connects to a VNC server
and renders the remote desktop on a local LCD.

Features:
- RFB 3.8 protocol with VNC Authentication (DES, pure software)
- Raw encoding with pixel format auto-detected from LCD driver
- Row-by-row rendering via LCDDEVIO_PUTAREA (minimal RAM usage)
- LCD resolution and format queried at runtime via LCDDEVIO_GETVIDEOINFO
- Auto-reconnect on connection loss with 2-second retry

Usage:
  vncviewer <host> [port]
  vncviewer -p <password> <host> [port]
  vncviewer -p <password> -d <lcd_devno> <host> [port]

Assisted-by: GitHubCopilot:claude-4.6-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
@JianyuWang0623
Copy link
Copy Markdown
Contributor Author

What do you think folks? I think this tool suits better to apps/system right? :-)

@cederom Moved to apps/system.

@cederom cederom changed the title examples/vncviewer: add VNC viewer for LCD display system/vncviewer: add VNC viewer for LCD display Apr 24, 2026
@cederom
Copy link
Copy Markdown
Contributor

cederom commented Apr 24, 2026

What do you think folks? I think this tool suits better to apps/system right? :-)

@cederom Moved to apps/system.

TANK U SIR @JianyuWang0623 ! =)

Copy link
Copy Markdown
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @JianyuWang0623 awesome stuff! =)

@cederom cederom merged commit 62f3d37 into apache:master Apr 24, 2026
41 checks passed
@acassis
Copy link
Copy Markdown
Contributor

acassis commented Apr 24, 2026

@JianyuWang0623 please include Documentation with the host vcnserver/Xvfb configuration example (please include at least the first two pictures)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants