• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

VNC server for Linux framebuffer devices

framebuffer-vncserver

VNC server for Linux framebuffer devices.

workflow

The goal is to access remote embedded Linux systems without X. Implemented features: remote display, touchscreen, keyboard, rotation Not implemented: file transfer, ..

Working configurations:

without rotation:

  • 1 bit/pixel
  • 8 bit/pixel
  • 16 bit/pixel
  • 24 bit/pixel
  • 32 bit/pixel

with rotation:

  • 1 bit/pixel
  • 8 bit/pixel
  • 16 bit/pixel
  • 24 bit/pixel
  • 32 bit/pixel

The code is based on a LibVNC example for Android: https://github.com/LibVNC/libvncserver/blob/master/examples/androidvncserver.c

build

Dependency:

sudo apt-get install libvncserver-dev

There are 2 options: CMake or qmake

Using cmake:

mkdir -p build && cd build
cmake ..
make

Using qmake:

mkdir -p buildqt && cd buildqt
qmake ../framebuffer-vncserver.pro
make

command-line help

./framebuffer-vncserver [-f device] [-p port] [-t touchscreen] [-k keyboard] [-r rotation] [-R touchscreen rotation] [-F FPS] [-v] [-h]
-p port: VNC port, default is 5900
-f device: framebuffer device node, default is /dev/fb0
-k device: keyboard device node (example: /dev/input/event0)
-t device: touchscreen device node (example:/dev/input/event2)
-r degrees: framebuffer rotation, default is 0
-R degrees: touchscreen rotation, default is same as framebuffer rotation
-F FPS: Maximum target FPS, default is 10
-v: verbose
-h: print this help

Run on startup as service

To run at startup as a service using systemd, edit the file fbvnc.service make sure the path and command line arguments are correct and then run:

sudo cp fbvnc.service /etc/systemd/system/
sudo systemctl enable fbvnc.service
sudo systemctl start fbvnc.service

Vfb test

Linux Virtual Frame Buffer kernel object (vfb.ko) is used for this test. https://cateee.net/lkddb/web-lkddb/FB_VIRTUAL.html

Local computer:

# install
sudo apt install vagrant virtualbox xtightvncviewer

# after framebuffer-vncserver start
vncviewer localhost

vagrant up
vagrant ssh

Inside vagrant box:

sudo su
cd /home/vagrant/build/

# build framebuffer-vncserver
make

# set resolution, color depth
fbset -g 640 480 640 480 16

# restart framebuffer-vncserver
killall framebuffer-vncserver;./framebuffer-vncserver -t /dev/input/ms -k /dev/input/kbd &

# set test pattern or ..
fb-test

# draw random rectangles or ..
rect

# display a GUI or ...
qmlscene -platform linuxfb -plugin evdevmouse:/dev/input/ms:abs -plugin evdevkeyboard:/dev/input/kbd:grab=1

Automatic test

This generates patterns with different resolutions and color depths (on local computer):

python3 -m pip install fabric vncdotool python-vagrant entrypoint2
python3 vfb.py
rotation color fbtest qmlscene gradient
0 1
0 8
0 16
0 24
0 32
90 16
180 16
270 16

Testing single-touch

$ (evtest /dev/input/event0 &) ;./framebuffer-vncserver -t /dev/input/event0 -v
...
Initializing touch device /dev/input/event0 ...
x:(0 4095)  y:(0 4095) 
...
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
	Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
	Event code 0 (ABS_X)
	Value   1970
	Min        0
	Max     4095
	Event code 1 (ABS_Y)
	Value   1745
	Min        0
	Max     4095
	Event code 24 (ABS_PRESSURE)
	Value      0
	Min        0
	Max      255
...
Got ptrevent: 0001 (x=186, y=570)
Event: time 1580221917.655639, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1580221917.655639, type 3 (EV_ABS), code 0 (ABS_X), value 1586
Event: time 1580221917.655639, type 3 (EV_ABS), code 1 (ABS_Y), value 2733
Event: time 1580221917.655639, -------------- SYN_REPORT ------------
injectTouchEvent (screen(186,570) -> touch(1586,2733), mouse=1)
...
Got ptrevent: 0000 (x=186, y=570)
Event: time 1580221918.516897, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1580221918.516897, -------------- SYN_REPORT ------------
injectTouchEvent (screen(186,570) -> touch(1586,2733), mouse=0)

Testing multi-touch

$ (evtest /dev/input/event2 &) ;./framebuffer-vncserver -t /dev/input/event2 -v
...
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
	Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
	Event code 0 (ABS_X)
	Value    245
	Min        0
	Max      480
	Event code 1 (ABS_Y)
	Value    485
	Min        0
	Max      854
	Event code 47 (ABS_MT_SLOT)
	Value      4
	Min        0
	Max        4
	Event code 48 (ABS_MT_TOUCH_MAJOR)
	Value      0
	Min        0
	Max      255
	Event code 50 (ABS_MT_WIDTH_MAJOR)
	Value      0
	Min        0
	Max      255
	Event code 53 (ABS_MT_POSITION_X)
	Value      0
	Min        0
	Max      480
	Event code 54 (ABS_MT_POSITION_Y)
	Value      0
	Min        0
	Max      854
	Event code 57 (ABS_MT_TRACKING_ID)
	Value      0
	Min        0
	Max    65535
...
Initializing touch device /dev/input/event2 ...
x:(0 480)  y:(0 854) 
...
Got ptrevent: 0001 (x=237, y=528)
Event: time 1580221680.870277, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 1580221680.870277, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1580221680.870277, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 237
Event: time 1580221680.870277, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 528
Event: time 1580221680.870277, type 3 (EV_ABS), code 0 (ABS_X), value 237
Event: time 1580221680.870277, type 3 (EV_ABS), code 1 (ABS_Y), value 528
Event: time 1580221680.870277, -------------- SYN_REPORT ------------
injectTouchEvent (screen(237,528) -> touch(237,528), mouse=1)
...
Got ptrevent: 0000 (x=237, y=528)
Event: time 1580221681.190716, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1580221681.190716, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1580221681.190716, -------------- SYN_REPORT ------------
injectTouchEvent (screen(237,528) -> touch(237,528), mouse=0)

More Repositories

1

PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
Python
687
star
2

pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
Python
495
star
3

EasyProcess

Easy to use python subprocess interface
Python
112
star
4

pyunpack

unpack archive files in python
Python
97
star
5

pysimavr

python wrapper for simavr which is AVR and arduino simulator
C
48
star
6

psidialogs

Python Simple Dialogs
Python
34
star
7

arduino-rtttl-player

Arduino library to play RTTTL melodies
Python
16
star
8

pysimavrgui

Simple GUI elements for AVR and arduino simulation. Programmed in python, based on pygame. Simavr is used for simulation.
Python
15
star
9

pyavrutils

pyavrutils is a Python library that can build AVR and arduino code at runtime.
Python
11
star
10

confduino

arduino library installer
Python
9
star
11

eagexp

export Eagle 6.6.0 schematic or board to image
POV-Ray SDL
9
star
12

entrypoint2

easy to use command-line interface for python modules
Python
8
star
13

discogui

Experimental Python library for discovering GUI elements.
Python
6
star
14

softusbduino

Arduino control over USB in Python
C
5
star
15

sphinxcontrib-programscreenshot

Sphinx extension to include program screenshot
Python
4
star
16

sphinxcontrib-gtkwave

Sphinx extension to include VCD (value change dump) files using GTKWave
Python
4
star
17

sphinxcontrib-eagle

Sphinx extension to include image or partlist of eagle schematic or board
Python
3
star
18

abandi

Console-based abandonware game installer
Python
3
star
19

MyElectronicProjects

Hobby electronic projects built by me
Python
3
star
20

fb-test-app

copy of https://github.com/prpplague/fb-test-app
C
2
star
21

mangui

GUI generator for command-line programs on Linux.
Python
2
star
22

serial_port_tester

Python serial port tester / monitor GUI
Python
2
star
23

nanpy-drivers

drivers for Nanpy + Arduino
C
1
star
24

StripboardProto

Stripboard based modular hardware prototyping system.
Python
1
star
25

nanpy-gui

TraitsUI based GUI for Nanpy
Python
1
star
26

electronic-measurements

Electronic measurements using Arduino, some additional hardware, USB port and Python libraries
Python
1
star