Grab remote screen for Qt Applications - TeamViewer Support
<main>
<article class="userContent">
<p><br></p><p><strong>📌Note:</strong> The code for the remote screen SDK is moved to <a href="https://github.com/teamviewer/iotagentsdk" rel="nofollow noreferrer ugc">https://github.com/teamviewer/iotagentsdk</a>. Further updates and documentation can be found on GitHub.</p><p>TeamViewer provides the option to access the content of the screen of a <strong>custom Qt Application</strong> on the Edge Device. This is realized through the <strong>TeamViewer Remote Screen SDK</strong>. This SDK is directly linked to the application and so enables the connection to the <strong>TeamViewer IoT Agent</strong> on the edge device and so to the <strong>TeamViewer Cloud</strong>.</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png" alt="grab_screen_qt_app-overview.png" height="201" width="751" loading="lazy" data-display-size="large" data-float="none" srcset="https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=10/https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png 10w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=300/https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png 300w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=800/https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png 800w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=1200/https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png 1200w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=1600/https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png 1600w, https://us.v-cdn.net/6032394/uploads/LKQ60MNK3B4R/grab-screen-qt-app-overview.png"></img></a>
</div>
</div>
<div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png" alt="2023-03-09 16_04_46-TeamViewer IoT Documentation - TeamViewer.png" height="372" width="946" loading="lazy" data-display-size="large" data-float="none" srcset="https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=10/https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png 10w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=300/https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png 300w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=800/https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png 800w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=1200/https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png 1200w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=1600/https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png 1600w, https://us.v-cdn.net/6032394/uploads/YJCWZKH9B750/2023-03-09-16-04-46-teamviewer-iot-documentation-teamviewer.png"></img></a>
</div>
</div>
<p>The TeamViewer Remote Screen SDK is released under <strong>MIT License</strong> allowing an easy integration of our source code.</p><p>To create Qt applications <strong>Qt licenses</strong> are needed.</p><p><br></p><p><br></p><h2 data-id="what-you-will-need">What you will need</h2><p>Make sure that you have prepared the following points:</p><ul><li>A valid license for TeamViewer 14 (or newer).</li><li>The edge device is set up with a TeamViewer IoT Agent.</li><li>There must be a <strong>Qt application</strong> running on the edge device and this application must be accessible so the remote screen SDK can be linked to it.</li><li>The edge device should either be configured to display the user interface via a framebuffer (see <a href="https://community.teamviewer.com/English/kb/articles/109825-set-up-the-remote-screen-via-x11" rel="nofollow noreferrer ugc">Set up the Remote Screen via X11</a>) or is capable enough to send its image data to the SDK.</li><li>Advanced knowledge of <strong>Linux systems</strong>, programming <strong>Qt applications,</strong> and the <strong>TeamViewer Remote Screen SDK</strong>.</li><li><a href="https://community.teamviewer.com/English/kb/articles/109829-access-the-edge-device-via-remote-terminal" rel="nofollow noreferrer ugc">Access the Edge Device via Remote Terminal</a>.</li></ul><h3 data-id="software-dependencies">Software dependencies</h3><p>For building the whole package the following libraries and tools need to be installed:</p><ul><li>cmake (3.5 or newer)</li><li>Compiler tool chain with support for C++14 (like GCC or Clang)</li><li>Google Protocol Buffers library (3.0 and newer)</li><li>Google gRPC library (1.20 or newer)</li><li>zlib (needed by gRPC</li><li>Qt 5 (5.3 or newer)</li></ul><p>On debian systems (Version 10) the following development packages are used for building:</p><ul><li>cmake</li><li>build-essential or g++</li><li>libgrpc++-dev</li><li>protobuf-compiler-grpc</li><li>libprotobuf-dev</li><li>protobuf-compiler</li><li>qtbase5-dev</li><li>qtdeclarative5-dev</li></ul><p>Download the <strong>TeamViewer Remote Screen SDK</strong></p><ul><li>IoT Agents with version 2.15.10 or higher, please use <a href="https://download.teamviewer-iot.com/remoteScreenSDK/TVRemoteScreenSDK_2.1.10.zip?_ga=2.38321443.1679802627.1679314948-1498331324.1676560266&_gac=1.3943172.1677856287.EAIaIQobChMI8MLb24XA_QIVTY1oCR1RMQOWEAAYASAAEgIoV_D_BwE" rel="nofollow noreferrer ugc">https://download.teamviewer-iot.com/remoteScreenSDK/TVRemoteScreenSDK_2.1.10.zip</a></li><li>IoT Agents with a lower version, please use <a href="https://download.teamviewer-iot.com/remoteScreenSDK/TVRemoteScreenSDK_1.1.40.zip?_ga=2.38321443.1679802627.1679314948-1498331324.1676560266&_gac=1.3943172.1677856287.EAIaIQobChMI8MLb24XA_QIVTY1oCR1RMQOWEAAYASAAEgIoV_D_BwE" rel="nofollow noreferrer ugc">https://download.teamviewer-iot.com/remoteScreenSDK/TVRemoteScreenSDK_1.1.40.zip</a></li></ul><p>Extract the SDK in a suitable folder on the edge device.</p><h3 data-id="hardware-requirements">Hardware requirements</h3><ul><li>The edge device meets all <a href="https://community.teamviewer.com/English/kb/articles/109795-system-requirements" rel="nofollow noreferrer ugc">System Requirements</a>.</li><li>30 MB free disk space or more</li><li>systemd software suite</li><li>glibc-utils package (Version 2.17 newer)</li><li>Linux 2.6.27 kernel</li></ul><p><br></p><h3></h3><h2 data-id="qt-application-with-the-remote-screen-sdk">Qt Application with the remote screen SDK</h2><p>To build the remote screen SDK make sure that all required libraries and dependencies are installed and available.</p><p>Access the edge device remotely (<a href="https://community.teamviewer.com/English/kb/articles/109829-access-the-edge-device-via-remote-terminal" rel="nofollow noreferrer ugc">Access the Edge Device via Remote Terminal</a>).</p><p><br></p><h3 data-id="build-the-sdk">Build the SDK</h3><p>1. Create and navigate to the <strong>build directory</strong>. In the terminal type in the following commands and press return:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">mkdir build
cd build
</pre><p>2. Run <strong>cmake</strong>. In the terminal type in the following command and press return. Replace path (<code class="code codeInline" spellcheck="false" tabindex="0">PATH</code>) with the path where your previously extracted <strong>SDK</strong> is located.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">cmake PATH
</pre><p>3. Run <strong>make</strong>. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">make
</pre><p>After building the package there should be two binaries:</p><ul><li><code class="code codeInline" spellcheck="false" tabindex="0">libTVQtRC.so</code> – integration plugin, used by a Qt application for providing Remote Screen capabilities</li><li><code class="code codeInline" spellcheck="false" tabindex="0">qt_simulate</code> – an example application showing the basic usage of the plugin</li></ul><p><br></p><h3 data-id="installation-for-development">Installation for Development</h3><p>The SDK can also be installed to be used in a development environment.</p><p>Run <strong>make</strong>. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo make install
</pre><p>The default installation prefix for <strong>cmake</strong> is <code class="code codeInline" spellcheck="false" tabindex="0">/usr/local</code>. After installation there are two projects installed:</p><ul><li><strong>TVRemoteScreenSDK</strong> – The <strong>Qt plugin</strong> (<code class="code codeInline" spellcheck="false" tabindex="0">/lib/lbTVQtRC.so</code>) along with the public headers (<code class="code codeInline" spellcheck="false" tabindex="0">/include/*.h</code>).</li><li><strong>TVRemoteScreenSDKCommunication</strong> – The public <strong>C++ API</strong> used by the plugin. This API is independent of Qt and can be used together with any other framework.</li></ul><p>To install the <strong>SDK</strong> into a custom prefix override <code class="code codeInline" spellcheck="false" tabindex="0">CMAKE_INSTALL_PREFIX</code> when configuring the SDK before building. For example:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">cmake -DCMAKE_INSTALL_PREFIX=
</pre><p><br></p><h3 data-id="-1"></h3><h2 data-id="configuration-settings">Configuration settings</h2><h3 data-id="configuration-of-the-teamviewer-iot-agent">Configuration of the TeamViewer IoT Agent</h3><p>The <strong>TeamViewer IoT Agent</strong> needs then to be configured to remote control an external application. This configuration involves also specifying a so-called <strong>Image Grab Strategy</strong>. The agent tells the application in what way it expects image updates.</p><p>In the terminal type in the following commands and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">sudo teamviewer-iot-agent configure set EnableRemoteScreen 1
sudo teamviewer-iot-agent configure set RemoteScreenChannels "EAP"
</pre><p>That the value in escaped double quotes (“) can vary from user case. The values could be:</p><div class="embedExternal embedImage display-large float-none">
<div class="embedExternal-content">
<a class="embedImage-link" href="https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png" rel="nofollow noreferrer noopener ugc" target="_blank">
<img class="embedImage-img" src="https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png" alt="TeamViewer IoT Documentation - TeamViewer - Table_002.png" height="446" width="948" loading="lazy" data-display-size="large" data-float="none" srcset="https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=10/https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png 10w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=300/https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png 300w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=800/https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png 800w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=1200/https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png 1200w, https://us.v-cdn.net/cdn-cgi/image/fit=scale-down,width=1600/https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png 1600w, https://us.v-cdn.net/6032394/uploads/HFUREAHB4CBJ/teamviewer-iot-documentation-teamviewer-table-002.png"></img></a>
</div>
</div>
<p>The <strong>TeamViewer IoT Agent</strong> currently supports the following strategies:</p><ul><li>The application provided (default when setting the remote screen channel to <code class="code codeInline" spellcheck="false" tabindex="0">EAP</code>)<ul><li>The <strong>application</strong> (or the <strong>Qt plugin</strong>) is grabbing internally and send resulting images to the TeamViewer IoT Agent.</li></ul></li><li>Linux frame buffer device continuous (called <code class="code codeInline" spellcheck="false" tabindex="0">FrameBuffer-Pull</code> or the channel setting <code class="code codeInline" spellcheck="false" tabindex="0">FBPull</code>)<ul><li>This repeatedly copies the contents of a Linux frame buffer device regardless of any actual image changes.</li></ul></li><li>Linux frame buffer device with notifications (called <code class="code codeInline" spellcheck="false" tabindex="0">FrameBuffer-Pull</code> or the channel setting <code class="code codeInline" spellcheck="false" tabindex="0">FBPull</code>)<ul><li>This copies the contents of a Linux frame buffer device when the external application notifies the agent to do so.</li></ul></li></ul><p>After starting the agent its API for remote screen is now available and can be used by the Qt plugin.</p><h3 data-id="further-configuration">Further configuration</h3><p>After installing the <strong>TeamViewer IoT Agent</strong> it creates a system group called <code class="code codeInline" spellcheck="false" tabindex="0">tv_api</code>. Every application that wants to communicate with the agent needs to run under a user that is part of the before mentioned system group.</p><p>Add the <strong>current user</strong> to group <code class="code codeInline" spellcheck="false" tabindex="0">tv_api</code>. In the terminal type in the following commands and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">usermod -a -G tv_api $USER
</pre><p>For more information about the different channel configurations and their use, see <a href="https://community.teamviewer.com/English/kb/articles/109825-set-up-the-remote-screen-via-x11" rel="nofollow noreferrer ugc">Set up the Remote Screen via X11</a> and <a href="https://community.teamviewer.com/English/kb/articles/109826-set-up-the-remote-screen-via-framebuffer" rel="nofollow noreferrer ugc">Set up the Remote Screen via Framebuffer</a>.</p><p><br></p><h3 data-id="-2"></h3><h2 data-id="example-application">Example application</h2><p>In the package for the SDK is an example application included. This example show the basic operations of the SDK and how to integrate the plugin into a Qt Quick based application. It requires Qt 5.3 with the modules Qt Quick 2.3 and Qt Quick Window 2.0 to run.</p><p>On debian based distributions the following packages are required to run:</p><ul><li>qml-module-qtquick2</li><li>qml-module-qtquick-window2</li></ul><p>To start the example application:</p><ul><li>Open the Build directory using the graphical interface</li><li>Locate the qt_simulate</li><li>execute the qt_simulate</li></ul><p>With the example application, one can also test and see the basic operations:</p><ul><li>connectivity to the agent: the circle on the top left corner is green when the IoT Agent is available (this does not indicate network connectivity)</li><li>set the control mode: <code class="code codeInline" spellcheck="false" tabindex="0">Set Full Control</code> (image updates and input), <code class="code codeInline" spellcheck="false" tabindex="0">Set View Only</code> (image updates, no input), <code class="code codeInline" spellcheck="false" tabindex="0">Disable Remote Control</code> (no image updates, no input)</li><li>terminate all incoming TeamViewer sessions: <strong>Terminate TeamViewer Session</strong> is only enabled if there is at least one active remote control session. By clicking, it terminates all incoming sessions and the button is disabled afterward.</li><li>mouse and keyboard input testing</li><li>rudimentary animation testing</li></ul><p><br></p><h3 data-id="-3"></h3><h2 data-id="troubleshoot">Troubleshoot</h2><p>Contact <strong>TeamViewer IoT Support</strong> ⟨<a href="mailto:iot-support@teamviewer-iot.com" rel="nofollow noreferrer ugc">iot-support@teamviewer-iot.com</a>⟩ if you encounter problems when using the remote screen SDK.</p><h3 data-id="inverted-colors">Inverted Colors</h3><p>On some ARM-based devices, the colors may seem inverted or appear wrong on the client’s side.</p><h3 data-id="screen-refresh">Screen refresh</h3><p>When the <code class="code codeInline" spellcheck="false" tabindex="0">RemoteScreenChannels</code> setting is configured with <code class="code codeInline" spellcheck="false" tabindex="0">EAP:FBPush</code>, it may happen that the client picture is sometimes not refreshed appropriately during a TeamViewer session. Resizing the window will force an update and will display the actual content of the application in the client window.</p><p>For more information about the different channel configurations and their use, see <a href="https://community.teamviewer.com/English/kb/articles/109825-set-up-the-remote-screen-via-x11" rel="nofollow noreferrer ugc">Set up the Remote Screen via X11</a> and <a href="https://community.teamviewer.com/English/kb/articles/109826-set-up-the-remote-screen-via-framebuffer" rel="nofollow noreferrer ugc">Set up the Remote Screen via Framebuffer</a>.</p><p><br></p><h3 data-id="-4"></h3>
</article>
</main>