Open main menu

DAVE Developer's Wiki β

Changes

XELK-AN-005: Qt5 application remoted using VNC server

22,949 bytes added, 12:17, 18 April 2018
Created page with "{{InfoBoxTop}} {{AppliesToAxelLite}} {{InfoBoxBottom}} == History == {| class="wikitable" border="1" !Version !Date !Notes |- |1.0.0 |Apr 2018 |First release |- |} ==Introduct..."
{{InfoBoxTop}}
{{AppliesToAxelLite}}
{{InfoBoxBottom}}
== History ==
{| class="wikitable" border="1"
!Version
!Date
!Notes
|-
|1.0.0
|Apr 2018
|First release
|-
|}
==Introduction==
This application note describes how to display remotely the local Qt5 application using standard connectivity application like [https://www.realvnc.com/en/ VNC].
The SBCX platform and the [Category:AxelLite AxelLite] module is used as Embedded Platform running a Qt 5.6.2 example and displaying it remotely on a PC and a TV.


==VNC==
Starting from original Yocto based root file system provided [http://mirror.dave.eu/axel/xelk-3.0.1/xelk-3.0.1_dave-image-devel.tar.bz2 here], more packages need to be added for using the well known [https://www.realvnc.com/en/connect/download/viewer/ VNC] remote desktop (screen sharing) application.

We assume that network interface has been already configured for Internet access. In any case, simple configuration can be done directly on serial console with the following commands:

<pre class="board-terminal">
root@axellite:~# ifconfig eth0 192.168.0.94
root@axellite:~# route add default gw 192.168.0.254
root@axellite:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf
</pre>

where ''192.168.0.254'' is the <code>gateway</code> address and ''8.8.8.8'' is the <code>DNS server</code> (in this case Google's one).

It is possibile to install the complete '''VNC server''' suite using the smart package manager on DAVE's XELK kit Yocto distribution:

Firts of all, <b>SMART</b> channels must be added for accessing DAVE's server for Yocto pre-built packages, using the following commands:

<pre class="board-terminal">
root@sbc-lynx:~# smart channel --add cortexa9hf_neon type=rpm-md baseurl=http://yocto.dave.eu/xelk-latest/cortexa9hf_neon
Alias: cortexa9hf_neon
Type: rpm-md
Base URL: http://yocto.dave.eu/xelk-latest/cortexa9hf_neon

Include this channel? (y/N): y

root@axellite:~# smart update
Updating cache... ################################################################## [100%]

Fetching information for 'cortexa9hf_neon'...
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/repodata/repomd.xml
repomd.xml ################################################################## [ 50%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/repodata/filelists.xml.gz
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/repodata/primary.xml.gz
filelists.xml.gz ################################################################## [ 75%]
primary.xml.gz ################################################################## [100%]

Updating cache... ################################################################## [100%]

Channels have 17503 new packages.
Saving cache...

root@axellite:~#
</pre>

Then, once the ''smart'' database has been updated, it is possible to use the <code>install</code> option for smart:

<pre class="board-terminal">
root@axellite:~# smart install x11vnc
Loading cache...
Updating cache... ################################################################## [100%]

Computing transaction...

Installing packages (23):
libatk-1.0-0-2.18.0-r0@cortexa9hf_neon libxcomposite1-1:0.4.4-r0@cortexa9hf_neon
libgdk-pixbuf-2.0-loader-gif-2.32.3-r0@cortexa9hf_neon libxcursor1-1:1.1.14-r0@cortexa9hf_neon
libgdk-pixbuf-2.0-loader-jpeg-2.32.3-r0@cortexa9hf_neon libxdamage1-1:1.1.4-r0@cortexa9hf_neon
libgdk-pixbuf-2.0-loader-png-2.32.3-r0@cortexa9hf_neon libxdmcp6-1:1.1.2-r0@cortexa9hf_neon
libgdk-pixbuf-2.0-loader-xpm-2.32.3-r0@cortexa9hf_neon libxext6-1:1.3.3-r0@cortexa9hf_neon
libgtk-2.0-2.24.29-r0@cortexa9hf_neon libxfixes3-1:5.0.1-r0@cortexa9hf_neon
libvncserver-0.9.10-r0@cortexa9hf_neon libxi6-1:1.7.6-r0@cortexa9hf_neon
libx11-6-1:1.6.3-r0@cortexa9hf_neon libxrandr2-1:1.5.0-r0@cortexa9hf_neon
libxau6-1:1.0.8-r0@cortexa9hf_neon libxrender1-1:0.9.9-r0@cortexa9hf_neon
libxcb-render0-1.11.1-r0@cortexa9hf_neon libxtst6-1:1.2.2-r0@cortexa9hf_neon
libxcb-shm0-1.11.1-r0@cortexa9hf_neon x11vnc-0.9.13-r0@cortexa9hf_neon
libxcb1-1.11.1-r0@cortexa9hf_neon

4.5MB of package files are needed. 9.5MB will be used.

Confirm changes? (Y/n): Y

Fetching packages...
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxext6-1.3.3-r0.cortexa9hf_neon.rpm
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libgdk-pixbuf-2.0-loader-png-2.32.3-r0.cortexa9hf_neon.rpm
libgdk-pixbuf-2.0-loader-png-2.32.3-r0.cortex.. ################################################################## [ 4%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxtst6-1.2.2-r0.cortexa9hf_neon.rpm
libxtst6-1.2.2-r0.cortexa9hf_neon.rpm ################################################################## [ 8%]
libxext6-1.3.3-r0.cortexa9hf_neon.rpm ################################################################## [ 13%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxcb-render0-1.11.1-r0.cortexa9hf_neon.rpm
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxrandr2-1.5.0-r0.cortexa9hf_neon.rpm
libxrandr2-1.5.0-r0.cortexa9hf_neon.rpm ################################################################## [ 17%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libvncserver-0.9.10-r0.cortexa9hf_neon.rpm
libvncserver-0.9.10-r0.cortexa9hf_neon.rpm ################################################################## [ 21%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxau6-1.0.8-r0.cortexa9hf_neon.rpm
libxau6-1.0.8-r0.cortexa9hf_neon.rpm ################################################################## [ 26%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxi6-1.7.6-r0.cortexa9hf_neon.rpm
libxi6-1.7.6-r0.cortexa9hf_neon.rpm ################################################################## [ 30%]
libxcb-render0-1.11.1-r0.cortexa9hf_neon.rpm ################################################################## [ 34%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxcursor1-1.1.14-r0.cortexa9hf_neon.rpm
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxcb1-1.11.1-r0.cortexa9hf_neon.rpm
libxcb1-1.11.1-r0.cortexa9hf_neon.rpm ################################################################## [ 39%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libatk-1.0-0-2.18.0-r0.cortexa9hf_neon.rpm
libatk-1.0-0-2.18.0-r0.cortexa9hf_neon.rpm ################################################################## [ 43%]
libxcursor1-1.1.14-r0.cortexa9hf_neon.rpm ################################################################## [ 47%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/x11vnc-0.9.13-r0.cortexa9hf_neon.rpm
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libgdk-pixbuf-2.0-loader-jpeg-2.32.3-r0.cortexa9hf_neon.rpm
libgdk-pixbuf-2.0-loader-jpeg-2.32.3-r0.corte.. ################################################################## [ 52%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxcb-shm0-1.11.1-r0.cortexa9hf_neon.rpm
libxcb-shm0-1.11.1-r0.cortexa9hf_neon.rpm ################################################################## [ 56%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxdamage1-1.1.4-r0.cortexa9hf_neon.rpm
libxdamage1-1.1.4-r0.cortexa9hf_neon.rpm ################################################################## [ 60%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxrender1-0.9.9-r0.cortexa9hf_neon.rpm
libxrender1-0.9.9-r0.cortexa9hf_neon.rpm ################################################################## [ 65%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libgdk-pixbuf-2.0-loader-gif-2.32.3-r0.cortexa9hf_neon.rpm
libgdk-pixbuf-2.0-loader-gif-2.32.3-r0.cortex.. ################################################################## [ 69%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libx11-6-1.6.3-r0.cortexa9hf_neon.rpm
libx11-6-1.6.3-r0.cortexa9hf_neon.rpm ################################################################## [ 73%]
x11vnc-0.9.13-r0.cortexa9hf_neon.rpm ################################################################## [ 78%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxdmcp6-1.1.2-r0.cortexa9hf_neon.rpm
libxdmcp6-1.1.2-r0.cortexa9hf_neon.rpm ################################################################## [ 82%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libgdk-pixbuf-2.0-loader-xpm-2.32.3-r0.cortexa9hf_neon.rpm
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxcomposite1-0.4.4-r0.cortexa9hf_neon.rpm
libxcomposite1-0.4.4-r0.cortexa9hf_neon.rpm ################################################################## [ 86%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libxfixes3-5.0.1-r0.cortexa9hf_neon.rpm
libxfixes3-5.0.1-r0.cortexa9hf_neon.rpm ################################################################## [ 91%]
libgdk-pixbuf-2.0-loader-xpm-2.32.3-r0.cortex.. ################################################################## [ 95%]
-> http://yocto.dave.eu/xelk-latest/cortexa9hf_neon/libgtk-2.0-2.24.29-r0.cortexa9hf_neon.rpm
libgtk-2.0-2.24.29-r0.cortexa9hf_neon.rpm ################################################################## [100%]


Committing transaction...
Preparing... ################################################################## [ 0%]
1:Installing libxau6 ################################################################## [ 4%]
2:Installing libgdk-pixbuf-2.0-loader-gif ################################################################## [ 8%]
3:Installing libgdk-pixbuf-2.0-loader-jpeg ################################################################## [ 13%]
4:Installing libgdk-pixbuf-2.0-loader-xpm ################################################################## [ 17%]
5:Installing libgdk-pixbuf-2.0-loader-png ################################################################## [ 21%]
6:Installing libxdmcp6 ################################################################## [ 26%]
7:Installing libatk-1.0-0 ################################################################## [ 30%]
8:Installing libxcb1 ################################################################## [ 34%]
9:Installing libxcb-shm0 ################################################################## [ 39%]
10:Installing libxcb-render0 ################################################################## [ 43%]
11:Installing libx11-6 ################################################################## [ 47%]
12:Installing libxfixes3 ################################################################## [ 52%]
13:Installing libxcomposite1 ################################################################## [ 56%]
14:Installing libxext6 ################################################################## [ 60%]
15:Installing libxrender1 ################################################################## [ 65%]
16:Installing libxdamage1 ################################################################## [ 69%]
17:Installing libxi6 ################################################################## [ 73%]
18:Installing libxcursor1 ################################################################## [ 78%]
19:Installing libxrandr2 ################################################################## [ 82%]
20:Installing libxtst6 ################################################################## [ 86%]
21:Installing libgtk-2.0 ################################################################## [ 91%]
Output from libgtk-2.0-2.24.29-r0@cortexa9hf_neon:
update-alternatives: Linking /usr/bin/gtk-update-icon-cache to /usr/bin/gtk-update-icon-cache-2.0
22:Installing libvncserver ################################################################## [ 95%]
23:Installing x11vnc ################################################################## [100%]


root@axellite:~#
</pre>

===server command line===

The command line used is the following one:

x11vnc -noipv6 -rawfb /dev/fb0 -clip WxH

where the '''W''' and '''H''' parameters are the width and height size of the screen to be remoted.

==Test bed==
* lcd panel is 800x480, so the command line is:

root@axellite:~# x11vnc -noipv6 -rawfb /dev/fb0 -clip 800x480

<pre class="board-terminal">
root@axellite:~# x11vnc -noipv6 -rawfb /dev/fb0 -clip 800x480
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ ** WARNING ** WARNING ** WARNING ** WARNING ** @#
#@ @#
#@ YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!! @#
#@ @#
#@ This means anyone with network access to this computer @#
#@ may be able to view and control your desktop. @#
#@ @#
#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
#@ @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ You can create an x11vnc password file by running: @#
#@ @#
#@ x11vnc -storepasswd password /path/to/passfile @#
#@ or x11vnc -storepasswd /path/to/passfile @#
#@ or x11vnc -storepasswd @#
#@ @#
#@ (the last one will use ~/.vnc/passwd) @#
#@ @#
#@ and then starting x11vnc via: @#
#@ @#
#@ x11vnc -rfbauth /path/to/passfile @#
#@ @#
#@ an existing ~/.vnc/passwd file from another VNC @#
#@ application will work fine too. @#
#@ @#
#@ You can also use the -passwdfile or -passwd options. @#
#@ (note -passwd is unsafe if local users are not trusted) @#
#@ @#
#@ Make sure any -rfbauth and -passwdfile password files @#
#@ cannot be read by untrusted users. @#
#@ @#
#@ Use x11vnc -usepw to automatically use your @#
#@ ~/.vnc/passwd or ~/.vnc/passwdfile password files. @#
#@ (and prompt you to create ~/.vnc/passwd if neither @#
#@ file exists.) Under -usepw, x11vnc will exit if it @#
#@ cannot find a password to use. @#
#@ @#
#@ @#
#@ Even with a password, the subsequent VNC traffic is @#
#@ sent in the clear. Consider tunnelling via ssh(1): @#
#@ @#
#@ http://www.karlrunge.com/x11vnc/#tunnelling @#
#@ @#
#@ Or using the x11vnc SSL options: -ssl and -stunnel @#
#@ @#
#@ Please Read the documention for more info about @#
#@ passwords, security, and encryption. @#
#@ @#
#@ http://www.karlrunge.com/x11vnc/faq.html#faq-passwd @#
#@ @#
#@ To disable this warning use the -nopw option, or put @#
#@ 'nopw' on a line in your ~/.x11vncrc file. @#
#@ @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
###############################################################
14/02/2018 06:44:20 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 775
14/02/2018 06:44:20 Not opening DISPLAY in -rawfb mode (force via -rawfb +str)
14/02/2018 06:44:20 Continuing without X display in -rawfb mode.
14/02/2018 06:44:20 console_guess: file is /dev/fb0
14/02/2018 06:44:20 console_guess: file pipeinput CONSOLE0
14/02/2018 06:44:20 pipeinput: using linux console: /dev/tty0
14/02/2018 06:44:20 console_guess returned: map:/dev/fb0@800x480x16:f800/7e0/1f
14/02/2018 06:44:20 raw fb is non-regular file: /dev/fb0
14/02/2018 06:44:20 rawfb: mmap file: /dev/fb0
14/02/2018 06:44:20 w: 800 h: 480 b: 16 addr: 0x7632f000 sz: 768000
14/02/2018 06:44:20 *** ignoring invalid -clip WxH+X+Y: 800x480
14/02/2018 06:44:20 pipeinput: using linux console: /dev/tty0
14/02/2018 06:44:20 initialize_screen: fb_depth/fb_bpp/fb_Bpl 16/16/1600
14/02/2018 06:44:20
14/02/2018 06:44:20 Raw fb at addr 0x7632f000 is 16bpp depth=16 true color
14/02/2018 06:44:20
14/02/2018 06:44:20 Autoprobing TCP port
14/02/2018 06:44:20 Autoprobing selected TCP port 5900
14/02/2018 06:44:20 Autoprobing TCP6 port
14/02/2018 06:44:20 Autoprobing selected TCP6 port 5900
14/02/2018 06:44:20 Not listening on IPv6 interface.
14/02/2018 06:44:20 fb read rate: 99 MB/sec
14/02/2018 06:44:20 fast read: reset -wait ms to: 10
14/02/2018 06:44:20 fast read: reset -defer ms to: 10
14/02/2018 06:44:20 screen setup finished.
14/02/2018 06:44:20
14/02/2018 06:44:20 WARNING: You are running x11vnc WITHOUT a password. See
14/02/2018 06:44:20 WARNING: the warning message printed above for more info.
14/02/2018 06:44:20

The VNC desktop is: imx6qxelk:0
PORT=5900

</pre>

==Connection ==

On Windows PC, it is possible to start a VNC viewer, like [http://www.uvnc.com/downloads/ultravnc.html UltraVNC Viewer], and selecting the SBCX board's IP address:

[[File:Ultravnc-viewer.png|thumb|center|400px|UltraVNC Viewer running on Windows PC]]

On target, the VNC server shows the remote connection accepted:

<pre class="board-terminal">
14/02/2018 06:44:58 Got connection from client 192.168.0.21
14/02/2018 06:44:58 other clients:
14/02/2018 06:44:58 Normal socket connection
14/02/2018 06:44:58 incr accepted_client=1 for 192.168.0.21:60116 sock=9
14/02/2018 06:44:58 Client Protocol Version 3.8
14/02/2018 06:44:58 Protocol version sent 3.8, using 3.8
14/02/2018 06:44:58 rfbProcessClientSecurityType: executing handler for type 1
14/02/2018 06:44:58 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
14/02/2018 06:44:58 Pixel format for client 192.168.0.21:
14/02/2018 06:44:58 16 bpp, depth 16, little endian
14/02/2018 06:44:58 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
14/02/2018 06:44:58 no translation needed
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000000A)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type zlibhex
14/02/2018 06:44:58 Using compression level 6 for client 192.168.0.21
14/02/2018 06:44:58 Enabling full-color cursor updates for client 192.168.0.21
14/02/2018 06:44:58 Enabling cursor position updates for client 192.168.0.21
14/02/2018 06:44:58 Using image quality level 6 for client 192.168.0.21
14/02/2018 06:44:58 Using JPEG subsampling 0, Q79 for client 192.168.0.21
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type xorEnable
14/02/2018 06:44:58 Enabling LastRect protocol extension for client 192.168.0.21
14/02/2018 06:44:58 Enabling NewFBSize protocol extension for client 192.168.0.21
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type cacheEnable
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8000)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8001)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8002)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8003)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xC0A1E5CE)
14/02/2018 06:44:58 Using ZRLE encoding for client 192.168.0.21
14/02/2018 06:44:58 Pixel format for client 192.168.0.21:
14/02/2018 06:44:58 16 bpp, depth 16, little endian
14/02/2018 06:44:58 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
14/02/2018 06:44:58 no translation needed
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000000A)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type zlibhex
14/02/2018 06:44:58 Using compression level 6 for client 192.168.0.21
14/02/2018 06:44:58 Enabling full-color cursor updates for client 192.168.0.21
14/02/2018 06:44:58 Enabling cursor position updates for client 192.168.0.21
14/02/2018 06:44:58 Using image quality level 6 for client 192.168.0.21
14/02/2018 06:44:58 Using JPEG subsampling 0, Q79 for client 192.168.0.21
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type xorEnable
14/02/2018 06:44:58 Enabling LastRect protocol extension for client 192.168.0.21
14/02/2018 06:44:58 Enabling NewFBSize protocol extension for client 192.168.0.21
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8000)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8001)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8002)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFF8003)
14/02/2018 06:44:58 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xC0A1E5CE)
14/02/2018 06:44:58 Switching from ZRLE to hextile Encoding for client 192.168.0.21
14/02/2018 06:44:58 client useCopyRect: 192.168.0.21 -1

</pre>
==Demo on youtube==

{| class="wikitable" | width="100%"
| {{#ev:youtube|xxxxxx|500|center|Qt5 application with VNC server running on i.MX6 |frame}}
|}
8,226
edits