This article will guide the user to enable remote screen grabbing for Qt applications by using the remote screen SDK provided by Teamviewer
TeamViewer currently provides 3 different options to access the content of the screen attached to a device on which the TeamViewer IoT agent installed. In this article the option to directly access Qt applications is described. This is realized through an SDK which TeamViewer provides. This SDK is directly linked into the application and so enables the connection to the Teamviewer IoT agent on the edge device and so to the TeamViewer network.
The Qt application that in the end provides a user frontend which can be accessed from the outside
Customer Qt application
The frontend part of the Qt application. This is not provided by TeamViewer, but from the entity that designs the application and device.
Software Development Kit containing an interface and plugin to enable remote control for a customer application (short: SDK/plugin).
TeamViewer IoT agent
TeamViewer software enable the edge device to create TeamViewer connections for remote control
The TeamViewer program installed on the user pc. To initiate remote control connections to the device.
There are some preconditions , that you must meet, so that you can use this feature. Please make sure that you fulfill them all:
You need a valid license for TeamViewer 14.
The TeamViewer IoT agent must be installed on the device
There must be a Qt application running on the device and this application must be accessible so the remote screen SDK can be linked to it.
This device should either be configured to display the user interface via a Linux frame buffer device or is capable enough to send its image data to the SDK
For building the whole package the following libraries and tool need to be available:
CMake (3.5 or newer)
Compiler tool chain with support for C++14 (like GCC or Clang)
Google Protocol Buffers library (3.0 and newer)
Google gRPC library (1.20 or newer)
zlib (needed by gRPC
Qt 5 (5.3 or newer)
On debian systems (when writing the documentation debian 10 was the latest) the following development packages can be used for building
build-essential or g++
For example :
sudo apt-get -y install cmake
For supported platforms regarding the TeamViewer IoT Agent visit https://www.teamviewer.com/link/?url=150157
At least 30 MB free disk space
Systemd software suite
Glibc-utils package (version 2.17 higher)
Linux 2.6.27 kernel
Where to download
The TeamViewer Remote Screen SDKcan be downloaded by clicking on the follwoing link: http://download.teamviewer-iot.com/remoteScreenSDK/TVRemoteScreenSDK_1.0.9.zip
How to build a Qt application with the Remote Screen SDK
To build the remote screen SDK please ensure that all required libraries and dependencies are installed and available.
Steps to build:
# create and navigate to a build directory
# run cmake
cmake <path to extracted SDK>
# run make
After building the package there should be two binaries:
libTVQtRC.so - integration plugin, used by a Qt application for providing Remote Screen capabilities
-qt_simulate - an example application showing the basic usage of the plugin
Installation for Development
The SDK can also be installed to be used in a development environment:
# default installation (as root, if needed)
The default installation prefix for CMake is /usr/local. So after installation there are two projects installed:
TVRemoteScreenSDK The Qt plugin (<prefix>/lib/lbTVQtRC.so) along with the public headers (<prefix>/include/*.h) to use it.
TVRemoteScreenSDKCommunication The public C++ API used by the plugin. This API in independent of Qt and can be used together with any other framework.
To install the SDK into a custom prefix one can override CMAKE_INSTALL_PREFIX when configuring the SDK before building:
# configure to install into custom prefix
cmake -DCMAKE_INSTALL_PREFIX=<custom-install-path> <path-to-sources-root>
Configuration of the TeamViewer IoT agent
The TeamViewer IoT agent needs then to be configured to remote control an "external application". This configuration involves also specifying a so-called "image grab strategy": With that the agent tells the application in what way it expects image updates. To do this:
From remote terminal run:
sudo teamviewer-iot-agent configure set EnableRemoteScreen 1
sudo teamviewer-iot-agent configure set RemoteScreenChannels \"EAP\"
Note: That the value in escaped double quotes can vary from user case. The values could be:
External App (SDK) with built-in grabbing
[strng] RemoteScreenChannels = \"EAP\"
External App (SDK) with notifications about framebuffer changes
→ FB device /dev/fb42
[strng] RemoteScreenChannels = \"EAP:FBPush:/dev/fb42\"
External App (SDK) with frambuffer grabbing
→ first FB device (/dev/fb0)
[strng] RemoteScreenChannels = \"EAP:FBPull\"
The agent currently supports the following strategies:
Application provided (default when setting the remote screen channel to "EAP") The application (or the Qt plugin) is grabbing internally and send resulting images to the TeamViewer agent.
Linux frame buffer device continuous (called "FrameBuffer-Pull" or the channel setting "FBPull") This repeatedly copies the contents of a Linux frame buffer device regardless of any actual image changes.
Linux frame buffer device with notifications (called "FrameBuffer-Push" or the channel setting "FBPush") This copies the contents of a Linux frame buffer device when the external application notifies the agent to do so.
After starting the agent its API for remote screen is now available and can be used by the Qt plugin.
After installing the IoT Agent it creates a system group called 'tv_api'. Every application that wants to communicate with the agent needs to run under a user that is part of the before mentioned system group:
# add current user to group tv_api
usermod -a -G tv_api $USER
For further information on the TeamViewer IoT agent check here
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.
On debian based distributions the following packages are required to run:
To start the example application:
Open the Build directory using graphical interface
Locate the qt_simulate
execute the qt_simulate
With the example application one can also test and see the basic operations:
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)
set the control mode: "Set Full Control" (image updates and input), "Set View Only" (image updates, no input), "Disable Remote Control" (no image updates, no input)
terminate all incoming TeamViewer sessions: Terminate TV Session" is only enabled if there is at lease one active remote control session. By clicking, it terminates all incoming sessions and the button is disabled afterwards.
mouse and keyboard input testing
rudimentary animation testing
Please contact TeamViewer IoT Support ⟨firstname.lastname@example.org⟩ if you encounter problems when using the remote screen SDK.
On some ARM based devices, the colors may seem inverted or appear wrong on the client’s side.
When the RemoteScreenChannels setting is configured with EAP:FBPush, 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.
For more information about the different channel configurations and their use, please visit https://www.teamviewer.com/link/?url=710439
The TeamViewer Remote Screen SDK is released under MIT License allowing an easy integration of our source code.
To create Qt applications respective Qt licenses are needed
Further reading/Realated articles
General information on Remote Screen Grabbing
How to install the TeamViewer IoT agent
Also please check the readme file inside the Remote screen SDK for additional information
... View more
This article gives a general overview on the TeamViewer IoT solution and the components that come with the solution
This diagram shows the core components and features of Teamviewer IoT. Sensors and actuators are connected via the MQTT API to the Teamviewer IoT Agent. This Agent can be installed on any edge devices and on the one hand sends the sensor data to the TeamViewer cloud where it can be analyzed in our cloud dashboard and on the other hand allows incoming connections for remote control operations. The connections to the agent are handled by the TeamViewer IoT Global Access Network.
The functionality of all components is explained below in detail.
Core Use cases
To offer our three main use cases
there is a base of 2 technical use cases:
Monitoring is used to make any kind of data processed on the edge device available to the TeamViewer IoT solution. Meaning it can be accessed via the cloud dashboard or the AppControl application on the edge device. The data gathered during monitoring helps the user to better understand his use case and appliance better and provides insights in his operations.
The Remote Control module inside the TeamViewer IoT agent enables the customer to access the edge device through the TeamViewer client installed on the user's PC. Once connected the user can have full access over the whole device by using our built-in features (see below). This allows the user to react to the data which was gathered in the monitoring process.
Sensors and actuators
Any device which can be connected to edge device and send or receive data can serve as sensors or actuators. They can be bought from 3rd party vendors where normally all devices are supported by TeamViewer if they are connected to the hardware where TeamViewer is installed on
The edge gateway can be any computer device which runs a Linux operating system. For detailed platform compatibility check here: Supported platforms by TeamViewer IoT
A very prominent device for PoCs is the Raspberry pi, apart from this one TeamViewer uses the devices from Kunbus, Dell and Systec as reference platform.
TeamViewer IoT Agent
The TeamViewer IoT agent is the component installed on the edge to enable the use cases provided by TeamViewer IoT. It makes the edge gateway and the peripherals attached to it accessible to the outside by sending the data to the TeamViewer Iot cloud and handling incoming connections. The agent provides three possibilities to remote control the edge device.
AppControl provides the ability to create a custom user interface for the device or system the TeamViewer IoT agent is installed on. The UI is a HTML page which is stored on the device. The HTML page can be fully customized and can so reflect any use case. All sensors and actuators registered in the TeamViewer IoT agent and can be accessed by this feature.
The edge management is one application provided by TeamViewer which is using AppControl. It provides the possibility to:
view the data processed on the device in real time
create rules reacting on the data which are processed directly on the edge
set up the MQTT API and its clients via a graphical user interface and so enabling a very easy way to integrate sensors and other peripherals
Check the knowledge base entry to understand how the edge management application and its feature can be installed and configured here.
The Remote Terminal provides access to the Linux shell on the device and so full access to the operating system.
The remote screen feature allows the user to access a screen which is attached to the edge device. for full flexibility there are 3 different grabbing methods
Grabbing of a X11 session
Directly accessing a QT application processed on the device
The X11 and QT method provide the possibility to view the content of the screen and take control over it. While framebuffer grabbing only provides read-only access.
Find out more about the remote screen feature:
Instructions to setup grabbing for QT applications
The system monitoring agent is a special monitoring module which provides data about the internal system conditions of the device like CPU load or used disk space and many others. Check out how the system monitoring can be set up here.
The cloud dashboard is the entrance to the TeamViewer IoT solution. It provides the possibility to:
manage the devices assigned to the TeamViewer account
set up rules to receive an alert if a metric violates a threshold specified in the rule
have an overview of all devices and their metrics in operation through dashboard
find guidelines on further functionalities like to add additional sensors
The TeamViewer IoT dashboard can be reached on this URL: www.teamviewer-iot.com
The Web API enables the user to interact with the data stored on the TeamViewer IoT and so enables that the data is downloaded or forwarded to another cloud for further enhanced data processing.
TeamViewer can provide example on how to connect to the Thingworx IoT platform and to AWS.
To connect to the TeamViewer IoT Agent a PC with a TeamViewer client installed is needed. Currently the connection can only be established from Windows PCs. The cloud dashboard to view the data can be accessed from any browser. The Teamviewer Client can be downloaded here: https://www.teamviewer.com/de/download/windows/
Global Access Network
The TeamViewer infrastructure provides a secured and easy to set up point to point connection between PCs and other PCs or devices. For more information about the Global Access Network and its security features click here https://www.teamviewer.com/de/trust-center/sicherheit/
... View more
The 3rd option for remote screen grabbing for Teamviewer IoT is currently still in beta phase. This means that it is not yet publicly available.
A preliminary of the SDK for QT applications version can be obtained by signing an NDA with Teamviewer. For this please send a request to Nils.Larcher@teamviewer.com
Please excuse this inconvenience
... View more
This article explains how to move the Teamviewer Starter Kit from the preassigned account to another Teamviewer account.
Step 1: Find out the IP address of the gateway in the local network
Option 1: Ask your network administrator to connect the gateway to the network and provide you with IP address
Option 2: You can remotely access the gateway from TeamViewer desktop client application as it is already assigned to the predefined account.
Open TeamViewer desktop client application
Login with the provided account credentials
From the Contacts and Computers tab connect to your gateway
Switch to the “Remote Terminal” tab
In the Remote SSH window type “ifconfig” command and write down the IP address of the eth0 interface
Close TeamViewer remote connection session
Step 2: Install SSH client
Install SSH client on your desktop computer (e.g Putty). Open SSH connection to the gateway in the local network using the IP address obtained in Step 1.
Step 3: Unmanage the gateway
Use the bellow Linux command to unmanage the TV Agent from the current account
$ sudo teamviewer-iot-agent unmanage
Step 4: Create a new TeamViewer IoT account
Open your web browser and navigate to https://teamviewer-iot.com.
Click “Sign Up” and follow the instructions to create a new TeamViewer IoT account.
Remember your E-Mail and Password that has been used for the account creation.
Step 5: Provision the gateway to the newly created account.
In your SSH session use the below command to provision the gateway to your new account using the E-Mail and Password obtained in Step 4 and follow the instruction.
$ sudo teamviewer-iot-agent setup
Upon successful provisioning of the gateway, you will have a new device in the TeamViewer desktop client application as well as in your cloud dashboard under the “Devices” tab. Its name will be the hostname of the gateway.
Step 6: Configure the TeamViewer IoT Agent to receive measurements from Bosch XDK sensors
Disable TeamViewer Monitoring Agent
$ sudo teamviewer-iot-agent disable system-health
Restore the configurations for the Monitoring Agent
$ sudo su
$ sudo cat /var/lib/teamviewer-iot-agent/system_monitors_kit.conf > /var/lib/teamviewer-iot-agent/system_monitors.conf
Enable TeamViewer Monitoring Agent
$ sudo teamviewer-iot-agent enable system-health
Step 7 - Configure the digital input and output (DIO) pins
To use the DIOs of the Dell gateway with TV Agent first you need to create corresponding Sensors/Metrics.
Open your web browser and type the IP address obtained in Step 1 to open the Edge Management application. Navigate to the “API Clients” tab and create a new client.
Enter "Digital Out" as a client name and push the "Create" button then "Manage API Client".
Create "New Sensor" (name "Digital Outputs") with 8 metrics (names "Out 0...7") according to the screenshot below (Value Type: Bool, Display Unit: I/O).
After Pushing the “Create” button you will be provided with the Connector, Sensor and Metric IDs which will be required to edit “teamviewer_gpio.py” file in the next step.
Open the “teamviewer_gpio.py” file
$ sudo nano teamviewer_gpio.py
Replace the “client_id”, “sensor_id” and “Out0_id” to “Out7_id” on the top of the file with corresponding IDs obtained in the previous Step 7. Example:
client_id = "5385da5e6c854abc8d65c0c80b5d79e9"
sensor_id = "e6218136a1144c8e9d117dc55a24297c"
Out0_id = "4ee43a05e70a4a97a20fe13e6baf286e"
Out1_id = "58f38038ea0b48519332a190688a325e"
Out2_id = "cf1aceeb62f3479fb07d81213dd21269"
Out3_id = "05f12c7970704172a374f777bedc83ef"
Out4_id = "d67d349dba2347699096bc0989f638c8"
Out5_id = "8dac154dfeef4d5aa4ec33b39a675ee4"
Out6_id = "cefdd235b1c243a2b6f7d89a6ce639e3"
Out7_id = "50835cca2df34f19bb13b8a5e0873ed2"
Step 9: Restart the service for the GPIOs
$ sudo service teamviewer_gpio restart
Step 10: Check if the DIOs are working
To control the DIOs from the dashboard user needs to pin the "Out 0..7" metric from the "Metrics" tab to the dashboard and configure it as a "Control" with "Toggle-Switch" function. Use "true" and "false" for the control values as presented in the below screenshot.
... View more
This article describes how to connect the Teamviewer IoT Starter Kit to the internet using its internal modem
Connect the antennas to the gateway
Insert a sim card into the sim card slot
Connect the Gateway with LAN cable to the internet and power it up
Connect with Teamviewer Client or SSH to the device and login to the remote terminal
Enable the WWAN Connectivity
Unlock the card
The gateway can automatically connect to mobile internet if the SIM card does not require a pin.
If the SIM card inserted into the gateway requires a pin, there are 2 ways to unlock it:
Insert the SIM card into a phone and follow the settings to unlock it
Follow the steps below to unlock the pin from the gateway:
$ sudo nano /etc/systemd/system/pinunlock.service
Copy and paste the below text and provide the correct pin instead of **** [Unit] Description=Sim pin unlock After=network.target Requires=snap.modem-manager.modemmanager.service [Service] Type=idle ExecStartPre=/bin/sleep 60 ExecStart=/snap/bin/mmcli -i 0 --pin= **** [Install] WantedBy=multi-user.target
Exit the nano editor and execute the service
$ sudo systemctl enable pinunlock.service
Activate the WWAN modem
Check the modem model
The gateway is currently equipped with one of 2 gateway options and depending on the version the commands are different
Description / expected output
$ sudo mmcli -L
shows the installed modem
based on the output from the last section follow instruction either 1 or 2
1. Instructions for [Sierra Wireless, Incorporated] Qualcomm™ Snapdragon™ X7 LTE DW5818 modem
Description / expected output
$ sudo nmcli c add type gsm ifname cdc-wdm0 con-name <ConnecctionName> apn <operator_apn>
$ sudo reboot
create a connection with a meaningful connection name and set the apn from your sim card provider (e.g. web.vodafone.de)
reboot the modem
2. Instructions for the [Dell] MBIM modem
Unlock the SIM via phone or use below commands
Description / expected output
$ sudo mmcli -m 0
$ sudo mmcli - i 0 --pin=<pin_number> --disable-pin
$ sudo nmcli c add con-name <ConnectionName> type gsm ifname cdc-wdm0 apn <apn-name>
$ sudo nmcli r wwan
$ sudo nmcli c up <Connection-Name>
$ sudo reboot
modem status display --> check if card was found
unlock card and disable the pin
create a connection with a meaningful connection name and set the apn from your card provider (e.g. web.vodafone.de)
... View more
This article describes what the different blinking patterns of the XDK mean and what is the reaction to it if an error occurs.
The Bosch XDK 110 sensor kit is a freely programmable sensor whcih provides 8 different measurements. For the TeamViewer IoT starter kit it is programmed to send all to the TeamViewer IoT agent which then are visible and usable in the TeamViewer IoT solution.
The follwing measurements are possible and shown in the TeamViewer IoT cloud:
Accoustic noise sensor
Air humidity sensor
Air pressure sensor
Vibration (derived from 3-axis accelerometer)
Datasheet + supplier information for the sensor
For exact product features operation conditions and the ability to program the sensor please check the supplier's homepage:
Datasheet: see attachment of this article
Attaching other sensors to the GPIO pins
The XDK sensor is freely programmable and also supports that other devices are attached to it. This requires a new program written for the XDK. The instruction on how to do this can be found in the XDK community.
Note: To attach new devices to the starter kit and the TeamViewer IoT solution, TeamViewer in general recommends to attach additional devices directly to the gateway instead of adding them to the sensor.
The battery lifetime of the XDK sensor is up to 24 hours depending on environmental conditions like temperature.
The XDK has 4 LEDs on the top side. Each indicates a different status:
Charging indicator (lights on when the XDK is connected to a power source and the internal battery is charging)
Flashes every time when sensor data is transmitted to the gateway.
Blinking while it tries to connect to the gateway
Blinking while the XDK is connecting to the Teamviewer IoT service
Lights on when it is connected
Position of the LEDs
Meaning and action
No LED is on
The battery is empty, please connect it to a power source with a micro USB cable
Green LED is off, but the power source is connected
The battery is fully charged
Orange LED is constantly blinking
Check if the gateway is powered
Check if with another device (e.g. smartphone or laptop) the Wifi network "TV_Starter_Kit" is available. If yes restart the XDK, if not move closer to the gateway or restart it.
Red LED is lighting, yellow LED not flashing
No data is received from this XDK on the dashboards
Restart the XDK
... View more