Open main menu

DAVE Developer's Wiki β

Difference between revisions of "MISC-TN-024: Automated test equipment (ATE) monitoring with SBCSPG gateway and ThingsBoard IoT platform"

(Created page with "{{InfoBoxTop}} {{AppliesToSBCSPG}} {{AppliesTo SBC Lynx TN}} {{AppliesToIoT}} {{AppliesTo IoT TN}} {{InfoBoxBottom}} {{WarningMessage|text=This technical note was validated ag...")
 
(Dashboards)
 
(12 intermediate revisions by the same user not shown)
Line 23: Line 23:
  
 
==Introduction==
 
==Introduction==
This Technical Note (TN)  
+
You can think about this This Technical Note (TN) as an evolution of the article "[[MISC-TN-021: SBCSPG and ThingsBoard IoT]]". The use case described here is a real-world application based on the same elements:
 +
* [[MISC-TN-004: Running Debian (armbian) on SBCSPG#The hardware platform|The ''SBCSPG'' industrial gateway]]
 +
* [https://thingsboard.io/docs/ ''ThingsBoard IoT platform'']
 +
* [https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/ ''ThingsBoard IoT gateway''].
 +
The application is to monitor robotized DAVE Embedded Systems' ATEs like the one shown [https://youtu.be/OoNiKgJXq00?t=409 here].
  
illustrates how to run [https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/ ''ThingsBoard IoT Gateway'' software] on the
+
== Implementation ==
 +
The implementation is suitable for a production environment. Unlike what we did for [[MISC-TN-021: SBCSPG and ThingsBoard IoT|this TN]], in this case the ThingsBoard IoT platform was installed on the cloud, specifically on an AWS EC2 instance running Ubuntu Linux. The following diagram shows the complete solution.
 +
 
 +
[[File:ATE monitoring SBCSPG ThingsBoard.png|center|thumb|1000x1000px]]
 +
 
 +
Technically, the gateway can communicate with the ATE using different physical links and protocols. In the example under discussion, the physical link is Ethernet and the protocol is Modbus/TCP. The gateway retrieves periodically some data regarding the robotic arm used to move the device under test (DUT). These data are [https://www.universal-robots.com/articles/ur/interface-communication/modbus-server/ exposed by the PLC governing the arm] and are documented in detail [https://s3-eu-west-1.amazonaws.com/ur-support-site/16377/ModBus%20server%20data.pdf here].
 +
 
 +
=== ThingsBoard IoT configuration ===
 +
To install ThingsBoard IoT platform on an EC2 instance, [https://thingsboard.io/docs/user-guide/install/cluster/aws-self-hosted-setup/ these instructions] were followed.
 +
 
 +
=== ThingsBoard IoT gateway configuration ===
 +
To run this esample, the most important module to configure was the [https://thingsboard.io/docs/iot-gateway/config/modbus/ Modbus connector]. The following box shows the resulting configuration file needed to poll some variables of the arm's joints (namely temperatures and currents).<syntaxhighlight lang="json">
 +
armbian@sbcspg:~$ cat /etc/thingsboard-gateway/config/modbus.json
 +
{
 +
    "master": {
 +
      "slaves": [
 +
        {
 +
          "host": "192.168.30.42",
 +
          "port": 502,
 +
          "type": "tcp",
 +
          "method": "socket",
 +
          "timeout": 35,
 +
          "byteOrder": "BIG",
 +
          "retries": true,
 +
          "retryOnEmpty": true,
 +
          "retryOnInvalid": true,
 +
          "pollPeriod": 5000,
 +
          "unitId": 1,
 +
          "deviceName": "UR5",
 +
          "sendDataOnlyOnChange": true,
 +
          "connectAttemptTimeMs": 5000,
 +
          "connectAttemptCount": 5,
 +
          "waitAfterFailedAttemptsMs": 300000,
 +
          "timeseries": [
 +
            {
 +
              "tag": "base_joint_temperature_deg_C",
 +
              "type": "16int",
 +
              "functionCode": 3,
 +
              "objectsCount": 1,
 +
              "address": 300
 +
            },
 +
            {
 +
              "tag": "shoulder_joint_temperature_deg_C",
 +
              "type": "16int",
 +
              "functionCode": 3,
 +
              "objectsCount": 1,
 +
              "address": 301
 +
            },
 +
            {
 +
                "tag": "base_joint_current_mA",
 +
                "type": "16int",
 +
                "functionCode": 3,
 +
                "objectsCount": 1,
 +
                "address": 290
 +
            },
 +
            {
 +
                "tag": "shoulder_joint_current_mA",
 +
                "type": "16int",
 +
                "functionCode": 3,
 +
                "objectsCount": 1,
 +
                "address": 291
 +
            },
 +
            {
 +
                "tag": "elbow_joint_current_mA",
 +
                "type": "16int",
 +
                "functionCode": 3,
 +
                "objectsCount": 1,
 +
                "address": 292
 +
            },
 +
            {
 +
              "tag": "wrist1_joint_current_mA",
 +
              "type": "16int",
 +
              "functionCode": 3,
 +
              "objectsCount": 1,
 +
              "address": 293
 +
            },
 +
            {
 +
                "tag": "wrist2_joint_current_mA",
 +
                "type": "16int",
 +
                "functionCode": 3,
 +
                "objectsCount": 1,
 +
                "address": 294
 +
            },
 +
            {
 +
                "tag": "wrist3_joint_current_mA",
 +
                "type": "16int",
 +
                "functionCode": 3,
 +
                "objectsCount": 1,
 +
                "address": 295
 +
            }
 +
          ]
 +
        }
 +
      ]
 +
    }
 +
  }
 +
</syntaxhighlight>
 +
 
 +
== Dashboards ==
 +
ThingsBoard IoT allows to create easily custom dashboards to visualize data. At [http://ec2-15-160-117-174.eu-south-1.compute.amazonaws.com:8080/dashboard/1178fb20-e56d-11ec-8592-e3cb29424137?publicId=28967df0-e56d-11ec-8592-e3cb29424137 this link] such a dashboard is available showing some temperatures and currents of the arm's joints.
 +
[[File:ATE monitoring SBCSPG ThingsBoard dashboard2.png|center|thumb|600x600px]]

Latest revision as of 07:52, 14 February 2023

Info Box
SBCSPG-1.jpg Applies to SBCSPG
Cloud-computing-banner.jpg Applies to IoT
Warning-icon.png This technical note was validated against specific versions of hardware and software. It may not work with other versions. Warning-icon.png


Contents

HistoryEdit

Version Date Notes
1.0.0 June 2022 First public release

IntroductionEdit

You can think about this This Technical Note (TN) as an evolution of the article "MISC-TN-021: SBCSPG and ThingsBoard IoT". The use case described here is a real-world application based on the same elements:

The application is to monitor robotized DAVE Embedded Systems' ATEs like the one shown here.

ImplementationEdit

The implementation is suitable for a production environment. Unlike what we did for this TN, in this case the ThingsBoard IoT platform was installed on the cloud, specifically on an AWS EC2 instance running Ubuntu Linux. The following diagram shows the complete solution.

Technically, the gateway can communicate with the ATE using different physical links and protocols. In the example under discussion, the physical link is Ethernet and the protocol is Modbus/TCP. The gateway retrieves periodically some data regarding the robotic arm used to move the device under test (DUT). These data are exposed by the PLC governing the arm and are documented in detail here.

ThingsBoard IoT configurationEdit

To install ThingsBoard IoT platform on an EC2 instance, these instructions were followed.

ThingsBoard IoT gateway configurationEdit

To run this esample, the most important module to configure was the Modbus connector. The following box shows the resulting configuration file needed to poll some variables of the arm's joints (namely temperatures and currents).

armbian@sbcspg:~$ cat /etc/thingsboard-gateway/config/modbus.json
{
    "master": {
      "slaves": [
        {
          "host": "192.168.30.42",
          "port": 502,
          "type": "tcp",
          "method": "socket",
          "timeout": 35,
          "byteOrder": "BIG",
          "retries": true,
          "retryOnEmpty": true,
          "retryOnInvalid": true,
          "pollPeriod": 5000,
          "unitId": 1,
          "deviceName": "UR5",
          "sendDataOnlyOnChange": true,
          "connectAttemptTimeMs": 5000,
          "connectAttemptCount": 5,
          "waitAfterFailedAttemptsMs": 300000,
          "timeseries": [
            {
              "tag": "base_joint_temperature_deg_C",
              "type": "16int",
              "functionCode": 3,
              "objectsCount": 1,
              "address": 300
            },
            {
              "tag": "shoulder_joint_temperature_deg_C",
              "type": "16int",
              "functionCode": 3,
              "objectsCount": 1,
              "address": 301
            },
            {
                "tag": "base_joint_current_mA",
                "type": "16int",
                "functionCode": 3,
                "objectsCount": 1,
                "address": 290
            },
            {
                "tag": "shoulder_joint_current_mA",
                "type": "16int",
                "functionCode": 3,
                "objectsCount": 1,
                "address": 291
            },
            {
                "tag": "elbow_joint_current_mA",
                "type": "16int",
                "functionCode": 3,
                "objectsCount": 1,
                "address": 292
            },
            {
              "tag": "wrist1_joint_current_mA",
              "type": "16int",
              "functionCode": 3,
              "objectsCount": 1,
              "address": 293
            },
            {
                "tag": "wrist2_joint_current_mA",
                "type": "16int",
                "functionCode": 3,
                "objectsCount": 1,
                "address": 294
            },
            {
                "tag": "wrist3_joint_current_mA",
                "type": "16int",
                "functionCode": 3,
                "objectsCount": 1,
                "address": 295
            }
          ]
        }
      ]
    }
  }

DashboardsEdit

ThingsBoard IoT allows to create easily custom dashboards to visualize data. At this link such a dashboard is available showing some temperatures and currents of the arm's joints.