TeamViewer IoT Documentation


TeamViewer IoT Documentation

  1. Preface
    1. What is TeamViewer IoT?
    2. Scope and Intended Use
    3. Glossary
  2. Starter Kit
    1. Safety
    2. Technical Data
      1. Power over Ethernet Wall Plug Adapter
      2. Dell Edge Gateway
      3. Bosch Sensor XDK110
    3. Set up the Starter Kit
    4. Enable GPS receiver on the Starter Kit
    5. Enable mobile internet connectivity with SIM-Card on the Starter Kit
    6. Reassign the Starter Kit to another TeamViewer Account
    7. Disposal
  3. Installation
    1. System Requirements
    2. Install the IoT Agent on a Device
    3. Installation on designated Hardware
      1. Easy Installation on Raspberry devices
      2. Set up a Yocto Image for Raspberry
  4. IoT Agent
    1. Check the Version of the IoT Agent
    2. Update the IoT Agent
    3. Get the IP Address of the Edge Device / IoT Agent
    4. Mass Remote Configuration of IoT Agents
    5. Assigning Edge Devices to Your TeamViewer Account at scale (Mass Deployment)
    6. Set up Remote Client to integrate your IoT Network
  5. IoT Management Console
    1. Using the IoT Management Console
  6. Edge Management
    1. Enable the Edge Management
    2. Update the Edge Management
    3. Disable the Edge Management
    4. Configure the Edge Management
  7. Remote Control
    1. Set up the Remote Screen via X11
    2. Set up the Remote Screen via Framebuffer
    3. Customize the User Notification when accessing the Remote Screen
    4. Set up a Web Page on the Edge Device
    5. Access the Edge Device via Remote Terminal
    6. Access the Edge Device via Remote Screen
    7. Access the Edge Device via Remote AppControl
      1. New Browser Engine Support for IoT Devices
    8. Grab Remote Screen for QT Applications
  8. Sensors
    1. Add Sensors with Easy Setup
    2. Example: Connect a Sensor to the TeamViewer IoT Agent
    3. Set up the OPC UA Connector for Easy Integration
    4. Set up the Log Parser Connector for easy Integration of your Log Based Sensors/Metrics
      1. Configuration and Syntax of the TeamViewer Log Parser Connector
      2. TeamViewer IoT Log Parser Connector Template
      3. Examples: Configuration of the Connector using the “monitoringParams”
    5. JSON Schema for Custom Plugin Connector
    6. Set up Secure Clients, Sensors and Metrics
  9. Rules, Alarms and Notifications
    1. Enable the Real Time Rule Engine
    2. Add Rule
    3. Add Topic
    4. Add Channel
    5. Examples: Rule Triggered Webhook Messages
    6. Example: Integrate Webhook Alerts
  10. Data and Visualization
    1. Widgets
    2. Add a Widget
    3. Configure Widgets
    4. Delete a Widget
    5. Export collected Data
    6. Enable File Transfer
    7. Transfer Files
    8. Activate System Monitoring
    9. Integrate TeamViewer IoT with AWS IoT Greengrass
    10. Examples: Lambda Functions on AWS IoT Greengrass
  11. Security
    1. Activate Two-Factor Authentication
    2. Authorize a Trusted Device
    3. Recovery Code for Two-Factor Authentication

Preface #

Here you’ll learn the basics of every TeamViewer IoT Solution and how to set up a TeamViewer IoT Network quickly.

  • What is TeamViewer IoT – a basic overview on the topic.
  • Glossary – an overview on all used terms and additional information on how to use this documentation.
  • Safety – an overview of all guidelines to help ensure your safety and protect the device from damage.
  • System Requirements – an overview on required hardware and software.

What is TeamViewer IoT? #

TeamViewer Internet of Things enables you to instantly connect, monitor, and operate machines and devices securely – from anywhere.


Get full visibility into all IoT devices with real-time status alerts and early insights, so you can react quickly to mitigate risks and proactively solve issues, before they impact your business:

  • Combine remote control functionalities with monitoring capabilities
  • Operate endpoints remotely for faster, more economical operations – at the enterprise scale
  • Receive alerts based on monitored IoT Data, enabling you to react quickly to incidents
  • Enables remote assistance and support to fix devices and machine issues as they occur
  • Accelerate roll-out time for your IoT solution with out-of-the-box connectivity – no complicated IoT VPNs

Components

The TeamViewer IoT Solution comprises the following core components:

  • Your personal edge devices you want to control remotely.
  • The TeamViewer IoT Agent Software which enables remote control of your devices.
  • The TeamViewer Edge Management Software which enables additional features on your devices like Rule Management and a Web User Interface.
  • The TeamViewer IoT Cloud which manages your devices and enables the visualization of data of the device and many more (e.g. reading sensor data or commanding motors). It also enables advanced users to automate processes via scripting. You access the cloud via the TeamViewer IoT Management Console.
  • The TeamViewer IoT Agent API (MQTT based) which enables advanced users to access the device data, e.g. using data for your custom IoT cloud service or many other cloud services like Amazon Web Services.
  • The TeamViewer IoT SDKs (for C, Node.js and Python) which enables advanced users to create custom applications within the TeamViewer IoT Solution, e.g. automation of processes.

Quickly set up secure Remote Operations, Remote Assistance, and Remote Alarming for distributed endpoints with an easy-to-use, reliable, and scalable cloud IoT solution.


The diagram shows the core components and the basic workflow.

Create new Solutions with TeamViewer IoT

The TeamViewer IoT Agent API and the TeamViewer IoT SDKs enable advanced users to use the full potential of creating custom automation and commands to communicate with the devices and cloud services.

Scope and Intended Use #

Read this documentation before using any of the referenced products. Heed all safety notices.

Scope

This documentation describes the following products:

  • TeamViewer IoT Starter Kit (Dell Edge Gateway, Bosch Sensor XDK110, Power over Ethernet Wall Plug Adapter)
  • TeamViewer IoT Software Solution – for remote controlling a device and its connected parts

The TeamViewer IoT Starter Kit contains preconfigured hardware and software to implement your IoT use cases quickly.

Target groups

The products and their documentations address specific target groups. Each target group must have the specified knowledge level to fulfil the tasks and to handle all products safely.

Target groupKnowledge levelTasks
NoviceWindows, Web Browsersetup and remote control Starter Kit, setup rules
Advanced (additionally to Novice)C/C++/Python, Linux, networking basicssetup and remote control a custom device, automation

Glossary #

This glossary is intended to assist you when using this documentation.

Used Terms

Heed the terms below to enhance your experience with this documentation.

Term Description
Internet of Things (IoT) A system of interrelated computing devices, e.g. remote controlling a fridge or a coffee maker.
Edge Device (device) The hardware which runs the TeamViewer IoT Solution (e.g. Starter Kit, Raspberry Pi). It is connected to the sensors and actuators.
TeamViewer IoT Agent (agent) The software of the TeamViewer IoT Solution. It runs on the Edge Device. It manages the sensors and actuators and enables remote access via internet (e.g. TeamViewer IoT Management Console).
TeamViewer Client The software to access your Edge Device remotely.
TeamViewer IoT Management Console (Management Console) A software which runs in a web browser. It lists all your devices, connected sensors and many more information.
TeamViewer IoT Edge Management (Edge Management) Feature of the TeamViewer IoT Management Console. It provides real-time visualization of your devices, connected sensors and many more information.
TeamViewer IoT Real Time Rule Engine (Real Time Rule Engine) Feature of the TeamViewer IoT Management Console. It provides notifications and alerts when defined conditions (rules) are met.
File Transfer Feature of the TeamViewer IoT Management Console. It provides a graphical user interface to transfer files from and to edge devices.
Widget Displays your IoT data (e.g. chart, gauge) when Edge Management is enabled.
MQTT Message Queuing Telemetry Transport is an open lightweight, publish-subscribe network protocol that transports messages between your devices.
MQTT-Broker A MQTT system consists of multiple clients – publishers or subscribers – that are configured to communicate with a server (broker).
SDK The TeamViewer IoT Software Development Kit is a collection of software. It enables advanced users to create custom applications within the TeamViewer IoT Solution, e.g. automation of processes.
API The TeamViewer IoT Application Programming Interface is a computing interface which defines interactions between selected TeamViewer IoT software intermediaries.
AWS Amazon Web Services. An on-demand service for cloud computing.
OPC UA Open Platform Communications Unified Architecture is a machine to machine communication protocol for industrial automation.
Webhook A webhook is a method of augmenting or altering the behavior of a web page or web application with custom callbacks. The format is JSON. The request is done as a HTTP POST request.
JSON JavaScript Object Notation is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects (e.g. IoT data like temperature).
Endpoint The entry point to a service, a process, or a queue or topic destination in service-oriented architecture (e.g. a web page to use a webhook on).
GUI / gui Graphical User Interface (e.g. any visible element in your web browser and the web browser itself).
URL Uniform Resource Locator is a reference to a web resource that specifies its location on a computer network (e.g. https://www.teamviewer.com).
X11 X11 (X Window System) provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard.
Framebuffer The framebuffer is a portion of random-access memory containing a bitmap that drives a video display. With TeamViewer IoT, you can access the framebuffer of a edge device.
DIO Digital Input/Output
GPIO General Purpose Input/Output
APN Access Point Name is the name of a gateway between a GSM, GPRS, 3G or 4G mobile network and another computer network.
REST / RESTful Representational State Transfer is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services, provide interoperability between computer systems on the internet.
RSA Rivest–Shamir–Adleman is one of the first public-key cryptosystems and is widely used for secure data transmission.
MB Megabyte
GB Gigabyte
AES Advanced Encryption Standard is a specification for the encryption of electronic data.
SSH / ssh Secure Shell is a cryptographic network protocol for operating network services securely over an unsecured network.
CSR Certificate Signing Request is a message sent from an applicant to a certificate authority in order to apply for a digital identity certificate.

Used Formats

Heed the formats below to enhance your experience with this documentation.

Format Description / Usage
bold elements of the graphical user interface (e.g. button)
bold terms
emphasis highlighted text
monospace user input, file names, commands
teamviewer.com hyperlinks

For example: To save click OK.

For example: On the right side type into Filename the file name/var/etc/smb/smb.conf.

Notes and Tips

Heed this notice to avoid misuse of the software.
Follow this tip to learn a shortcut.

Command line

Commands to type in are displayed in a single line. You can copy and paste a given command when prompted.

ls -a

Some commands to type in are very long. They are displayed in a special box. The following example represents still one single line command. You can copy and paste the whole content when prompted.

mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/d43862fd65ac4a0f9054cfe1749cad82/metric/create -m "{"metrics" : [{"matchingId" : "1", "valueUnit": "NoSI.Dimensionless.PERCENT", "name" : "CPUUsage" },{"matchingId" : "2","valueUnit": "NoSI.Dimensionless.PERCENT", "name" :"CPUIdle" }, {"matchingId" : "3", "valueType" : "integer" , "valueAnnotation": "goods per minute", "name" : "ShopFloor1"}]}"

Source code / File contents

Source codes or file contents are displayed in multiple lines. You can copy and paste a given content when prompted.

#include 
#include 

int main() {
	std::cout<<"Hello World"<<std::endl;
	return 0;
}

Troubleshoot

Heed the section Troubleshoot (if any) to solve problems while using the product.

Features of this documentation

The following features are enabled to assist you. The use is optional.

  • Click the printer symbol () next to a heading to print the current documentation or to save it as PDF.
  • Click the hash symbol (#) next to a heading to get the link of the current section.

Starter Kit #

This section describes the TeamViewer IoT Starter Kit and its components in detail.

The TeamViewer IoT Starter Kit is a preconfigured edge device purchasable from TeamViewer.

See

Safety #

The following guidelines help ensure your safety and protect the device from damage. The list of guidelines might not address all potentially hazardous situations in your working environment, so be alert and exercise good judgment at all times.

  • Perform only the procedures explicitly described in the documentation for this device. Make sure that only authorized service personnel perform other system services.
  • Do not perform any actions that create a potential hazard to people or make the equipment unsafe.
  • Keep the area around the device clear and free from dust before, during, and after installation.

Edge Gateway (Starter Kit)

  • The Edge Gateway must be installed by knowledgeable, skilled persons familiar with local and/or international electrical codes and regulations.
  • The Edge Gateway is not designed for use in wet environments. If the Edge Gateway is to be installed in a wet environment, depending on the location and environment, it must be installed in a panel box or enclosure with an Ingress Protection (IP) rating of IP54, IP65, or higher.
  • To reduce the risk of electric shock, power to the DC+ and DC- terminals must be provided by a power supply or transformer/rectifier circuit that is designed with double-insulation. The power supply or power circuit source must comply with local codes and regulations; for example, in the USA, NEC Class 2 (SELV/limited energy circuit, or LPS circuitry). If powered by a battery, double-insulation is not required.
  • When installing the Edge Gateway, the responsible party or integrator shall use the 12-57 VDC or Power over Ethernet (PoE) power source 37-57 VDC, with a minimum of 13 W power already present as part of the client’s installation.
  • Ensure that the power source providing power to the Edge Gateway is reliably grounded and filtered such that the peak-to-peak ripple component is less than 10 percent of the input DC voltage.
  • When installing the Edge Gateway 3001 and 3002, use a cable appropriate for the load currents: 3-core cable rated 5 A at 90°C (194°F) minimum, which conform to either IEC 60227 or IEC 60245. The system accepts cables from 0.8 mm to 2 mm. The maximum operating temperature of the Edge Gateway is 70⁰C (158°F). Do not exceed this maximum temperature while operating the Edge Gateway inside an enclosure. Internal heating of the Edge Gateway electronics, other electronics, and the lack of ventilation inside an enclosure can cause the operating temperature of the Edge Gateway to be greater than the outside ambient temperature. Continuous operation of the Edge Gateway at temperatures greater than 70⁰C (158°F) may result in an increased failure rate and a reduction of the product life. Ensure that the maximum operating temperature of the Edge Gateway when placed inside an enclosure is 70⁰C (158°F) or less.
  • When installing the Edge Gateway 3003, use a cable appropriate for the load currents: 3-core cable rated 5 A at 90°C (194°F) minimum, which conform to either IEC 60227 or IEC 60245. The system accepts cables from 0.8 mm to 2 mm. The maximum operating temperature of the Edge Gateway is 60⁰C (140°F). Do not exceed this maximum temperature while operating the Edge Gateway inside an enclosure. Internal heating of the Edge Gateway electronics, other electronics, and the lack of ventilation inside an enclosure can cause the operating temperature of the Edge Gateway to be greater than the outside ambient temperature. Continuous operation of the Edge Gateway at temperatures greater than 60⁰C (140°F) may result in an increased failure rate and a reduction of the product life. Ensure that the maximum operating temperature of the Edge Gateway when placed inside an enclosure is 60⁰C (140°F) or less.
  • Always ensure that the available power source matches the required input power of the Edge Gateway. Check the input power markings next to power connector(s) before making connections. The 12-57 VDC (1.08-0.23 A) or the PoE power source must be compliant with local Electrical Codes and Regulations.
  • To ensure the protection provided by the Edge Gateway is not impaired, do not use or install the system in any manner other than what is specified in this manual.
  • If a battery is included as part of the system or network, the battery must be installed within an appropriate enclosure in accordance with local fire and electrical codes and laws.
  • The system is for installation in a suitable industrial enclosure (provides electrical, mechanical, and fire hazard protection).
  • The core module only can be wall-mounted (without the need for an additional enclosure).

Electrical

  • Inspect portable cord-and-plug connected equipment, extension cords, power bars, and electrical fittings for damage or wear before each use. Repair or replace damaged equipment immediately.
  • Use extension cords or equipment that is rated for the level of amperage or wattage that you are using.
  • Be aware that unusually warm or hot outlets or cords may be a sign that unsafe wiring conditions exists. Unplug any cords or extension cords from these outlets and do not use until a qualified electrician has checked the wiring.
  • Switch all products OFF before connecting them to a power supply.

Cleaning

  • Do not clean tools or products with flammable or toxic solvents.

Technical Data #

This section describes all technical data of the following products contained in the TeamViewer IoT Starter Kit:

Power over Ethernet Wall Plug Adapter #

The Power over Ethernet Wall Plug Adapter (POE) is used to connect the Edge Gateway with a power supply (e.g. wall socket).

See Attached Files to download the full documentation.

Safety Approvals

  • cUL / UL
  • CE
  • SAA
  • C-Tick

Diagram

units in mm (inch)

Dimensions and Weight

  • Length: 80mm (3.15in)
  • Width: 45mm (1.77in)
  • Height: 33mm (1.29in)
  • Weight: 95g (3.35oz.)
  • Data in/Output Connector: RJ45

Output Connections

  • Output Connection (Standard Model): +pin 4, 5 / -pins 7, 8
  • Output Connection (GigabitModel): +pin 3, 6 / -pins 1, 2

Output Specifications

DC Output VoltageLoad Min.Load Max.Regulation LineRegulation LoadOutput Power
56 V0 A0.275 A±4 %±4 %15.4 W

Characteristics

Input

AC Input Voltage Range90 to 264 VAC
AC Input Voltage Rating100 to 240 VAC
AC Input Current0.8 A (RMS) maximum for 90 VAC
0.5 A (RMS) maximum for 240 VAC
Leakage Current0.25 mA maximum @ 254 VAC, 60 Hz
AC Input Frequency47-63 Hz
AC Inrush Current15 A (RMS) maximum for 115 VAC
20 A (RMS) maximum for 230 VAC

Output

Total Output Power15.4 W
Ripple and Regulation150 mV maximum
Efficiency75 % (typical) at maximum load, and 120 VAC, 60 Hz
Transient O/P Voltage Protection60 V maximum at switch on/off at any AC line phase
Hold-up time16 mS minimum at maximum load and 120 VAC, 60 Hz

Environmental

TemperatureOperation: 0 to +40 °C
Non-operation: -25 to +65 °C
HumidityOperation: 5 to 90 %
EMCFCC Part 15 Class B
EN55022 Class B
Immunity EN50082-1ESD: EN61000-4-2. Level 3
RS: EN61000-4-3. Level 2
EFT: EN61000-4-4. Level 2
Surge: EN61000-4-5. Level 3
CS: EN61000-4-6. Level 2
Voltage Dips EN61000-4-11
Harmonic: EN61000-3-2 Class A
Isolation TestPrimary to Secondary: 3000 VAC for 1 second 10 mA
Insulation ResistancePrimary to Secondary: >10 M OHM 500 VDC

Attached Files

Dell Edge Gateway #

The Dell Edge Gateway 3001 is the preconfigured edge device of your TeamViewer IoT Starter Kit. It enables you to collect, secure, analyze, and act on data from multiple devices and sensors.

See Attached Files to download the full documentation.

Safety Approvals

  • CE
  • complies with FCC radiation exposure limits
  • complies with IC radiation exposure limits

Dimensions and Weight

Heigth125 mm (4.92 in)
Width125 mm (4.92 in)
Depth51 mm (2 in)
Weight1 kg (2.20 lb)
Volume0.80 L

Operating Conditions

Operating temperature range–With 0.7 m/s airflow: –30 °C to 75 °C (–22 °F to 167 °F)
–Without airflow: –30 °C to 70 °C (–22 °F to 158 °F)
Non-operating temperature rangeWith a maximum temperature gradation of 15 °C (59 °F) per hour:
–With 0.7 m/s airflow: –40 °C to 85 °C (–40 °F to 185 °F)
–Without airflow: –40 °C to 85 °C (–40 °F to 185 °F)
Humidity range (non-condensing)Operating: 10 % to 90 %
–With a maximum temperature gradation of 15 °C (59 °F) per hour
Non-operating: 5 % to 95 %
–With a maximum temperature gradation of 20 °C (68 °F) per hour
IP RatingIP 50
DC Supply Voltage12/24 V vehicle power system (12 V ~ 57 V wide DC input, ISO 7637-2 & SAE J1113 compliant)
Recommended DC Power Supply17 W (20 % derating)
PoE Supply Voltage48 V DC
Recommended PoE Power Supply12.95 W minimum according to Alternative A of IEEE 802.3af-2003 (standard)

Radio Frequency (RF) Exposure

This equipment complies with FCC and IC radiation exposure limits for an uncontrolled environment. This equipment should be installed and operated with a minimum distance of 20 cm between the active transceiver and your body.

Use only approved antenna(s). Non-approved antenna(s) may produce spurious or excessive RF transmitting power which may lead to a violation of FCC/IC limits.

Attached Files

Bosch Sensor XDK110 #

The Bosch XDK 110 Sensor Kit is a freely programmable sensor which provides eight 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.

See Attached Files to download the full documentation.

Safety Approvals

  • CE

Main Components

  • Bluetooth 4.0 low energy IEEE 802.15.1Wireless LAN IEEE 802.11b/g/n
  • 32-Bit microcontroller (ARM Cortex M3), 1MB Flash, 128 kB RAM
  • Internal Li-Ion rechargeable battery 560 mAh
  • Integrated antennas
  • Built-in sensors: accelerometer, acoustic sensor, digital light sensor, gyroscope, humidity sensor, magnetometer, pressure sensor, temperature sensor

Operating Conditions (Indoor use)

Operating temperature range-20 °C … 60 °C, (0 °C … 45 °C for battery charging)
Storage temperature range-20 °C … 60 °C
Humidity range10 … 90 %rH (non-condensing)
IP RatingIP 30 (IEC 60529)
Supply Voltage5 V DC

The battery lifetime of the sensor is up to 24 hours depending on environmental conditions like temperature.

Measurement Ranges

Accelerometer±2 … ±16 g (programmable)
Gyroscope±125 °/s … ±2000 °/s (programmable)
Magnetic field strength±1300 μT (X,Y-Axis); ±2500 μT (Z-Axis)
Light sensor0.045 lux … 188,000 lux ; 22-bit
Temperature-20 °C … 60 °C
[limited by operating system conditions]
Pressure300 … 1100 hPa
Humidity10 … 90 %rH (non-condensing)
[limited by operating system conditions]

Sampling Rate

Accelerometer BMA2802000 Hz
Gyroscope BMG1602000 Hz
Magnetometer BMM150300 Hz
Hum./Press./Temp. BME280182 Hz
Inertial Measurement Unit BMI1601600 Hz (Accelerometer)
3200 Hz (Gyroscope)

LED Indicators

The sensor has 4 LEDs on the top side. Each LED indicates a different status.

LEDDescription
GreenCharging indicator. Light is on when the sensor is connected to a power source and the internal battery is charging.
YellowFlashes when the sensor data is transmitted to the edge device.
OrangeBlinking while it tries to connect to the edge device.
RedBlinking while the sensor is connecting to the TeamViewer IoT Service.
Light is on when it is connected.

Troubleshoot

The LED patterns indicate problems with the sensor. Heed the table below and take action.

PatternDescriptionAction
No LED is onThe internal battery is empty. Connect the sensor to a power source.
Green LED is off, but the power source is connectedThe battery is fully charged.
Orange LED is constantly blinkingThe edge device is not powered.Connect the edge device to a power source and restart the edge device.
The edge device is powered.Move the sensor closer to the edge device and restart the edge device and the sensor.
Red LED is on, Yellow  LED not flashingNo data is received from the sensor on the dashboards.Restart the sensor.

Attached Files

Set up the Starter Kit #

Before you begin any of the procedures in this section heed the information in the section Safety.

What you will

Make sure that you have prepared the following points:

  • Your TeamViewer credentials. You received them per E-Mail upon ordering the Starter Kit.
  • The TeamViewer Client is installed.
    Visit https://www.teamviewer.com/ to download the application.
  • A working local network with router.
  • Multiple USB power supplies – one for each sensor (5 V, 3 A).

The Starter Kit arrives in a “ready-to-use” state. No further installation of software is needed.

Set up the Starter Kit

Set up the Dell 3001 edge gateway and ensure it is connected to an internet router:

  1. Mount the Wi-Fi antenna to the right side of the gateway .
  2. Connect your router with one Ethernet cable .
  3. Connect that Ethernet cable with the IN female connector of the included PoE power supply .
  4. Connect the OUT connector of the PoE supply via the second Ethernet cable with the Dell 3001 edge gateway .
  5. Plug the PoE supply into your wall socket.

Connect the Sensors to the Starter Kit

  1. Choose a proper location for your Bosch XDK110 sensors .
Minimize disturbing effects on your measurements, e.g. avoid exposing your sensor to sun light when measuring temperature or brightness.
  1. Connect each sensor with a USB cable and plug them into USB power supplies (not included).
  2. Switch the sensors ON . Your Starter Kit is now active and pushes sensor data to the TeamViewer IoT Cloud.

The Starter Kit is now ready to use. Use the IoT Management Console to verify it is working correctly.

Enable GPS receiver on the Starter Kit #

The TeamViewer IoT Starter Kit contains a built-in GPS receiver.

What you will need

Make sure that you have prepared the following points:

Enable

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Install the needed dependencies for python. In the terminal type in the following commands and press return:
sudo apt-get update
sudo apt-get install -y python3-pip
  1. Download the Starter Kit configuration package. In the terminal type in the following commands and press return:
wget -q https://download.teamviewer-iot.com/teamviewer-iot-kit/v2.0.1/teamviewer_iot_kit-2.0.1-py3-none-any.whl
sudo -H pip3 install teamviewer_iot_kit-2.0.1-py3-none-any.whl
  1. Configure the location receiver. In the terminal type in the following command and press return.
sudo teamviewer-iot-kit -e location_receiver
  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. Check that you enabled the GPS. From the left menu select Inventory and on the right side from the drop-down-menu select Metrics.

After the GPS receiver has been enabled you can visualize its data with a widget.

More Information

  • The GPS data is NMEA 0183 formatted and packed into a JSON object called NMEA 0183: TPV. In the “Metrics” tab you will find the data in the raw format as well as dedicated metrics for each parameter.
  • The location receiver provides the NMEA 0183: SKY object as well which is not presented in the Starter Kit. From that object, two metrics are being calculated and presented separately with the names In View and Used.

The table represents all the available parameters/metrics and their descriptions of the location receiver.

Metric/Parameter Always Datatype Description
Time No string Time/date stamp in ISO8601 format, UTC. May have a fractional part of up to .001sec precision. May be absent if the mode is not 2 or 3.
NMEA 0183: TPV Yes string NMEA 0183 formatted JSON data of the TPV class.
Mode Yes numeric NMEA mode: %d, 0=no mode value yet seen, 1=no fix, 2=2D, 3=3D.
Estimated timestamp error No numeric Estimated timestamp error in seconds. Present if time is present.
Latitude No numeric Latitude in degrees: +/- signifies  North/South.  Present  when the mode  is 2 or 3.
Estimated latitude error No numeric Latitude error estimate in meters. Present if the mode is 2 or 3 and DOPs can be calculated from the satellite view.
Longitude No numeric Longitude in degrees: +/- signifies East/West. Present when the mode is 2 or 3.
Estimated longitude error No numeric Longitude error estimate in meters. Present if the mode is 2D or 3D and DOPs can be calculated from the satellite view.
Altitude No numeric Altitude in meters. Present if the mode is 3.
Estimated vertical error No numeric Estimated vertical error in meters. Present if the mode is 3 and DOPs can be calculated from the satellite view.
Speed No numeric Speed over ground, meters per second.
Estimated speed error No numeric Estimated speed error in meters per second. Present for consecutive 2D or 3D fixes.
Climb No numeric Climb (positive) or sink (negative) rate, meters per second.
Estimated vertical error No numeric Estimated climb error in meters per second. Present if consecutive 3D fixes.
Track No numeric Course over ground, degrees from true north.
In View No numeric Number of satellites which are in view of the location receiver.
Used No numeric Number of satellites to which the location receiver is locked.

Enable mobile internet connectivity with SIM-Card on the Starter Kit #

The edge device of the TeamViewer IoT Starter Kit has a built-in modem (4G).

What you will need

Make sure that you have prepared the following points:

Unlock the SIM card with the edge device

You can use your phone to unlock a SIM card. Heed the instructions of your phone for more information.
  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Edit the SIM configuration. In the terminal type in the following command and press return.
sudo nano /etc/systemd/system/pinunlock.service
  1. When the nano editor opens, copy and paste the following text. Replace **** with your pin.
[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
  1. Save the file and exit nano.

Enable mobile internet connectivity

  1. Unlock the SIM card.
  2. Insert the SIM card into the edge device.
  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Check the type of the inbuilt modem. In the terminal type in the following command and press return.
sudo mmcli -L
  1. Depending on the output of the last command use one of the following instructions:

X7 LTE DW5818 modem

Type in each command and press enter. Replace ConnectionName with a meaningful name for the connection. Replace APN with an APN of your service provider.

sudo nmcli c add type gsm ifname cdc-wdm0 con-name ConnecctionName> apn 
sudo reboot

MBIM modem

Type in each command and press enter. Replace ConnectionName with a meaningful name for the connection. Replace APN with an APN of your service provider.

sudo mmcli -m 0
sudo nmcli c add con-name  type gsm ifname cdc-wdm0 apn 
sudo nmcli r wwan
sudo nmcli c up 
sudo reboot

The edge device reboots. To check the mobile internet connectivity disconnect the edge device from WLAN and LAN and access the edge device remotely.

Reassign the Starter Kit to another TeamViewer Account #

Use this procedure to move the TeamViewer Starter Kit from the preassigned account to another TeamViewer Account.

This procedure contains 3 basic steps:

  1. Unmanage and Reassign the Starter Kit
  2. Reconfigure the Digital Inputs/Outputs
  3. Apply the Reconfiguration and Restart

What you will need

Make sure that you have prepared the following points:

Unmanage and Reassign the Starter Kit

When unmanaging the Starter Kit, it is no longer available for your old TeamViewer Account.
  1. Log in to the Starter Kit and use your credentials by using a ssh-tool.
  2. Unmanage the Starter Kit. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent unmanage
  1. Assign the Starter Kit to the new TeamViewer Account. In the terminal, type in the following command and press return. Use your new TeamViewer Account credentials when prompted.
sudo teamviewer-iot-agent setup
  1. Restore the configuration of the Monitoring Agent for the Bosch XDK sensors. In the terminal type in the following commands and press return.
sudo teamviewer-iot-agent disable system-health
sudo su
sudo cat /var/lib/teamviewer-iot-agent/system_monitors_kit.conf > /var/lib/teamviewer-iot-agent/system_monitors.conf
sudo teamviewer-iot-agent enable system-health

Reconfigure the Digital Inputs/Outputs

To use the Digital Inputs/Outputs (DIOs) of the Starter Kit with the TeamViewer IoT Agent, you need to create corresponding Sensors/Metrics.

  1. To log in to the IoT Management Console, open a web browser. Navigate to the IP address of the Starter Kit (obtained by Get the IP Address of the Edge Device / IoT Agent).
  2. From the left menu select API Clients.
  1. As client name type in Digital Out then click Create.
  1. Click Manage API Client.
  2. Click New Sensor and name it Digital Outputs.
  3. Click to add 8 metrics. Name the metrics Out 0 to Out 7. Set each Value Type to Bool and set each Display Unit to I/O. For example:
  1. Optional: When a metric becomes superfluous, click  to remove it.
  2. To finish click Create.

You will be provided with new connector, sensor and metric Ids. For example:

Keep this window open. You need these Ids in the step Apply the Reconfiguration and Restart.

Apply the Reconfiguration and Restart

You need the provided Ids from the step Unmanage and Reassign the Starter Kit.

  1. Access the Starter Kit remotely (Access the Edge Device via Remote Terminal).
  2. Open the teamviewer_gpio.py file with the editor nano. In the terminal type in the following command and press return.
sudo nano teamviewer_gpio.py
  1. Replace the client_id, sensor_id and Out0_id to Out7_id on the top of the file with corresponding Ids obtained in step Unmanage and Reassign the Starter Kit. For 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"
  1. Save the file and close the nano editor.
  2. Restart the service for the General Purpose Inputs/Outputs (GPIOs). In the terminal, type in the following command and press return.
sudo service teamviewer_gpio restart
  1. Verify that the DIOs are configured correctly. In the IoT Management Console navigate to Dashboard.
  2. Pin (see Add a Widget) the Out0_id to Out7_id metrics to the dashboard. Configure each as a Control with Toggle-Switch function. Use true and false for the control values. For example:

Disposal #

In August of 2005, the European Union (EU) implemented the EU WEEE Directive 2002/96/EC and later the WEEE Recast Directive 2012/19/EU requiring Producers of electronic and electrical equipment (EEE) to manage and finance the collection, reuse, recycling and to appropriately treat WEEE that the Producer places on the EU market after August 13, 2005. The goal of this directive is to minimize the volume of electrical and electronic waste disposal and to encourage re-use and recycling at the end of life.

TeamViewer GmbH has met its national obligations to the EU WEEE Directive by registering in those countries to which TeamViewer GmbH is an importer. TeamViewer GmbH has also elected to join WEEE Compliance Schemes in some countries to help manage customer returns at end-of-life.

If you have purchased TeamViewer GmbH-branded electrical or electronic products in the EU and are intending to discard these products at the end of their useful life, please do not dispose of them with your other household or municipal waste. TeamViewer GmbH has labeled its branded electronic products with the WEEE Symbol (see figure) to alert our customers that products bearing this label should not be disposed of in a landfill or with municipal or household waste in the EU. Instead, please be aware that TeamViewer GmbH is making a return and collection system available to you, free of transportation and recycling costs, for discarding these products.

Products in the Starter Kit

Heed all information about disposal of each product in the Starter Kit.

Installation #

This section describes the step-by-step installation via the TeamViewer IoT Management Console.

For information on installing the TeamViewer IoT Solution on designated hardware see Installation on designated Hardware.

System Requirements #

The TeamViewer IoT solution has been verified to be compatible with the following platforms / operating systems.

TeamViewer IoT Agent

Platform Operating System / Kernel Example Devices TeamViewer IoT Agent Version
ARMv7 HFRaspbian Jessie 4.9
Raspbian Stretch 4.9
Raspbian Stretch 4.14
Raspberry PI II,III
Samsung Artik 530S
1.1.46- Latest
ARMv7 elRaspbian Jessie 4.9
Raspbian Stretch 4.9
Raspbian Stretch 4.14
1.1.102- Latest
ARMv5 HFRaspbian Jessie 4.9
Raspbian Stretch 4.9
Raspbian Stretch 4.14
Raspberry PI1.1.46- Latest
ARMv5 elRaspbian Jessie 4.9
Raspbian Stretch 4.9
Raspbian Stretch 4.14
1.1.102- Latest
Intel x86-64 (AMD64)Ubuntu 16.04 LTS
Ubuntu 17.10.1
CentOS 7.5.1804
Intel 64 Bit PCs
Windows Subsystem for Linux (WSL) via TeamViewer IoT for Windows Subsystem for Linux (WSL)
1.1.102- Latest
Intel x86-32 (i386)Ubuntu 16.04 LTS
Ubuntu 17.10.1
CentOS 7.5.1804
Intel 32 Bit PCs
Windows Subsystem for Linux (WSL) via TeamViewer IoT for Windows Subsystem for Linux (WSL)
1.1.102- Latest

TeamViewer IoT Cloud – Browser Compatibility

BrowserVersion
Chromeversions released within last 6 months
Firefoxversions released within last 6 months
Edgeversions released within last 6 months
Internet Explorer11 (or newer)
Safariversions released within last 6 months

TeamViewer IoT Client for Remote Access

TeamViewer IoT Remote Access is currently available via TeamViewer Client v13.1 (or newer) for Windows.

Internet Explorer 11  (or newer) is required.

Install the IoT Agent on a Device #

The TeamViewer IoT Agent is needed to enable remote access to devices via internet. Installing it is a prerequisite to all remote access and monitoring processes.

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Inventory then click Add Device.
  3. Depending on your operating system, select the correct installation package.
  1. Select a Group or create a new Group for your device.
  2. Follow one of these steps depending on your previously selected  operating system:
Operating SystemSteps
GNU/Linux and OtherConnect to the device and execute the displayed code. Follow the instructions while installing.
WindowsDownload TeamViewer IoT for Windows and install the software. Follow the instructions while installing.

The device is automatically added to the Inventory and can be identified by its hostname. It is placed in the selected Group.

Watch How to Set Up Your First Endpoint

This 2-minute video shows you just how simple it is to connect your first IoT Endpoint with your TeamViewer IoT account.

Installation on designated Hardware #

This section describes the installation of the TeamViewer IoT Solution on designated hardware like:

Easy Installation on Raspberry devices #

The section describes the installation of the TeamViewer IoT Solution on an empty Raspberry (without operating system).

What you will need

Make sure that you have prepared the following points:

  • A Raspberry (see System Requirements) connected to keyboard and monitor.
  • A properly formatted micro SD card (Minimum 32 GB).
  • Your TeamViewer credentials.
  • A disk image creation tool is installed on your local PC (e.g. Win32 Disk Imager).
  • The Raspberry is connected to the internet.
If you cannot use Wi-Fi make sure to connect your Raspberry with LAN cable to the internet.

Setup

  1. Download one of the following archives:
  2. Extract the image from the archive.
  3. Use the disk image creation tool to write the image to the micro SD card.
  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Inventory.
  3. On the left side from the drop-down-menu Add select Device.
  4. Select the operating system Linux.
  5. Select the distribution Debian.
  6. Select your Raspberry version.
  1. Select Create an OS image with TeamViewer IoT.
  2. Configure the operating system:
    • Input the Host Name
    • Optional: Input the Wi-Fi Network Name (SSID) the Wi-Fi Password and select a Wi-Fi Country
    • Select a Group from your Contacts List.
  1. Click Download Configuration and save the archive.
  2. Extract the contents of the archive into the /boot folder on the micro SD card.
  1. Insert the micro SD card into the Raspberry.
  2. Boot the Raspberry.

Set up a Yocto Image for Raspberry #

The Yocto Project enables the creation of custom Linux-based systems for embedded devices.

The TeamViewer IoT Agent will run on Yocto Linux devices given minimum requirements and configurations are met.
This article is an example how to build Yocto Image with TeamViewer IoT Agent for Raspberry using the layer provided in GitHub.

For more information visit Information see https://github.com/teamviewer/meta-teamviewer-iot-agent.

When using ssh with the built image, the username is “root” and the password is “raspberry”.

What you will need

Make sure that you have prepared the following points:

  • The edge device is set up with a TeamViewer IoT Agent.
  • The edge device is connected to the internet.
  • Your PC is set up with the TeamViewer Client.
  • Your login credentials for the edge device (user name, and password).
  • Installed dependencies (based on operating system of Raspberry). For more information see Required Packages for the Build Host.

Setup

  1. On your PC open the TeamViewer Client and log in.
  2. On the left side open the Computers & Contacts tab.
  3. Double-click the device.
    The Control Window opens and the connection will be established.
  4. In the Control Window on the top open the Remote Terminal tab.
  5. Type in your user password and press enter.
  6. Clone the poky project’s zeus branch. In the terminal type in the following command and press return.
git clone --branch=zeus git://git.yoctoproject.org/poky.git && cd poky
  1. Clone the Raspberry and the TeamViewer IoT Agent meta-packages. In the terminal type in the following commands and press return:
git clone --branch=zeus git://git.yoctoproject.org/meta-raspberrypi
git clone --branch=zeus https://github.com/teamviewer/meta-teamviewer-iot-agent
  1. Configure the environment. In the terminal type in the following command and press return.
source oe-init-build-env
  1. Add layers to bitbake. In the terminal type in the following commands and press return:
bitbake-layers add-layer ../meta-raspberrypi
bitbake-layers add-layer ../meta-teamviewer-iot-agent
  1. Change the target machine on the configuration file and set init manager to systemd. In the terminal type in the following commands and press return:
echo 'MACHINE = "raspberrypi3"' >> conf/local.conf
echo 'DL_DIR = "${TOPDIR}/downloads"'   >> conf/local.conf
echo 'CONNECTIVITY_CHECK_URIS = "https://www.google.com/"' >> conf/local.conf
echo '#Set Systemd to Init Manager' >> conf/local.conf
echo 'DISTRO_FEATURES_append = " systemd"' >> conf/local.conf
echo 'DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"' >> conf/local.conf
echo 'VIRTUAL-RUNTIME_init_manager = "systemd"' >> conf/local.co
  1. Append ssh and TeamViewer IoT Agent layer. In the terminal type in the following commands and press return. Type in user name and password when prompted.
echo '#Append TeamViewer IoT agent layer' >> conf/local.conf
echo 'IMAGE_INSTALL_append += " teamviewer-iot-agent"' >> conf/local.conf
echo 'IMAGE_ROOTFS_EXTRA_SPACE ?= "50000"' >> conf/local.conf
echo 'CORE_IMAGE_EXTRA_INSTALL += "openssh"' >> conf/local.conf
echo 'INHERIT += "extrausers"' >> conf/local.conf
echo 'EXTRA_USERS_PARAMS = "usermod -P raspberry root;"' >> conf/local.conf
  1. Optional: Install Xvfb server (see Set up the Remote Screen via X11) on the edge device to be able to use X11 features. In the terminal type in the following command and press return. Type in user name and password when prompted.
echo '#X11' >> conf/local.conf
echo 'DISTRO_FEATURES_append += " X11"' >> conf/local.conf
  1. Optional: Enable Edge Management on the edge device. In the terminal type in the following commands and press return. Type in user name and password when prompted.
git clone --branch=zeus git://git.openembedded.org/meta-openembedded ../meta-openembedded
git clone --branch=zeus git://git.yoctoproject.org/meta-virtualization ../meta-virtualization
sed -i '$d' conf/bblayers.conf
echo '  ${TOPDIR}/../meta-openembedded/meta-oe ' >> conf/bblayers.conf
echo '  ${TOPDIR}/../meta-openembedded/meta-multimedia ' >> conf/bblayers.conf
echo '  ${TOPDIR}/../meta-openembedded/meta-networking ' >> conf/bblayers.conf
echo '  ${TOPDIR}/../meta-openembedded/meta-python ' >> conf/bblayers.conf
echo '  ${TOPDIR}/../meta-openembedded/meta-filesystems ' >> conf/bblayers.conf
echo '  ${TOPDIR}/../meta-virtualization ' >> conf/bblayers.conf
echo '  "' >> conf/bblayers.conf
bitbake-layers show-layers
echo '#Docker layer for supporting Edge services' >> conf/local.conf
echo 'DISTRO_FEATURES_append += " virtualization"' >> conf/local.conf
echo 'IMAGE_ROOTFS_EXTRA_SPACE = "400000"' >> conf/local.conf
  1. Start the build type. In the terminal type in the following command and press return. Type in user name and password when prompted.
bitbake core-image-minimal

You can find target image tmp/deploy/images/raspberrypi3/ here with core-image-minimal-raspberrypi3 prefix. In case of failure or new bash (terminal) creation, after all steps executed you need to go to project’s directory and start again from step 8 Configure Environment.

IoT Agent #

The TeamViewer IoT Agent is the software which connects your edge device with your TeamViewer account.

The TeamViewer IoT Agent is needed to enable remote access and other services to devices via internet. Installing the agent is a prerequisite to all remote access and monitoring processes.

Once set up and assigned to a TeamViewer account you can access the IoT Agent and the edge device remotely.

For more information see:

Check the Version of the IoT Agent #

In case you want to contact the TeamViewer Support, it is helpful to know the concerning agent version.

What you will need

  • The edge device is set up with a TeamViewer IoT Agent.
  • The edge device is connected to the internet.
  • Your PC is set up with the TeamViewer Client.
  • Your login credentials for the edge device (user name, and password).

Access

  1. On your PC open the TeamViewer Client and log in.
  2. On the left side open the Computers & Contacts tab.
  3. Double-click the device.
    The Control Window opens and the connection will be established.
  4. In the Control Window on the top open the Remote Terminal tab.
  5. Type in your user password and press enter.
  6. Identify the version of your agent. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent info

Update the IoT Agent #

The latest version of the TeamViewer IoT Agent will be available for download via TeamViewer IoT Cloud. 

Installing a newer version of the agent will not delete any of your devices or provisioned data.

What you will need

Make sure that you have prepared the following points:

Automatic Update

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Get the most recent repository information. In the terminal type in the following command and press return.
sudo -E apt-get update
  1. Download and install the update. In the terminal type in the following command and press return.
sudo -E apt-get install teamviewer-iot-agent

The new version replaces the existing IoT Agent. It will start automatically.

Manual Update

Follow the steps outlined in installation.

The new version replaces the existing IoT Agent. It will start automatically.

Get the IP Address of the Edge Device / IoT Agent #

This procedure is helpful when you need the IP address of your Edge Device / IoT Agent.

What you will need

Make sure that you have prepared the following points:

Get the IP Address

Write the IP address down.
  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. In the terminal type in the following command and press return.
ifconfig

The IP address is displayed in the section eth0. For example inet addr:192.168.1.128:

 eth0      Link encap:Ethernet  HWaddr 00:0F:20:CF:8B:42
           inet addr:192.168.1.128  Bcast:  Mask:255.255.255.192
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:2472694671 errors:1 dropped:0 overruns:0 frame:0
           TX packets:44641779 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000

Mass Remote Configuration of IoT Agents #

The Mass Remote Configuration allows you to assign IoT Agent settings from one Edge Device to one or more other Edge Devices. For example, enabling the Edge Management on all your devices without connecting to them single-handedly.

Follow the 2 basic steps:

  1. Create a Settings Template.
  2. Assign the Settings Template to Edge Devices.

You also can edit existing Settings Templates and unassign or change groups or single Edge Devices.

What you will need

Make sure that you have prepared the following points:

  • Your TeamViewer credentials.
  • The edge device is connected to the internet.
  • All edge devices are set up with a TeamViewer IoT Agent (Version 2.9 or newer).

Create a Settings Template

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Settings Template.
  3. On the right side click Create Template.
  1. Type in a unique template name.
  2. Click to add a configuration. (When a configuration becomes superfluous click to remove it.)
  3. Adjust the configuration to your requirements.
  1. To finish click Create.

Assign the Settings Template to Edge Devices

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Settings Template.
  3. On the right side choose the Settings Template you want to assign to other Edge Devices. From the dropdown menu select Assign.
  1. In the popup select the groups or single Edge Devices which you want to receive the Settings Template.
  1. To send the Settings Template to the Edge Devices click Save.

Depending on the edge device performance, you need to allow some time for the Settings Template to assign to the device.

Upon assigning to a group, all eligible devices within the group will receive the template assignment as well.

Devices with unsupported IoT Agent Version as well as shared devices will be visible in the list, but you will receive an appropriate warning message.

Edit an existing Settings Template

At any time, you can edit the settings for a template. After each modification, all assigned devices will receive an updated assignment.

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Settings Template.
  3. On the right side choose the Settings Template you want to edit. From the dropdown menu select Edit.
  4. Adjust the configuration to your requirements.
  5. To finish click Save.

Depending on the edge device performance, you need to allow some time for the Settings Template to assign to the device.

Unassign Settings Template from Edge Devices

At any time, you can modify the settings for a template. After each modification, all assigned devices will receive an updated assignment.

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Settings Template.
  3. On the right side choose the Settings Template you want to edit. From the dropdown menu select Assign.
  1. In the popup remove the groups or single Edge Devices from the selection which you want to unassign.
  1. To finish click Save.

Changing Device Group to Receive Settings Template

Once a Settings Template is assigned to a group, user can assign Group’s template to any edge device by adding it to that group.

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Inventory.
  3. On the right side choose the Edge Device for which you want to change its group. From the dropdown menu select Properties.
  1. In the popup from the dropdown menu select the new group.
  2. Activate the field Inherit Group Setting Configurations.
  1. To finish click Save.

Depending on the edge device performance, you need to allow some time for the Settings Template to assign to the device.

Assigning Edge Devices to Your TeamViewer Account at scale (Mass Deployment) #

The journey of the IoT user starts from assigning his edge device to the cloud and the assignment process should be as simple as possible.

The assignment of a single device is mostly done for testing purposes or when evaluating the solution. The time spent on the assignment will not have a significant impact. But when dealing with a big project mostly you have a bunch of devices that should be assigned to the account. This procedure will shorten the time spent on the assignment process up to even without touching the device.

The TeamViewer IoT Cloud offers assignments via token functionality which can be used both for single device assignment and for assigning hundreds or thousands of devices securely.

How it works

For each TeamViewer Account, a unique assignment token is being generated. The assignment token can be used only for the device assignment to the account.

During the assignment process, the device connects to TeamViewer IoT Cloud and presents its assignment token. The assignment service receives the token and connects the device to the account to which the token belongs.

Starting from that moment the edge device continues to work with the assigned account.

What you will need

Make sure that you have prepared the following points:

When assigning a TeamViewer IoT Starter Kit this procedure will only work with Starter Kit Version 2 (or newer). For more information see the Owners Manual.
  • The edge device is set up with a TeamViewer IoT Agent.
  • Your login credentials for the edge device (user name, and password).
  • Your TeamViewer credentials.
  • A tool to access the edge device remotely via ssh (e.g. Putty).

Assign the Edge Devices to Your TeamViewer Account

Assigning the Edge Device will override existing assignments.
  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the top menu click Assignment token.
  1. In the popup click Reveal to see the token.
Remember the token (TOKEN).
  1. Log in to the Edge Device and use your credentials by using a ssh-tool.
  2. Assign the Edge Device to your TeamViewer Account. In the terminal type in the following command and press return. Replace TOKEN with the token from the previous step.
sudo teamviewer-iot-agent assign -t TOKEN --accept-license
For mass deployment of Edge Devices, this command needs to be configured to run once when the device boots.

Set up Remote Client to integrate your IoT Network #

The TeamViewer IoT Agent acts as a centralized hub bringing the TeamViewer IoT solution to your IoT network. To securely integrate your IoT devices and sensors, you must create trusted Clients (see TeamViewer IoT Agent MQTT API) which can communicate with the TeamViewer IoT Agent.

Remote Clients allows you to extend your clients to trusted remote devices rather than being limited to the localhost (the device hosting the agent).  The following procedure will illustrate how to enable Remote Clients and how to use the TeamViewer IoT Agent MQTT API to remotely create clients and send your sensor data for monitoring and visualization.

Caution: Enabling Remote Clients will allow any device on your local area network to initiate Client certificate generation. It is strongly encouraged to Disable Remote Client Provisioning & Remote Client Data connections when not in use.

What you will need

Make sure that you have prepared the following points:

Setup

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Enable Remote Connections. In the terminal type in the following command and press return.
teamviewer-iot-agent enable remoteClientProvision
  1. From your Edge Device, create a client by generating a trusted certificate.
    • For more information see TeamViewer IoT Agent MQTT API.
    • Replace localhost with the hostname of the device running the TeamViewer IoT Agent in the publish/subscribe examples.
    • Copy the Trusted CA Cert TeamViewerAuthority.crt, referenced in the publish/subscribe examples, to the Edge Device.
  2. Once your Client has been created, disable the Remote Client Provisioning access to prevent unauthorized access from other hosts on the network.  Disabling Remote Client Provisioning only allows certificate based secure access from remote hosts. In the terminal type in the following command and press return.
teamviewer-iot-agent disable remoteClientProvision
  1. Enable remote data for clients to securely connect to the TeamViewer IoT Agent to send data. In the terminal type in the following command and press return.
teamviewer-iot-agent enable remoteData
  1. From your Edge Device, securely register metrics and push data to the TeamViewer IoT Agent.
    • For more information see TeamViewer IoT Agent MQTT API.
    • Replace localhost with the hostname of the device running the TeamViewer IoT Agent in the publish/subscribe examples.
  2. To provision additional remote clients enable the Remote Client Provisioning. In the terminal type in the following command and press return.
teamviewer-iot-agent enable remoteClientProvision

Disable Remote Client Provisioning

For security purposes, disable the Remote Client Provisioning access to prevent unauthorized access from other hosts on the network. Disabling Remote Client Provisioning only allows certificate based secure access from remote hosts.

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. In the terminal type in the following command and press return.
teamviewer-iot-agent disable remoteClientProvision

Disable Remote Data

For security purposes, when remote connections are no longer needed for Clients to send data, disable Remote Data.

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. In the terminal type in the following command and press return.
teamviewer-iot-agent disable remoteData

Disable Remote Clients

For security purposes, when remote connections are no longer needed for client provisioning or sending data, disable all Remote Connections.

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. In the terminal type in the following command and press return.
teamviewer-iot-agent disable remoteClients

IoT Management Console #

You can log in to the IoT Management Console. The IoT Management Console lists all your devices, connected sensors and many more information.

To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.

The IoT Management Console has 3 sections. The left menu , the top menu and the main screen .

Using the IoT Management Console #

Hide Menus

Hiding the left menu is helpful e.g. when you want to increase the displayed size of the main screen for presentations.

From the left menu click the menu symbol to show or hide the menu.

Change the Display Language

From the top menu select a language.

Log out

From the top menu click your user name then click Log out.

Edge Management #

The TeamViewer IoT Edge Management feature provides real-time visualization of the device, includes a user-friendly GUI for managing and monitoring sensors, metrics and MQTT API clients. Also allows building GUI to control sensors and actuators remotely.

Edge Management is an extension to the TeamViewer IoT Agent.

After the Edge Management is enabled, you can use TeamViewer Client to remotely create secure applications, register sensors and metrics, and view real-time streaming data.

Remote control of edge devices is only supported by TeamViewer Client for Windows.

Enable the Edge Management #

The TeamViewer IoT Edge Management feature provides real-time visualization of the device, includes a user-friendly GUI for managing and monitoring sensors, metrics and MQTT API clients. Also allows building GUI to control sensors and actuators remotely.

Docker engine will be installed automatically if it is not found on the device.

For more information on Docker see https://www.docker.com/.

What you will need

Make sure that you have prepared the following points:

Enable

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent install edge-management
  1. To start the application on default port 80, type in the following command and press return.
sudo teamviewer-iot-agent start edge-management

Update the Edge Management #

Update the Edge Management to keep the application secure.

What you will need

Make sure that you have prepared the following points:

Update

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Update the Edge Management. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent update edge-management

Disable the Edge Management #

What you will need

Make sure that you have prepared the following points:

Disable

Disabling Edge Management on the edge device will also disable rules (alarms/notifications) and other features of the edge device.
  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Disable the Edge Management. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent uninstall edge-management

Configure the Edge Management #

What you will need

Make sure that you have prepared the following points:

Change Port

To change the default port you need to restart the Edge Management.

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Stop the Edge Management. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent stop edge-management
  1. Restart the Edge Management. In the terminal type in the following command and press return. Replace the value 8080 to your preferred port.
sudo teamviewer-iot-agent start edge-management --port=8080

Remote Control #

The TeamViewer IoT Solution enables you to access your edge device remotely.

There are several ways to access your edge device remotely:

The access via Remote Screen and its control depends on the setup of the remote control feature on the edge device:

Feature Description
X11 (interactive) See what is displayed on the edge device and control it. This is helpful to gain remote control e.g. for maintenance (see Set up the Remote Screen via X11).
Framebuffer (non-interactive) See what is displayed on the edge device. This is helpful to monitor a user while he is working with the edge device (see Set up the Remote Screen via Framebuffer).

Set up the Remote Screen via X11 #

The Remote Screen via X11 allows you to see what is displayed on the screen of the edge device and to control it. This is helpful to maintain the device without connecting a monitor or other peripherals.

Using this feature disables the Remote Screen to monitor.

What you will need

Make sure that you have prepared the following points:

Setup

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Install the virtual framebuffer. Type in the following command and press return.
sudo apt update && sudo apt install xvfb -y
  1. Run the virtual framebuffer with a display port 1 resolution of 1280x1024 pixels and a color depth of 24 bit. Type in the following command and press return.
Xvfb -ac :1 -screen 0 1280x1024x24 & 
  1. To run the virtual framebuffer on every reboot of the edge device modify the global crontab file with the nano editor.
sudo nano /etc/crontab
  1. Add the following lines at the end of the file:
#X virtual desktop
@reboot pi Xvfb -ac :1 -screen 0 1280x1024x24
  1. Save the file and close the nano editor.
  2. To use the display port on every login to the edge device modify the personal session file with the nano editor.
sudo nano /home/pi/.bashrc
  1. Add the following lines at the end of the file:
#run export display
export DISPLAY=:1
  1. Save the file and close the nano editor.
  2. Activate the modifications. Type in the following command and press return.
source ~/.bashrc
  1. Restart the TeamViewer IoT Agent. Type in the following commands and press return:
sudo teamviewer-iot-agent configure set -p [int32] EnableRemoteScreen 1
sudo teamviewer-iot-agent configure set -p [strng] RemoteScreenChannels "X11"
sudo teamviewer-iot-agent restart

The setup is complete. You can access the edge device with your TeamViewer Client now.

When accessing the edge device, the user who works on said device gets a notification. You can customize the notification.

Troubleshoot

No screen / the wrong screen is displayed

After accessing the edge device via TeamViewer client no screen or the wrong screen is displayed.

This occurs when your device uses multiple displays.

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Replace 12 with the correct display number. Type in the following commands and press return:
sudo teamviewer-iot-agent configure set -p [strng] RemoteScreenChannels "X11:12:pi"
sudo teamviewer-iot-agent restart

Set up the Remote Screen via Framebuffer #

The Remote Screen via Framebuffer allows you to see what is displayed on the screen of the edge device. This is helpful to monitor a user remotely.

Using this feature disables the Remote Screen to control.

What you will need

Make sure that you have prepared the following points:

Setup

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. To enable the Remote Screen type in the following command and press return.
sudo teamviewer-iot-agent configure set -p [int32] EnableRemoteScreen 1
  1. Find the framebuffer number and write it down (see example below). Type in the following command and press return.
ls /dev/ | grep fb
  1. Replace fb0 with the found framebuffer number. Restart the TeamViewer IoT Agent. Type in the following commands and press return:
sudo teamviewer-iot-agent configure set -p [strng] RemoteScreenChannels "FBD:/dev/fb0"
sudo teamviewer-iot-agent restart

The setup is complete. You can access the edge device with your TeamViewer Client now.

When accessing the edge device, the user who works on said device gets a notification. You can customize the notification.

Customize the User Notification when accessing the Remote Screen #

Customize the notifications on the user remote screen.

Notifications are shown to users when their device is accessed remotely. To avoid that users can be monitored without being notified a logo is shown on the local screen of the edge device.

You can customize the position of the logo.

View of the screen on the edge device with logo in the top right corner

What you will need

Make sure that you have prepared the following points:

Positioning the Logo

To change the position of the logo modify the global configuration file. Use one of the following values:

Value Description
TopLeft positions the logo in the top left corner of the screen
TopRight positions the logo in the top right corner of the screen
BottomRight positions the logo in the bottom right corner of the screen
BottomLeft positions the logo in the bottom left corner of the screen
  1. Access the edge device Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. To modify the global configuration file open the file with nano:
sudo nano /var/lib/teamviewer-iot-agent/global.conf
  1. Scroll to the end of the file and add the following lines. Replace TopLeft with one of the values for the logo position.
#change logo position on user screen
[strng] RemoteScreenLogoPosition = "TopLeft"
  1. Save the file and exit nano.

Set up a Web Page on the Edge Device #

The Remote AppControl lets you access a custom user interface for any device or system that comes without a native graphical user interface. You’ll need to create a user interface as an HTML page which is stored directly on the device.

In this task you’ll need to install a web server to access the web page.

This setup uses a Raspberry Pi with the operating system Raspbian OS. Apache is used as the web server.

The example below is a web page of a digital twin of a pump. So, you can control and read data from the pump directly with TeamViewer Remote AppControl.

What you will need

Make sure that you have prepared the following points:

Web servers

A web server can be installed and configured on the Edge Device. Various web servers are available, with different advantages for usage. Below are listed several guides for different web servers installations.

Install the Web Server

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Update your software list and install the web server. In the terminal type in the following command and press return.
sudo apt update && sudo apt install apache2 -y
  1. To verify the correct installation use Access the Edge Device via Remote AppControl.

The window shows the default web page of the Apache Web Server. You need to create your web page or put your HTML files on the device depending on your requirements.

For example, see https://www.w3schools.com/html/ and learn how to create web pages for your Edge Device.

Access the Edge Device via Remote Terminal #

The Remote Terminal allows you to maintain the device without connecting a monitor or other peripherals.

What you will need

Make sure that you have prepared the following points:

  • The edge device is set up with a TeamViewer IoT Agent.
  • The edge device is connected to the internet.
  • Your PC is set up with the TeamViewer Client for Windows.
  • Your login credentials for the edge device (user name, and password).

Access

  1. On your PC open the TeamViewer Client and log in.
  2. On the left side open the Computers & Contacts tab.
  3. Double-click the device.
    The Control Window opens and the connection will be established.
  4. In the Control Window on the top open the Remote Terminal tab.
  5. Type in your user password and press enter.

You are now logged on the edge device.

Disconnect from Remote Terminal

In the terminal type in the following command and press enter:

exit

 

Access the Edge Device via Remote Screen #

The Remote Screen allows you to see what is displayed on the screen of the edge device.

The access and the control depend on the setup of the remote screen feature on the edge device:

FeatureDescription
X11 (interactive)See what is displayed on the edge device and control it. This is helpful to gain remote control e.g. for maintenance (see Set up the Remote Screen via X11).
Framebuffer (non-interactive)See what is displayed on the edge device. This is helpful to monitor a user while he is working with the edge device (see Set up the Remote Screen via Framebuffer).

What you will need

Make sure that you have prepared the following points:

  • The edge device is set up with the Remote Screen (via X1 or via Framebuffer).
  • The edge device is connected to the internet.
  • Your PC is set up with the TeamViewer Client.

Access

The user currently working on the edge device gets a notification when you access his device remotely.
  1. On your PC open the TeamViewer Client and log in.
  2. On the left side open the Computers & Contacts tab.
  3. Double-click the device.
    The Control Window opens and the connection will be established.
  4. In the Control Window on the top open the Remote Screen tab.

Access the Edge Device via Remote AppControl #

The Remote AppControl lets you access a custom user interface for any device or system that comes without a native graphical user interface. You’ll need to create a user interface as an HTML page which is stored directly on the device.

If you have a Premium or Corporate License linked to your TeamViewer account, you can also log sessions for reporting via the IoT Management Console.

You can use the New Browser Engine Support for IoT Devices. This allows your remote app (web page) to use its new technologies.

What you will need

Make sure that you have prepared the following points:

  • The edge device is connected to the internet.
  • A web page is set up on the edge device.
  • Your PC is set up with the TeamViewer Client.

Access

  1. On your PC open the TeamViewer Client and log in.
  2. On the left side open the Computers & Contacts tab.
  3. Double-click the device.
    The Control Window opens and the connection will be established.
  4. In the Control Window on the top open the Remote AppControl tab.

New Browser Engine Support for IoT Devices #

This article applies to IoT users who are using the TeamViewer Client running on Windows OS to remotely access the web interface of their IoT Device.

Overview

TeamViewer uses the browser engine of the Internet Explorer (IE) to render the web content of the Remote AppControl tab in the IoT remote sessions.
Starting with version 15.9, TeamViewer will support the Microsoft Edge WebView2 technology for the IoT Devices.

Microsoft Edge WebView2 is a Chromium-based web control that can handle web technologies not being supported by IE.

Preview Notice

Please note that this feature is based on functionality provided by Microsoft, which is still in an evaluation phase. As a result, unexpected behavior and malfunctions may occur.

The feature should therefore not be activated for the operation of production or live systems. Please note that with the activation of the feature certain data is transferred to Microsoft. For more information, please refer to the Microsoft privacy policy.

The support of the Microsoft Edge WebView2 in TeamViewer is provided in a preview mode. It is intended for early prototyping and testing. The stable version will be provided as soon as the WebView2 Runtime will be released.

For more information on the Webview2 release plan please review the Microsoft Edge WebView2 roadmap.

Requirements

How to Activate the New Browser Engine

Before you switch to the new browser engine please make sure that you have the Microsoft Edge WebView2 Runtime installed on your machine. If it is already installed you can skip this step.

There is a chance that your machine already has this component as it could come with other applications using WebView2 technology.

The WebView2 also comes with Microsoft Edge Insider builds that include the latest fixes by Microsoft. That is why we also recommend installing Microsoft Edge Canary Channel instead of Microsoft Edge WebView2 Runtime.

For 32-bit operating systems, you need to install the Microsoft Edge Canary.

Open TeamViewer Client and navigate to Extras->Options->Advanced->Show advanced options->IoT options. Enable the checkbox for the Use Microsoft Edge WebView2 for Remote AppControl.

On your next connection to the IoT device, Microsoft Edge WebView2 will be used to display the web content.

Below is an example of using the old and the new browser engines for the Remote AppControl tab.

Grab Remote Screen for QT Applications #

TeamViewer provides the option to access the content of the screen of a custom Qt Application on the Edge Device. This is realized through the TeamViewer Remote Screen SDK. 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 Cloud.

Building Block Description
Qt application 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.
TeamViewer Remote Screen SDK The Software Development Kit containing an interface and plugin to enable remote control for a custom application.

The TeamViewer Remote Screen SDK is released under MIT License allowing an easy integration of our source code.

To create Qt applications Qt licenses are needed.

What you will need

Make sure that you have prepared the following points:

  • A valid license for TeamViewer 14 (or newer).
  • The edge device is set up with a TeamViewer IoT Agent.
  • There must be a Qt application running on the edge device and this application must be accessible so the remote screen SDK can be linked to it.
  • The edge device should either be configured to display the user interface via a framebuffer (see Set up the Remote Screen via X11) or is capable enough to send its image data to the SDK.
  • Advanced knowledge of Linux systems, programming Qt applications and the TeamViewer Remote Screen SDK.
  • Access the Edge Device via Remote Terminal.

Software dependencies

For building the whole package the following libraries and tools need to be installed:

  • 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 (Version 10) the following development packages are used for building:

  • cmake
  • build-essential or g++
  • libgrpc++-dev
  • protobuf-compiler-grpc
  • libprotobuf-dev
  • protobuf-compiler
  • qtbase5-dev
  • qtdeclarative5-dev

Download the TeamViewer Remote Screen SDK here (see https://download.teamviewer-iot.com/remoteScreenSDK/TVRemoteScreenSDK_1.0.9.zip). Extract the SDK in a suitable folder on the edge device.

Hardware requirements

  • The edge device meets all System Requirements.
  • 30 MB free disk space or more
  • systemd software suite
  • glibc-utils package (Version 2.17 newer)
  • Linux 2.6.27 kernel

Qt application with the Remote Screen SDK

To build the remote screen SDK make sure that all required libraries and dependencies are installed and available.

Access the edge device remotely (Access the Edge Device via Remote Terminal).

Build the SDK

  1. Create and navigate to the build directory. In the terminal type in the following commands and press return:
mkdir build
cd build
  1. Run cmake. In the terminal type in the following command and press return. Replace path (PATH) with the path where your previously extracted SDK is located.
cmake PATH
  1. Run make. In the terminal type in the following command and press return.
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.

Run make. In the terminal type in the following command and press return.

sudo make install

The default installation prefix for cmake is /usr/local. After installation there are two projects installed:

  • TVRemoteScreenSDK – The Qt plugin (/lib/lbTVQtRC.so) along with the public headers (/include/*.h).
  • TVRemoteScreenSDKCommunication – The public C++ API used by the plugin. This API is independent of Qt and can be used together with any other framework.

To install the SDK into a custom prefix override CMAKE_INSTALL_PREFIX when configuring the SDK before building. For example:

cmake -DCMAKE_INSTALL_PREFIX= 

Configuration settings

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. The agent tells the application in what way it expects image updates.

In the terminal type in the following commands and press return.

sudo teamviewer-iot-agent configure set EnableRemoteScreen 1
sudo teamviewer-iot-agent configure set RemoteScreenChannels "EAP"

That the value in escaped double quotes (“) can vary from user case. The values could be:

Use case Setting
External App (SDK) with built-in grabbing RemoteScreenChannels "EAP"
External App (SDK) with notifications about framebuffer changes

For example: framebuffer device /dev/fb42
RemoteScreenChannels "EAP:FBPush:/dev/fb42"
External App (SDK) with framebuffer grabbing

For example: first framebuffer device /dev/fb0
RemoteScreenChannels "EAP:FBPull"

The TeamViewer IoT Agent currently supports the following strategies:

  • The 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 IoT 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-Pull or the channel setting FBPull)
    • 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.

Further configuration

After installing the TeamViewer 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 the current user to group tv_api. In the terminal type in the following commands and press return.

usermod -a -G tv_api $USER

For more information about the different channel configurations and their use, see Set up the Remote Screen via X11 and Set up the Remote Screen via Framebuffer.

Example application

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:

  • qml-module-qtquick2
  • qml-module-qtquick-window2

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 TeamViewer 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

Troubleshoot

Contact TeamViewer IoT Supportiot-support@teamviewer-iot.com⟩ if you encounter problems when using the remote screen SDK.

Inverted Colors

On some ARM based devices, the colors may seem inverted or appear wrong on the client’s side.

Screen refresh

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, see Set up the Remote Screen via X11 and Set up the Remote Screen via Framebuffer.

Sensors #

Sensors play a vital role in any IoT Solution. Sensors on your edge device can help you to monitor your edge devices’ health. They also can help you to monitor the entities you attach a sensor to (e.g. robot arms).

Data flow of sensor metrics

To use sensors make sure TeamViewer Edge Management is enabled.

Three basic steps are needed to integrate sensors into your IoT Solution:

  1. Connect a sensor physically to your edge device (for example, see Connect the Sensors to the Starter Kit).
  2. Assign the sensor (and its metrics) to your TeamViewer Account.
  3. Use sensor metrics for monitoring (e.g. widgets) and/or to set alerts and notifications.

Sensor metrics and data is handled as defined by the TeamViewer IoT MQTT API. You will need to then push your sensor data as specified in the MQTT API Push Metric Values section to visualize it in real-time.

Add Sensors with Easy Setup #

The Easy Setup for adding sensors is intended to provide you with an intuitive and easy experience which will lead you through the setup steps in adding the sensors.

The Easy Setup contains 3 basic steps. Follow the sections in this article:

  1. Generate a Sensor Script
  2. Enable the Sensor Script on the Edge Device
  3. Assign the Sensor Script to the Edge Device

The generated Sensor Script is a template.

The Sensor Script prints metric values of a sensor in JSON format and each metric is described as a variable which gets a random value in between 1 and 20.
If you don’t have a ready script, you might need to search for tutorials on how to read your sensor data, find a library or script that works with your sensor and make sure that your script’s output prints the JSON formatted example as presented in the template.
Then place the ready script on the edge device and provide the full path information into the configuration page.

Most sensors will be detected automatically when connected to your Edge Device. Other sensors may not be detected automatically; please refer to the Owners Manual of said sensor to get more information on how to connect the sensor to the Edge Device properly.
You will get an error message if input values are not permissible. You’ll need to adjust them accordingly.

There are thousands of different sensors in the world. Some of them would need special libraries or custom development to get a data from. If you have trouble with the setup of sensors, contact TeamViewer.

What you will need

Make sure that you have prepared the following points:

Generate a Sensor Script

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Devices.
  3. On the right side from the dropdown menu select Add Sensor.
  1. Click Easy Setup.
  1. From the dropdown menu select the device with the sensor you would like to add.
  2. Type in a unique sensor name.
  3. Click to add a metric. To configure the metric provide a metric name and an unique ID. The fields Value Type and Value Unit are optional. (When a metric becomes superfluous click to remove it.)
  1. When all metrics are configured click Download the generated Template.

The downloaded zip-file contains template examples for Python and Bash.

  1. On your local PC extract the zip-file.
  2. Pick one of the extracted files as your Sensor Script.

Keep the Management Console open and continue with Enable the Sensor Script on the Edge Device.

Enable the Sensor Script on the Edge Device

In this task you’ll need to transfer the previously downloaded Sensor Script to the Edge Device. Then you’ll give the Sensor Script fitting permissions to be executed.

  1. Transfer the Sensor Script to your Edge Device by using the Transfer Files feature. Remember the full path (FULLPATH) of the Sensor Script on the Edge Device.
  2. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  3. Give the Sensor Script fitting permissions. In the terminal type in the following command and press return. Replace FULLPATH with the full path from the previous step.
sudo chmod +x FULLPATH

Assign the Sensor Script to the Edge Device

After you enabled the Sensor Script on the Edge Device you’ll need to continue where you left off from Generate a Sensor Script.

  1. Type in the FULLPATH you remembered from Enable the Sensor Script on the Edge Device.
  1. Select the frequency by which the data will be sent to the TeamViewer IoT Cloud. It can be defined in seconds or minutes.
  1. To finish the Easy Setup click Add.

Example: Connect a Sensor to the TeamViewer IoT Agent #

This example provides a quick overview of how to use the TeamViewer IoT Agent MQTT API to securely (encrypted and trusted) connect, to register sensors and metrics, to view device inventory, and to push data to the TeamViewer IoT Cloud.

For more information see TeamViewer IoT Agent MQTT API.

In this example you will use multiple terminals at once. Always make sure that you use the correct terminal as described in this example.

You will use three separate terminals to perform this example:

  • Terminal 1 will be used to receive messages from the Authentication API.
  • Terminal 2 will be used to publish commands to the API.
  • Terminal 3 will be used to receive messages from the Registration and Data API.

What you will need

  • The edge device is set up with a TeamViewer IoT Agent.
  • Your login credentials for the edge device (user name, and password).
  • You are logged in to the IoT Management Console. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  • A tool to access the edge device remotely via ssh (e.g. Putty).
  • Advanced knowledge of Linux systems and command line operations.

Setup

  1. Create Terminal 1. Log in to the Edge Device and use your credentials by using a ssh-tool.
  2. Create Terminal 2. Log in to the Edge Device and use your credentials by using a ssh-tool.
  3. Create Terminal 3. Log in to the Edge Device and use your credentials by using a ssh-tool.
  4. Install the Mosquitto Clients. In the Terminal 1 type in the following command and press return.
sudo apt-get install mosquitto-clients
  1. Subscribe to all Authentication and Authorization topics to receive data/messages from the TeamViewer IoT Agent MQTT API. In the Terminal 1 type in the following command and press return.
mosquitto_sub -h localhost -p 18883 --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /#
You can subscribe to each topic separately as illustrated in the TeamViewer IoT Agent MQTT API documentation. In this example, the # is used as placeholder to subscribe to all topics, including success and error messages.
  1. Generate a Certificate Signing Request and Private Key. In the Terminal 2 type in the following command and press return. Type in your specific information when prompted (e.g. company name).
openssl req -nodes -new -newkey rsa:2048 -sha256 -out csr.pem

Two files are created:

  • privkey.pem (your private key file will be used for publishing / subscribing to topics)
  • csr.pem (this file will be presented to the TeamViewer IoT Agent to generate a certificate)
  1. Publish the Certificate Signing Request (csr.pem) to the API to receive a TeamViewer IoT Agent generated and signed certificate. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18883 --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/createClient -m < (echo -n """ && cat csr.pem && echo -n """)
  1. Copy the certificate content into a new file called clientCert.crt and save in the same location as your privkey.key. In the Terminal 1 type in the following command and press return. Replace path (PATH) with the path where your file privkey.key is located.
cp csr.pem PATH/clientCert.crt
  1. Parse the unique client Id to be used for your secure connection for all subsequent messages. Record the resulting Id for future use. In the Terminal 2 type in the following command and press return.
openssl x509 -noout -subject -in clientCert.crt -nameopt multiline | grep commonName | sed -r 's/commonName/ /g' | sed -r 's/=/ /g' | xargs | tr -d " tnr"
The resulting Id for this example is c6c5e217089743da8ec3f1d256fa99c2.
  1. Use your private key and certificate, securely subscribe to all Registration and Data topics to receive data and messages from the TeamViewer IoT Agent MQTT API. In the Terminal 3 type in the following command and press return.
mosquitto_sub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /#
You can subscribe to each topic separately as illustrated in the TeamViewer IoT Agent MQTT API documentation. In this example, the # is used as placeholder to subscribe to all topics, including success and error messages.
  1. Verify your secure connection to the API is alive, by executing this command and verifying the message is received in Terminal 3. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/ping -m  "{ "request" : "Some Message" }"
The command includes the example Id from a previous step (c6c5e217089743da8ec3f1d256fa99c2).
  1. Display your Inventory, which will be displayed in Terminal 3. The Inventory should be empty ([]) as we haven’t registered any sensors yet. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/list -m "{}"
  1. Register a new sensor called Temperature1. The result will be displayed in Terminal 3. In the Terminal 2 type in the following command and press return. Record the sensordId from the Terminal 3 output as it will be needed later.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/create -m  "{ "name" : "Temperature1" }" 
  1. Register three metrics for your Temperature1 sensor. The result will be displayed in Terminal 3. In the Terminal 2 type in the following command and press return. Record the metricId for each Metric from the Terminal 3 output as it will be needed later.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/d43862fd65ac4a0f9054cfe1749cad82/metric/create -m "{"metrics" : [{"matchingId" : "1", "valueUnit": "NoSI.Dimensionless.PERCENT", "name" : "CPUUsage" },{"matchingId" : "2","valueUnit": "NoSI.Dimensionless.PERCENT", "name" :"CPUIdle" }, {"matchingId" : "3", "valueType" : "integer" , "valueAnnotation": "goods per minute", "name" : "ShopFloor1"}]}"
  1. Display details of one of your metrics, which will be displayed in Terminal 3. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/d43862fd65ac4a0f9054cfe1749cad82/metric/226ede40e42b458d88d09414fa44e7bf/describe -m "{}"
  1. Display your Inventory, which will be displayed in Terminal 3. The Inventory should be consistent with the sensor and metrics you created. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/list -m "{}"
  1. From the IoT Management Console navigate to Metrics and verify the sensor and metric information is consistent with the information you registered with the API.
  2. Update the name of your sensor to Temperature2. The result will be displayed in Terminal 3. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/d43862fd65ac4a0f9054cfe1749cad82/update -m "{ "name" : "Temperature2" }"
  1. From the IoT Management Console navigate to Metrics and verify the sensor has been updated.
  2. Display your Inventory, which will be displayed in Terminal 3. The Inventory should display the updated the sensor. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/list -m "{}"
  1. Delete a metric from your Sensor. In the Terminal 2 type in the following command and press return. In this example the metric with the metricId 9712270f8fd04c2baab6a2409b3e4b9d will be deleted.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/d43862fd65ac4a0f9054cfe1749cad82/metric/delete -m "{"metrics": [{"metricId" : "9712270f8fd04c2baab6a2409b3e4b9d" }]}"
  1. Send data values for the two remaining metrics. The result will be displayed in Terminal 3. In the Terminal 2 type in the following command and press return.
mosquitto_pub -h localhost -p 18884 --cert clientCert.crt --key privkey.pem --cafile /var/lib/teamviewer-iot-agent/certs/TeamViewerAuthority.crt -t /v1.0/c6c5e217089743da8ec3f1d256fa99c2/sensor/d43862fd65ac4a0f9054cfe1749cad82/metric/pushValues -m "{ "metrics": [ {"value" : 21, "metricId" : "226ede40e42b458d88d09414fa44e7bf" }, {"value" : 215, "metricId" : "520b4d8854454e0ea3a4f9a225afb862" } ] }"
  1. From the IoT Management Console navigate to Metrics and pin the two metrics to the dashboard (See Add A Widget).
  2. From the IoT Management Console navigate to Dashboard and verify the two new widgets with the created metrics.

Set up the OPC UA Connector for Easy Integration #

It is effortless to monitor your sensor network via TeamViewer IoT. This article describes the integration approach to monitor OPC UA server node values. For more about OPC UA reference the OPC Foundation (see https://opcfoundation.org/).

The setup contains three basic steps. Follow the sections in this article:

  1. Install software dependencies
  2. Download and extract the OPC UA Connector
  3. Integrate the OPC UA Monitoring Script with the TeamViewer IoT Agent

What you will need

Make sure that you have prepared the following points:

Install software dependencies

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Install Python 2 or Python 3 (see https://www.python.org/downloads/).
We recommend installing Python 3.
  1. Update the python libraries pip, setuptools and wheels. In the terminal type in the following command and press return.
python -m pip install --upgrade pip setuptools wheel
  1. Install the python library freeopcua. In the terminal type in the following command and press return.
pip install freeopcua

Download and extract the OPC UA Connector

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Download the connector. In the terminal type in the following command and press return.
wget https://download.teamviewer-iot.com/connectors/teamviewer-iot-opcua/1.0.0/teamviewer_iot_opcua-1.0.0.tar.gz
  1. Create a new folder and extract the downloaded connector. In the terminal type in the following commands and press return. Record the path (PATH) where you extracted the connector.
sudo mkdir -p /usr/local/teamviewer-iot-agent/monitoring/
tar -xzvf teamviewer_iot_opcua-1.0.0.tar.gz -C /usr/local/teamviewer-iot-agent/monitoring/opc-ua

Integrate the OPC UA Monitoring Script with the TeamViewer IoT Agent

The TeamViewer IoT Agent includes its system Monitoring Configuration File (see JSON Schema for Custom Plugin Connector). Extend the configuration file to include the OPC UA monitoring script.

The Monitoring Configuration File is located at: /var/lib/teamviewer-iot-agent/system_monitors.conf.

To avoid data loss. Before editing the configuration file, create a backup.
  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Open the Monitoring Configuration File with the editor nano. In the terminal type in the following command and press return.
sudo nano /var/lib/teamviewer-iot-agent/system_monitors.conf

For each OPC UA sensor you want to integrate, append its registration information to the configuration file. Reference the example file below and replace the placeholders with your OPC UA node details.

Make sure to replace the value of monitoringService with the path (PATH) from the of the extracted connector from step Integrate the OPC UA Monitoring Script with the TeamViewer IoT Agent.

  1. Save the file and close the nano editor.
  2. Restart the TeamViewer IoT Agent to reload the configuration file. In the terminal type in the following command and press return.
teamviewer-iot-agent restart
  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the IoT Management Console navigate to Metrics and verify the newly integrated sensors and metrics are updated.
  3. Optional: From the IoT Management Console navigate to Metrics and pin the two metrics to the dashboard (See Add A Widget).

Example Monitoring Configuration File

{
    "sensors": [
        {
            "name": "opcua_node_aa",
            "monitoringService": "python /usr/local/teamviewer-iot-agent/monitoring/opc-ua/opc_ua_connect.py",
            "monitoringParams": "--url opc.tcp://myopcuahost:26543 --nodeId "opcua_node_id" --frequency 2",
            "metrics": [
                {
                    "name": "opcua_node_id",
                    "key": "opcua_node_id",
                    "valueType": "double",
                    "valueAnnotation": ""
                }
            ]
        },
        ...
    ]
}

For more information about the schema of the Monitoring Configuration File see JSON Schema for Custom Plugin Connector.

Set up the Log Parser Connector for easy Integration of your Log Based Sensors/Metrics #

The TeamViewer IoT Log Parser Connector easily extracts & integrates sensor data from your log files.

The Log Parser Connector is generic, in that, it can be used to parse any log.  For the context of this article, it is assumed your IoT sensor values are written to a log file which you would like to connect to the TeamViewer IoT Agent.

The setup contains two basic steps. Follow the sections in this article:

  1. Download and install the Log Parser Connector
  2. Integrate the Log Parser Connector with the TeamViewer IoT Agent

For more information about configuration and syntax see Configuration and Syntax of the TeamViewer Log Parser Connector.

What you will need

Make sure that you have prepared the following points:

Python 2 is not supported.

Download and install the Log Parser Connector

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Download the Log Parser Connector. In the terminal type in the following command and press return.
wget  https://download.teamviewer-iot.com/connectors/teamviewer-iot-log-parser/1.0.0/teamviewer_iot_log_parser-1.0.0.tar.gz
  1. Upon completion of the download, extract the contents of the connector. In the terminal type in the following commands and press return:
sudo mkdir -p /usr/local/teamviewer-iot-agent/monitoring/
tar -xzvf teamviewer_iot_log_parser-1.0.0.tar.gz -C /usr/local/teamviewer-iot-agent/monitoring/
  1. Install the Log Parser Connector. In the terminal type in the following command and press return.
cd teamviewer_iot_log_parser-1.0.0 python3 setup.py install
  1. Verify the installation was successful by identifying a log file to parse and using the following command to parse a string. In the terminal type in the following command and press return. Replace logFilePath & justTextorRegex with the path of your log file and a string to search for, respectively.
teamviewer_iot_log_parser -f logFilePath --regex justTextOrRegex

Integrate the Log Parser Connector with the TeamViewer IoT Agent

The TeamViewer IoT Agent includes its own system monitoring configuration file. This configuration file will be extended to include the Log Parser configuration.

Before editing files mentioned in this task create a backup. Use the backups in case of a corrupted system or data.

For each sensor you want to integrate, append its registration information to the configuration file. Reference the Log Parser Connector Template or the Examples and replace the placeholders with your sensor details.

  1. To modify the configuration file open the file with nano:
nano /var/lib/teamviewer-iot-agent/system_monitors.conf
  1. Modify the configuration file as needed.
  2. Save the file and exit nano.
  3. Restart the IoT Agent to reload the configuration file. In the terminal type in the following command and press return.
teamviewer-iot-agent restart
  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Dashboard.
  3. Verify that the Sensors/Metrics added to the configuration file now appear on your Metrics tab.
  4. Use a Widget to pin the metrics to your dashboard and ensure the data is being updated per the frequency specified in the config file.

Configuration and Syntax of the TeamViewer Log Parser Connector #

The connector can be configured given the following configuration arguments:

Argument / flagRequired?Description
-p, –parseryesThe log parser can operate in 2 modes:

matches – (Default) returns a count of strings matching a specified regex since the last run

metrics – returns an aggregated value for each specified metric since the last run
-t, –timeoutyesDuration to wait for parsing to complete before terminating and returning an error.
Values are in seconds; Default, if not specified, is 5 seconds.

The two modes of operation, (Matches & Metrics), each require additional parameters to be specified.

Matches

Argument / flagRequired?Description
-f, –fileyesFile path of the log to parse
-R, –regexyesString or regex expression to match
(for more information see https://docs.python.org/3/library/re.html)

Metrics

Argument / flagRequired?Description
-f, –fileyesFile path of the log to parse
-M, –metricsyesSpace delimited list of metrics to extract
-A, –aggfunctionsyesSpace delimited list of aggregation functions for each respective metric

Possible values: avg, sum, min, max, median
-T, –templatenoTemplate to parse metrics

Default template is :metric=.(.*?).[s], which will match log entries of “metricName”=”value”

TeamViewer IoT Log Parser Connector Template #

Use the following template to add your connector configuration for each sensor to the monitoring configuration file.  The template is an example of adding a single sensor with two (2) metrics (Temperature & Humidity).

Ensure to replace the following placeholders with the specifics of your sensor.  Note:  the frequency in the template is set to 10, which will trigger the Log Parser Connector to run every 10 seconds, aggregating the values from each interval.

For more information about the JSON schema see JSON Schema for Custom Plugin Connector.

{
    "sensors": [
        {
            "name": "temperature_humidity_parser",
            "monitoringService": "python3 /usr/local/teamviewer-iot-agent/monitoring/log_parser/teamviewer_iot_log_parser.py",
            "monitoringParams": "--file /tmp/file.log  --parser metrics -–metrics temperature humidity --aggfunctions max avg –-template ':metric=.(.*?).[\s]'",
            "frequency": 10,
            "metrics": [{
                    "name": "Temperature",
                    "key": "temperature",
                    "valueType": "double",
                    "valueAnnotation": "C"
                }, {
                    "name": "Humidity",
                    "key": "humidity",
                    "valueType": "double",
                    "valueAnnotation": ""
                }
            ]
        },
        ...
    ]
}

Examples: Configuration of the Connector using the "monitoringParams" #

The following examples describe use cases and their respective configuration of the Log Parser Connector as specified by the monitoringParams parameter.

Example 1

Parse a log file to retrieve the maximum value of a metric called temperature and the average value of a metric called humidity.

>> Log File (log_file.log) Contents:
some text temperature=18 some text humidity=80
some other text temperature=19 some text humidity=82 text

>> monitoringParams:
--file log_file.log --parser metrics --metrics temperature humidity --aggfunctions max avg --template=":metric=(.*?)[\s]"

>> Result:
{"temperature": 19, "humidity":81}

Example 2

Parse a log file to retrieve the number of occurrences of the string findMe.

>> Log File (log_file.log) Contents:
some text findMe some text findMe
some other text temperature=19 some findMe text humidity=82 text

>> monitoringParams: 
--file log_file.log --parser matches --regex someRegex

>> Result:
 {"count": 3}

JSON Schema for Custom Plugin Connector #

An example template:

{
    "sensors": [
        {
            "name": "opcua_node_aa",
            "monitoringService": "python /usr/local/teamviewer-iot-agent/monitoring/opc-ua/opc_ua_connect.py",
            "monitoringParams": "--url opc.tcp://myopcuahost:26543 --nodeId "opcua_node_id" --frequency 2",
            "metrics": [
                {
                    "name": "opcua_node_id",
                    "key": "opcua_node_id",
                    "valueType": "double",
                    "valueAnnotation": ""
                }
            ]
        },
        ...
    ]
}

JSON Schema for Sensor Objects

FieldTypeRequiredDescription
SensorJSON Object  
nameStringYesDisplay name of the sensor.
monitoringServiceStringYesFull path of your custom monitoring script.
frequencyInteger (seconds)NoIf frequency is set, the TeamViewer IoT Agent will run the script in the interval specified (e.g. every 10 seconds). If frequency is not set, the TeamViewer IoT Agent will run the script once upon start up.  This assumes that the scheduler is organized within your custom monitoring script and new values of metrics are printed upon their change. Note that every new JSON message should be printed on a new line.
monitoringParamsStringNoAdditional arguments to pass to the script. E.g. url, host, sensorId etc. This field is useful for cases when you want to use same script to monitor several sensors of the same type.

JSON Schema for monitoringParams Objects

FieldTypeRequiredDescription
urlStringyesOPC UA server url
nodeIdStringyesId of the node specified by the given OPC UA server.
frequencyIntegernoThe frequency (in seconds) to poll for new node values.

If not set, frequency defaults to 1-time execution.

JSON Schema for Metric Objects

FieldTypeRequiredDescription
MetricsJSON Array  
nameString Display name of the metric
keyString Short name (identifier) of the metric. It should be used as a key in the JSON output of the monitoring script.
valueTypeEnum Indicates the type of the metric. Possible values are: integer / double / string.
valueAnnotationString The unit of measure which will be displayed as the name of the Y axis when displaying metric values on a chart. Commonly used annotations are: %, C, Pa, req/sec, MB, etc.

Monitoring Configuration File

After the sensor/metric is registered by the agent, the agent auto-generates the parameters sensorId and metricId and adds them as properties to the configuration file.

To avoid data loss. Before editing the configuration file, create a backup.
Avoid historical data loss. Do not change any sensorId or metricId after they are added to the configuration file.

Monitoring Frequency

Monitoring frequency can be controlled either by the agent’s Monitoring Configuration File (parameterfrequency) or by your custom script. In the JSON Sensor (see example below), the frequency is specified by the configuration property, causing the agent to run your script every 10 seconds.

{
   "sensors": [{
		"name": "temperature_humidity_sensor1",
		"monitoringService": "/usr/local/teamvieweriot/sensors/temperature_humidity/monitor.sh",
		"monitoringParams": "sensor1 sdkCredential",
                "frequency": 10,
		   "metrics": [{
		      "name": "Temperature",
		      "key": "temperature",
		      "valueType": "double",
		      "valueAnnotation": "C"
		    }, {
	              "name": "Humidity",
		      "key": "humidity",
	              "valueType": "double",
		      "valueAnnotation": ""
		    }]
		},
		...
	]
}

There may be scenarios where the frequency of the data collection should be set by your script rather than specified in the agent’s Monitoring Configuration File. In these scenarios, the parameter frequency in the configuration file should be left blank.

Use Case: You want to monitor discrete events which don’t have a defined frequency (event-based metrics

  • e.g. monitoring when a door is opened or closed
  • within your custom script, you subscribe to a message queue to get door movement events and print them to stdout.

Generic example:

var queue = new Queue();
queue.openConnection();
queue.createSubscription(callback);

function callback(value) {
     print {"key":value};
}

Use Case: You want to set up high frequency monitoring (e.g. 1 second)

Although this can be done by configuring the parameter frequency in the agent’s Monitoring Configuration File, an optimal solution may be use a loop in your script to print new metric values every second.

Generic example:

var networkObject = new NetworkObject();
networkObject.openConnection();

try {
    while (true) {
    var value = networkObject.getValue();
    print {"key":value};
    sleep(1000);
    }
}
finally
{
  connection.close()
}

Set up Secure Clients, Sensors and Metrics #

What you will need

Make sure that you have prepared the following points:

This application provides a GUI wizard for you to create secure clients and define sensors and metrics, as defined by the TeamViewer IoT MQTT API. You will need to then push your sensor data as specified in the MQTT API Push Metric Values section to visualize it in real-time.

Using the wizard, you can create new Clients or authorize existing ones.

Create New Clients

You can create new clients either automatically or by using an existing Certificate Signing Request (CSR).  To create clients using a CSR, you must upload the CSR & the associated private key.

Once a secure client has been created, you can download its credentials for use on edge devices (to easily integrate sensors on edge devices to your TeamViewer IoT Agent).

For more Information see Remote Clients.

Once a secure client has been created, you can use the wizard to define the sensors and metrics you want to connect.  The wizard will provide you with the details and a template to push the sensor’s data as described in MQTT API Push Metric Values.

Authorize Existing Clients

Any existing client will automatically appear on your clients page of the IoT Management Console. However, you must upload its Certificate credentials using the clients page, to view it in real-time.

View Data in Real-Time

Using the Metrics page of the IoT Management Console, you can view a list of all your sensor metrics and quickly view each in real-time by clicking on the metric name.

All client/sensor/metric metadata shown in the application is the same as displayed in the TeamViewer IoT Cloud Dashboard.

Manage Certificates

All client certificates, created by the application or uploaded by the user, are stored under:

/var/lib/docker/volumes/teamviewer-iot-edge-device-management-cert/_data

Public Key: cert-clientId.pem
Private Key: key-clientId.pem

The certificate file names contain the client Id, in case the certificates are needed on edge devices.

CAUTION: Do not rename, delete, or modify files under the cert/ directory. Doing so will cause data corruption.

For more Information see Remote Clients.

Rules, Alarms and Notifications #

A key part of managing your IoT network is being able to respond as soon as possible to events or anomalies requiring action. In this section, learn how to set up flexible notifications to easily manage your messages and alerts.

Notification are sent by channels (email or webhook). Those channels are bundled into topics. For example:

  • the Topic Staff which comprises channels sending emails only to staff members
  • the Topic Service which comprises channels sending emails just to service workers

To get a notification when a defined condition is met you need to create a rule. For example:

  • Create a Rule with the Condition Device is offline and associate it with the Topic Staff. Staff members receive an email to turn on the edge device.
  • Create a Rule with the Condition Temperature > 100 °C and associate it with the Topic Service. A service worker receives an email to check the health of the edge device.

To use rules and notifications make sure TeamViewer Edge Management is enabled and Real Time Rule Engine is enabled.

Rules

Rules are limited to the following thresholds:

  • Metric Threshold type is generated based on the threshold applied on metric(s) when the specified condition is violated.
  • Device Offline  type is generated based on the abnormal state of the device(s) or metric(s) (in future), for example when no data is received from a device or metric for a period more than two minutes.

See:

Alarms

Each time when threshold triggers, a unique Alarm with specified severity is created. 

Alarm severity defines how important the alarm is. We support the following alarm severity levels: Warning, Minor, Major and Critical.

SeverityDefinitionColor
WarningBe warned.Yellow
MinorMinor problem.Dark Yellow
MajorSomething important has happened.Orange
CriticalDisaster. Financial losses, etc.Red

The maximum number of thresholds to be applied per Rule is four, equal to the number of severity levels.

All the open alarms are reflected in the Alarms list (Management Console > Alarms) and can be filtered by severity levels, type, creation time and so on. Thus, users can see metric or device specific alarms correspondingly in Devices and Metrics pages.

Notifications

A Notification topic is a communication bridge that receives notification messages triggered by Rules and sends them to Channels which are subscribed to the Topic.

See:

Enable the Real Time Rule Engine #

What you will need

Make sure that you have prepared the following points:

Enable

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Install the Real Time Rule Engine. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent install rule-engine
  1. At the end of the installation, will be asked to start the Rule Engine application. Answer with YES.
  2. Ensure the Real Time Rule Engine is running correctly. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent info

The status of the TeamViewer IoT Agent and its extensions is listed.

After enabling the Real Time Rule Engine you can start to create rules and notifications.

Check the Status of the Real Time Rule Engine

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Check the status of the Real Time Rule Engine. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent info

The status of the TeamViewer IoT Agent and its extensions is listed.

Real Time Rule Engine with the status “Started”

Manually enable or disable the Real Time Rule Engine

You can enable or disable the Real Time Rule Engine manually.

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  • Enable the Real Time Rule Engine. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent start rule-engine
  • Disable the Real Time Rule Engine. In the terminal type in the following command and press return.
sudo teamviewer-iot-agent stop rule-engine

Add Rule #

What you will need

Make sure that you have prepared the following points:

Adding the Rule

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Rules.
  3. On the right side click Create Rule.
  4. Follow the steps in the form to set up the rule:
    • Input a rule name
    • Set a rule type
    • Select one or more metrics
    • Set up the condition
    • Select one or more topics for notifications (see Add a Topic)
Click X to remove a metric or a notification if needed.
  1. When finished click Create Rule.

Add Topic #

Topics can be created without any Channels or being linked to Rules. In this scenario, notifications will not be sent as there are no specified Channels. You can add Channels to your Topics at any time, during or after setting up the Topic.

What you will need

Make sure that you have prepared the following points:

Adding the Topic

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Notifications > Topics.
  3. On the left side click Create Topic.
  4. Follow the steps in the form to set up the topic:
    • Input a topic name
    • Select one or more channels
  1. Click Create.

Add Channel #

Channels can be created without any subscribed Topics. You can subscribe to Topics at any time, during or after setting up the Channel.

Webhooks and emails need to be confirmed prior to being activated (ready for use) in order to prevent abuse of non-owned mediums.  Once a Channel is set up, a confirmation message is sent to the endpoint to allow the owner to confirm it within a 24 hour period.

Channel TypeDescription
EmailThe notification is sent via email to the specified address.
WebhookThe notification is sent via HTTP POST message to a specified url. The messages contain JSON documents (see Examples: Rule Triggered Webhook Messages).

What you will need

Make sure that you have prepared the following points:

Adding the Channel

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Notifications > Channels.
  3. On the left side click Create Channel.
  4. Follow the steps in the form to set up the topic:
    • Select a channel type
    • Input a channel name
    • Input the endpoint address (email or URL)
    • Select a time zone
    • Select one or more topics
  1. Click Create.

Examples: Rule Triggered Webhook Messages #

A Webhook can be thrown when a Rule was triggered. Webhooks are sent via HTTP POST message to a specified url. The message contains JSON documents.

The examples below show Webhook message examples for your reference.

Webhook Endpoint Confirmation

{ "Type": "ChannelConfirmation", 
  "Message": "You have received this request because your webhook URL has been added to the TeamViewer IoT notification channel list. To confirm this channel visit the ConfirmationURL included in this message" , 
  "ConfirmationURL": "https://mywebhook.com/confirmation/eyJ0aW1lU3RhbXAiOjE1Mjk0NzU1OTQwNzYsImNoYW5uZWxOYW1lIjoidGVzdCIsImNoYW5uZWxUeXBlIjoxLCJ1c2VySWQiOiI1YjI3YjI5ZGY2N2VjM2Y1MTAxMDUxNjkiLCJjaGFubmVsSWQiOiI1YjI5ZjIwYTMzNmJjNzUzZjA5M2Q1YWMiLCJ0YXJnZXQiOiJodHRwczovL3dlYmhvb2suc2l0ZS8zMjBmZTQ1Mi1kNzZmLTQ0YTUtYWFiZC04MDAzYTIyZTRlZWEifQ=="
}
{
    "Type": "ChannelConfirmationResponse",
    "Message": "Webhook channel has been successfully confirmed",
    "Timestamp": 1529475719718
}
{
    "Type": "ChannelConfirmationResponse",
    "Message": "Webhook channel  has already been confimred.",
    "Timestamp": 1529475731790
}

Rule Met

<pre class="wp-block-syntaxhighlighter-code">{
  "StartTime": 1501068864000,
  "ruleName": "Default alarm policy",
  "condition": "raspberrypi.dht22.temperature < 3",
  "consecutiveChecks": 4,
  "values": {
    "raspberrypi.dht22.temperature": 2
  }
}</pre>

Rule Recovered

<pre class="wp-block-syntaxhighlighter-code">{
  "endTime": 1501068864000,
  "duration": "2 hour(s) 45 minute(s)",
  "ruleName": "Default alarm policy",
  "condition": "raspberrypi.dht22.temperature < 2",
  "consecutiveChecks": 4,
  "values": {
    "raspberrypi.dht22.temperature": 5
  }
}</pre>

Example: Integrate Webhook Alerts #

Learn how to integrate alerts with https://ifttt.com/ using TeamViewer IoT Webhooks.

On the TeamViewer IoT dashboard, you can configure Webhook alerts to integrate your IoT solution with many third parties.

What you will need

Make sure that you have prepared the following points:

Integrate

  1. Log in to the IFTTT web page https://ifttt.com/ with your IFTTT credentials.
  2. To create a new applet click New Applet.
  1. To add a trigger click +this.
  1. In the search field enter webhooks, then select Webhooks.
  1. Type in an event name (e.g. alert). Then click Create trigger.
  1. Select the service EMail and complete the template (action fields).
    The template represents the email subject and body you will receive when the webhook was triggered.
  1. Click Create action.
  2. Switch to MyApps > Services then click Webhooks.
  1. To see your account information click Settings.
    For example:
  1. To see all details of the webhook navigate to the URL with your web browser.
    Make note of the webhook URL (e.g. copy to clipboard).
    For example:
  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. Add a Channel use the follwing settings:
    • Select channel type Webhook.
    • Paste into endpoint the webhook URL from above.

Data and Visualization #

Use the capabilities of the TeamViewer IoT Solution to visualize and to export your data.

The easiest way to visualize your data is by using Widgets. This also allows you to export your data for further analysis.

Transfer files quickly and save to and from your edge device by enabling the feature File Transfer.

Make use of the powerful TeamViewer IoT Cloud and its ability to integrate with Amazon Web Services and many other cloud services.

Widgets #

Widgets display your IoT data in a comfortable way. The data can be metrics from the Edge Device (e.g. fan speed) or metrics from connected sensors (e.g. room temperature).

Use widgets to help understand your data and to track changes.

To use widgets make sure TeamViewer Edge Management is enabled.

The following types of widgets are available:

  • Chart
  • Number
  • String
  • Gauge
  • Thermometer
  • Map
Chart widget

To use widgets see:

Add a Widget #

Add a widget to display your IoT data.

What you will need

Make sure that you have prepared the following points:

Adding the Widget

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Dashboard.
  3. On the right side click Add Widget.
  1. Setup the widget:
    • set a unique Label
    • select a widget Type
    • select the metrics
  2. Click OK.
If you select the Chart visualization option, you can choose up to 3 metrics to appear in the same widget.

Configure Widgets #

What you will need

Make sure that you have prepared the following points:

Rearrange a Widget on the Dashboard

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Dashboard.
  3. On the left side choose the Widget which holds the data you want to rearrange.
  4. Click the Widget and drag it to its new position on the Dashboard.

Display Data within a Time Range

Setting a time range gives you the chance to analyze collected data from a specific period.

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Dashboard.
  3. On the left side choose the Widget.
  4. On the upper right of the Widget click the Time Range Menu.
  5. Select a Time Range:
    • Live – displays collected data from the last 3 Minutes
    • other ranges – displays collected data from the selected time range

Delete a Widget #

Deleting a widget is helpful to keep your dashboard clear and uncluttered.

Data will still be collected even after deleting a widget.

What you will need

Make sure that you have prepared the following points:

Delete a Widget from the Dashboard

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Dashboard.
  3. On the left side choose the Widget you want to delete.
  4. On the upper right of the Widget click the Widget Menu () > Unpin from Dashboard.

Export collected Data #

Collected data is saved in the IoT cloud. Download the raw data from the IoT cloud to analyze it with third-party tools.

What you will need

Make sure that you have prepared the following points:

Export the Data as CSV File

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Dashboard.
  3. On the left side choose the Widget which holds the data you want to export.
  1. On the upper right of the Widget click the Widget Menu () > Export to CSV.
    The Export CSV data file dialog is displayed.
    • Type in a filename
    • Select the metrics you want to export
    • Select the time range
  2. Click Export.
    A download link is generated and is sent to your TeamViewer EMail.
    Use the download link to download the data from the IoT cloud.
CSV file uses comma ( , ) as a list separator. Make sure to have the same setting in your Operating System not to have a display issue in case the file will be imported into third-party analysis tools.

Enable File Transfer #

Thanks to the File Transfer feature that TeamViewer IoT offers, users can upload and download files from their PCs to the Edge Device and vice versa.

File Transfer is an extension of the TeamViewer IoT Agent.

What you will need

Make sure that you have prepared the following points:

Enable

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. Type in the following command and press enter:
sudo teamviewer-iot-agent configure set EnableFileTransfer 1
When File Transfer is enabled users will have access to the file system of the device with the “root” permission (full access). It is recommended to disable File Transfer when sharing the edge device with other users.

When enabled, you can start to transfer files (see Transfer Files).

Disable

  1. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  2. In the terminal type in the following command and press enter:
sudo teamviewer-iot-agent configure unset EnableFileTransfer

Transfer Files #

What you will need

Make sure that you have prepared the following points:

  • Your TeamViewer credentials.
  • The edge device is set up with a TeamViewer IoT Agent.
  • The edge device is connected to the internet.
  • File Transfer is enabled (see Enable File Transfer).

Procedure

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Inventory.
  3. From the drop-down-menu select Devices.
  4. From the list choose the device you want to transfer file. On the upper right of the device click the Device Menu () > File Transfer.
    The File Transfer dialog opens.
  5. Use the dialog to transfer files between your PC and the Edge Device.
  6. When all transfers are finished click Close.

Activate System Monitoring #

The TeamViewer IoT Agent comes with a pre-configured monitor for monitoring the operating system of your Edge Device. This is helpful to monitor the status and the health of your devices.

You can use this feature to keep track of the following device operating system metrics:

  • 1 min load
  • 5 min load
  • 15 min load
  • Free Memory
  • Total Memory
  • Free Swap Memory
  • Total Swap Memory
  • Buffers Memory
  • Cached Memory
  • Number of CPU cores
  • User CPU Usage
  • Nice CPU Usage
  • System CPU Usage
  • Idle CPU Usage
  • Io Wait CPU Usage

What you will need

Make sure that you have prepared the following points:

Setup

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Inventory.
  3. On the right side from the dropdown menu Add select Sensor.
  1. Depending on which data you want to monitor, activate CPU, Memory or Load.
  1. From the dropdown menu Select Device select the Edge Device you want to monitor. The Sensor Name will be generated automatically with the selected option.
  2. Select the frequency by which the data will be sent to the TeamViewer IoT Cloud. It can be defined in seconds or minutes.
  1. To finish click Add. You will be redirected automatically to the Inventory.
  2. From the list choose the Sensor you want to monitor, then from the dropdown menu select Pin to Dashboard.

You can use Rules and Notifications if you want to receive a notification when the health of your Edge Device is in danger. For example: receive a warning if the CPU usage is above 90%.

Integrate TeamViewer IoT with AWS IoT Greengrass #

Publish and subscribe data from the edge device to your AWS IoT Greengrass platform and vice-versa.

To accomplish this task you need to follow the steps in this article:

  1. Create AWS IoT Greengrass group
  2. Install and Start AWS IoT Greengrass on the Edge Device
  3. Start AWS IoT Greengrass on the Edge Device

What you will need

Make sure that you have prepared the following points:

Create AWS IoT Greengrass group

 

An AWS IoT Greengrass group contains settings and other information about its components, such as devices, Lambda functions, and connectors. A group defines how its components can interact with each other.

  1. On your PC sign in to AWS Management Console and open the AWS IoT console.
  2. From the left menu click Greengrass.
  1. On the Welcome to AWS IoT Greengrass page, click Create a Group.
  2. To allow the console to create or configure the Greengrass service role for you click Grant permission.
  1. On the Set up your Greengrass group page, select Use default creation to create a group.
  1. Enter a name for your group (for example, MyFirstGroup), and then click Next.
  2. On the Review Group creation page, select Create Group and Core.
  3. Download your core’s security resources and configuration file. On the confirmation page, under Download and store your Core’s security resources, choose Download these resources as a tar.gz.
The name of your downloaded tar.gz file starts with a 10-digit hash that’s also used for the certificate and key file names.
Download the security resources before you click Finish.
  1. After the download click Finish.

Install AWS IoT Greengrass on the Edge Device

You need the security resources which you have downloaded when creating an AWS IoT Greengrass group.

 

  1. Download the AWS IoT Greengrass Core software installation package. select the CPU architecture and distribution (and operating system, if necessary) that best describe your core device.
    • For Raspberry Pi Model B or B+, download the Armv7l for Raspbian package.
    • For an Amazon EC2 instance, download the x86_64 for Linux package.
  2. Use Transfer Files to transfer the AWS IoT Greengrass Core software (greengrass-XXXXXX.tar.gz) and the security resources YYYYYY-setup.tar.gzto the user folder on the edge device (default /home/pi/).
  3. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  4. Navigate to the user folder on the edge device where you transferred the files.
  5. To decompress the files type in the following commands and press enter:
sudo tar -xzvf greengrass-OS-architecture-1.10.0.tar.gz -C
sudo tar -xzvf hash-setup.tar.gz -C /greengrass
  1. To download the ATS root CA certificate type in the following command and press enter:
cd /greengrass/certs/ sudo wget -O root.ca.pem https://www.amazontrust.com/repository/AmazonRootCA1.pem
We recommend that you use Amazon Trust Services (ATS) endpoints and ATS root CA certificates. Certificates enable your device to communicate with AWS IoT using the MQTT messaging protocol over TLS.
  1. Start AWS IoT Greengrass on your edge device type in the following commands and press enter:
cd /greengrass/ggc/core/
sudo ./greengrassd start
  1. When the message “Greengrass successfully started” is displayed take a note of the PID-number.
  2. To check if the AWS IoT Greengrass daemon is functioning type in the following command and press enter. Replace PID with the PID-number from the previous step.
ps aux | grep PID

Examples: Lambda Functions on AWS IoT Greengrass #

Replace the paths, client id and sensor id with your own in the lambda functions described below.

Publish Data from the MQTT-Broker to the Amazon Cloud

This lambda function subscribes data from MQTT-Broker from Edge Device and publishes is to the Amazon Cloud to the topic tv/greengrass.

#!/usr/bin/python
import paho.mqtt.subscribe as subscribe
import paho.mqtt.publish as publish
import traceback
import json

def function_handler(event, context):
    return

# AWS part
# Change following parameters
aws_host = "a10kx625z9icrs-ats.iot.eu-central-1.amazonaws.com"  # Endpoint
aws_port = 8883
aws_tls = {'certfile': "/home/pi/Downloads/certs/1b9a6e0dcb.cert.pem",
           'keyfile': "/home/pi/Downloads/certs/1b9a6e0dcb.private.key",
           'ca_certs': "/home/pi/Downloads/certs/root.ca.pem"
           }

# TV part
#Change following parameters
tv_iot_api_version = "v1.0"
tv_host = "localhost"
tv_port = 18884

tv_tls = {'certfile': "/home/pi/Downloads/test_client_greengrass/cert-7a2b7efc1ad1473d87e049517a19628b.pem",
          'keyfile': "/home/pi/Downloads/test_client_greengrass/key-7a2b7efc1ad1473d87e049517a19628b.pem",
          'ca_certs': "/home/pi/Downloads/test_client_greengrass/TeamViewerAuthority.crt"}

client_id = "fd9e67783b7441ffb7cd62dda121567a"
sensor_id = "111804"

def subscribe_data():
    try:
        mqtt_topic_subscribe_data = "/" + tv_iot_api_version + "/" + client_id + "/sensor/" + sensor_id + "/livedata"
        print("Suscribing to " + mqtt_topic_subscribe_data)
        subscribe.callback(on_subscribe, mqtt_topic_subscribe_data, hostname=tv_host, port=tv_port, tls=tv_tls)
    except Exception as e:
        traceback.print_exc()
        print(str(e))

def on_subscribe(client, userdata, message):
    json_message = json.loads(message.payload.decode('utf8'))
    msgArr = []
    for metric in json_message["metrics"]:
        messageJ = {}
        messageJ['metricId'] = metric["metricId"]
        messageJ['metricValue'] = metric["value"]
        msgArr.append(messageJ)

    msgs = []
    msgs.append({'topic': "tv/greengrass", 'payload': json.dumps(msgArr)})
    print(msgs)
    publish.multiple(msgs, hostname=aws_host, port=aws_port, tls=aws_tls)
subscribe_data()

Fetch Data from the Amazon Cloud

This lambda function subscribes the data from Amazon Cloud and pushes the data to TeamViewer metrics and real-time data can be visualized with the IoT Management Console and the dashboard.

#!/usr/bin/python
import paho.mqtt.subscribe as subscribe
import paho.mqtt.publish as publish
import traceback
import json
import ssl
def function_handler(event, context):
    return

# AWS part
# Change following parameters
aws_host = "a10kx625z9icrs-ats.iot.eu-central-1.amazonaws.com"  # Endpoint
aws_port = 8883
aws_tls = {'certfile': "/home/pi/Downloads/certs/1b9a6e0dcb.cert.pem",
           'keyfile': "/home/pi/Downloads/certs/1b9a6e0dcb.private.key",
           'ca_certs': "/home/pi/Downloads/certs/root.ca.pem",
           'tls_version': ssl.PROTOCOL_TLSv1_2
          }

# TV part
#Change following parameters
tv_iot_api_version = "v1.0"
tv_host = "localhost"
tv_port = 18884

tv_tls = {'certfile': "/home/pi/Downloads/test_client_greengrass/cert-7a2b7efc1ad1473d87e049517a19628b.pem",
          'keyfile': "/home/pi/Downloads/test_client_greengrass/key-7a2b7efc1ad1473d87e049517a19628b.pem",
          'ca_certs': "/home/pi/Downloads/test_client_greengrass/TeamViewerAuthority.crt"}

client_id = "7a2b7efc1ad1473d87e049517a19628b"
sensor_id = "71b91c40fb2d4f61bec2fa593172085d"

def aws_subscribe():
    print("Suscribing to tv/greengrassSub")
    subscribe.callback(on_subscribe, "tv/greengrassSub", hostname=aws_host, port=aws_port, tls=aws_tls)

def on_subscribe(client, userdata, message):
    try:
        metric_data = json.loads(message.payload.decode('utf8'))
        mqtt_topic_push_data = "/" + tv_iot_api_version + "/" + client_id + "/sensor/" + sensor_id + "/metric/pushValues"
        # metric_data =  {"metrics": [{"value": 1, "metricId": "7ad8ad3e2dbe4cdcba0ee3ec0cbd2717"}]}
        msgs = []
        msgs.append({'topic': mqtt_topic_push_data, 'payload': json.dumps(metric_data)})
        print(msgs)
        publish.multiple(msgs, hostname=tv_host, port=tv_port, tls=tv_tls)

    except Exception as e:
        traceback.print_exc()
        print(str(e))
aws_subscribe()

Security #

TeamViewer IoT uses full encryption.

The encryption is based on 2048 Bit RSA private/public key exchange and 256 Bit AES session encoding. This uses the same security level as https/SSL and is considered completely safe by today’s standards.

The key exchange also guarantees that the data transfer is completely encoded from client to client and that any routers or servers in between (including our routers) are unable to read or analyze the data stream.

Activate Two-Factor Authentication #

Protect your TeamViewer account and thus your Computers & Contacts list from unauthorized access with an additional security code.

Activate

The TeamViewer Management Console manages the two-factor authentication. You need your TeamViewer Account credentials to access the Management Console.

  1. To log in to the Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the top menu click your user name > Edit profile.
    The dialog Profile Settings opens.
  3. Click General > Two-factor authentication, then click Activate.
    Your recovery code is shown.
  4. Download, print or copy the recovery code, then click Continue.
  5. Click Save to finish the activation.

See also Recovery Code for Two-Factor Authentication.

Video Tutorial: Activate

This video shows you step by step how to activate the two-factor authentication for your TeamViewer Account.

Deactivate

There are two possible ways to deactivate two-factor authentication.

Using your profile settings

The TeamViewer Management Console manages the two-factor authentication. You need your TeamViewer Account credentials to access the Management Console.

  1. To log in to the Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the top menu click your user name > Edit profile.
    The dialog Profile Settings opens.
  3. Click General > Two-factor authentication, then click Deactivate.

Using the Recovery Code

You need your TeamViewer Account credentials and your recovery code to deactivate the two-factor authentication.

  1. To navigate to the Management Console, open https://teamviewer-iot.com/LogOn#deactivate-tfa.
  2. Use your TeamViewer account credentials and your recovery code.

Authorize a Trusted Device #

Trusted Devices provides an extra layer of security for your TeamViewer Account. As a preventive measure to ensure your account’s security, you need to authorize new devices on which you sign in to your TeamViewer Account for the first time.

Due to technical reasons there is more than one trust per device. You will need to set separate trusts for the TeamViewer client, the Management Console (per browser), and each TeamViewer application.

The browser trusts will be lost, when the cookies are deleted.

What you will need

Make sure that you have prepared the following points:

  • Your TeamViewer credentials.
    If you don’t have an account yet, visit https://www.teamviewer.com/ to create a new account.
  • TeamViewer Client is installed.

Setup

  1. On your PC open the TeamViewer Client and log in for the first time.
  2. Confirm the message dialog.
    A device authorization email is sent to the email address of your TeamViewer account.
The link in this email is valid for 24 hours. If the link expires, you will need to authorize a trusted device again.
  1. Click the link within the email to authorize the device.
    You will be forwarded to the TeamViewer Management Console.
  2. To complete the authorization process, select the kind of trust scope you would like to grant. Then click Trust.
  3. From the dropdown menu select whether you would like to trust this specific device or the IP address permanently or whether you would like to trust this device only once:
OptionDescription
Trust deviceYou are setting the trust for the specific device.
Trust IP addressYou can decide whether you would like to trust a single device only or if you would like to trust the IP address. That means your account’s trust is extended to all other devices in the same local network. You can now log in with all devices/instances that log in from the trusted IP address.
When the IP address changes, you will get the trusted device mails only for new devices, that haven’t signed in before the IP address has changed.
Trust only onceThis trust scope can be used, when you only want to log in on the device once (on a device from your customer, in an Internet cafe,… ). It is only valid for one login on the device.
The trust will be deleted after you logged in from the trusted device. When you retry to log in you will get the trusted device message again.

A message is displayed in the Management Console informing you that the new device is now a trusted device.

Once you complete the authorization process, you are able to sign in on the new device with your TeamViewer account credentials.

Recovery Code for Two-Factor Authentication #

When activating two-factor authentication for your TeamViewer Account, you get an individual recovery code.

Store the recovery code in a safe place.

If you lose access to your mobile device or to the authenticator app on your device, the recovery code is your last resort to deactivate two-factor authentication.

Do not send the recovery code unencrypted via email since this could give an unauthorized user access to it. After deactivating two-factor authentication with the recovery code, you can always reactivate two-factor authentication for your user.

Keep the recovery code in a safe place. The two-factor authentication can not be deactivated by TeamViewer. If you lose your recovery key, you will also lose access to all TeamViewer features where your account is needed.
Print more than one copy of your recovery code when setting up your two-factor authentication in case a copy gets lost or gets destroyed.

View Recovery Code

The TeamViewer Management Console manages the recovery code. You need your TeamViewer Account credentials to access the Management Console.

Example Recovery Code
  1. To log in to the Management Console, open https://login.teamviewer.com/ and use your TeamViewer account credentials.
  2. From the top menu click your user name > Edit profile.
    The dialog Profile Settings opens.
  3. Click General > View Recovery Code.
Suggest Edit
Want more? Exclusive deals, the latest news: Our Newsletter!