This project captures the Lab Module exercises and associated requirements designed to be implemented sequentially - in order - from Lab Module 01 to Lab Module 10. Some of the content is derived from my O'Reilly Media book, Programming the Internet of Things, which is a useful reference for building the Edge Device Application and message-passing logic between it and the Digital Twin Application.
All Lab Module exercises can be found here (NOTE: The tasks contained in this repository are 'issues' which are ordered within the Kanban Board listed below):
The LabBenchStudios-PDT-Unity research project is intended to be used with this pdt-exercise-tasks repository and has three primary objectives:
(1) Build a largely F/OSS Digital Twin framework that can work with other Programming Digital Twins projects and their repositories to sync live data, DTDL models, and a JSON-based constraint mapping layer, and render within a COTS physics sim engine (e.g., Unity 6).
(2) Use a digital twin asset's configuration data to auto-generate a GPT AI prompt to query one or more locally running LLM's to retrieve predictive maintenance recommendations for the specific system within the Digital Twin environment.
(3) Provide a baseline technology platform for my Northeastern University College of Engineering graduate students (and me) to learn and experiment with various Digital Twin use cases.
NOTE: The exercise tasks (or Issues) contained in this repository are contained within an ordered Kanban Board to the reader can build their own experimental digital twins platform.
PDT Kanban Board: Programming Digital Twins Requirements
Please see the following links for some helpful information about the PDT exercises and other associated repositories. Please note that many of the exercises and sample source code in this repository is based on some of the patterns and exercises from my book, Programming the Internet of Things Book.
- Programming Digital Twins (PDT) specific:
- Other reading links:
-
Step 1: Review the Kanban Board - this contains all exercise tasks within an ordered board
- Available here: Programming Digital Twins Kanban Board
- There are dozens of exercises listed, each part of building a basic, end-to-end Digital Twin solution - step by step. This content is based on the course I created for teaching introductory IoT and Digital Twins concepts in a lab-based University course.
- Available here: Programming Digital Twins Kanban Board
-
Step 2: Review the two primary code and asset repositories (there are four total, but the following two repositories are most important for moving out with the Kanban Board exercises):
- EDA - pdt-edge-components: PDT Edge Device Application (written in Python)
- This repository contains the Python-based application that can interact with the Digital Twin App (DTA) via an MQTT broker.
- PUP - LabBenchStudios-PDT-Unity: PDT Unity Package (Unity C# scripts, prefabs, models, and more)
- NOTE: Since the PDT Unity Package (PUP) already contains the PDT Client Framework (CFW) DLL (Lbs.Pdt.ClientFramework.dll) listed next, along with other DLL dependencies. As such, it can be installed as a Unity Package within the Unity Editor via its git URL; therefore, only the EDA and PUP repositories are required for the course. The CFW repository is available for perusal as needed.
- EDA - pdt-edge-components: PDT Edge Device Application (written in Python)
-
Step 3: If you're a student in Building Digital Twins, review the doc templates (REQUIRED) and client framework repositories (OPTIONAL):
- EDT - pdt-exercise-docs: Exercise Doc Templates (Markdown)
- These markdown files are necessary for students of Building Digital Twins, as they will be part of each lab module assignment and need to be submitted as part of the lab module work.
- CFW - pdt-cfw-components: PDT Client Framework (written in C#)
- The client framework comprises the
LBS.PdtClientFramework.dllthat is used by the PUP and enables the DTA to communicate with the EDA via MQTT, and interpret incoming telemetry from the EDA. It also supports parsing of DTDL-based models and synchronization of models to EDA telemetry via another JSON-based mapping layer.
- The client framework comprises the
- EDT - pdt-exercise-docs: Exercise Doc Templates (Markdown)
-
Step 4: Start building your Digital Twin
- Implement each lab module described in the Programming Digital Twins Kanban Board
- Run the tests described in each module to verify functionality works as expected
- Have fun building!
- Implement each lab module described in the Programming Digital Twins Kanban Board
The requirements contained within this repository are captured as a simple list of dozens of tasks and activities - some are documentation-specific while most are programming-specific - and labeled according to activity category, chapter, and implementation order.
Lab Modules are organized into 'parts', which are intended to represent categories of exercises that are related, yet are also designed to be implemented in sequence, as each part is intended to be implemented in sequence (e.g., Part 01 first, with each lab module implemented in order, followed by Part 02, etc.) Lab module details are currently under development and will be linked here when available. For now, the structure is as follows:
Each exercise within a given Lab Module is labeled using one or more of the following categories:
- build: Build and / or DevOps related task (e.g., checkout a new branch).
- configuration: Configuration related task (e.g., install some software).
- documentation: Documentation related task (e.g., write-up your approach).
- exercise: Required exercise related task (i.e., you should implement this).
- additional: Optional (additional) exercise task (i.e., if you're a student in my class, you should implement this, although it is currently optional).
- integration: Test and integration related task (e.g., test connection between apps).
Exercises and notes are named according to the following convention:
{project name}-{category}-{lab module #}-{sequence #}
This naming convention is designed to help you navigate through the requirements in each Lab Module sequentially, building your solution in a step-by-step manner. The naming breakdown is as follows:
- project name:
- PDT: The project name (Programming the Digital Twins).
- category:
- DOC: General documentation that provides a summary overview of the section or lab module.
- INF: An informational note.
- STU: A student-specific requirement, usually documentation-related (this is relevant if enrolled in the Connected Devices course, for example).
- CFG: A configuration requirement.
- EDA: An Edge Device App (EDA)-specific requirement.
- CFW: A Client Framework (CFW)-specific requirement.
- DTA: A Digital Twin App (DTA)-specific requirement.
- INT: An integration requirement that may depend upon other requirements specific to those labeled as CFG, EDA and / or DTA.
- lab module #:
- 01 - 10: Depicts the order of implementation for the various lab modules.
- sequence #:
- 001 - 099: Depicts the order in which the requirements should be implemented. Note that sequence #'s 000 and 100 are reserved, as indicated in the NOTE below.
The structure of each chapter's notes and requirements are sequenced based on the ordered guidelines listed below:
- FIRST: Read the information (INF) notes to help guide you through the exercises.
- Example (INF): PDT-INF-01-001 is the first (001) note in Lab Module 01 associated with Programming Digital Twins (PDT), and is for informational (INF) purposes.
- SECOND: If you're a student in a PDT-specific course (e.g., Building Digital Twins), read through the STU category requirements to prepare for each exercise. Else, skip to the THIRD guideline.
- Example (STU): PDT-STU-02-001 is the first (001) student-specific task in Lab Module 02 associated with Programming Digital Twins (PDT).
- THIRD: Read and implement the configuration (CFG) requirements to prepare for each exercise.
- Example (CFG): PDT-CFG-02-001 is the first (001) configuration-specific task in Lab Module 02 associated with Programming Digital Twins (PDT).
- FOURTH: Read and implement each exercise related to the Edge Device App (EDA) and / or the Digital Twin App (DTA).
- Example (EDA): PDT-EDA-01-001 is the first (001) EDA task in Lab Module 01 associated with Programming Digital Twins (PDT). It only applies to the Edge Device App (EDA).
- Example (DTA): PDT-DTA-05-002 is the second (002) DTA task in Lab Module 05 associated with Programming Digital Twins (PDT). It only applies to the Digital Twin App (DTA), and should be implemented after PDT-DTA-05-001.
- FIFTH: Read and implement any integration exercise(s) to verify your functionality is working properly.
- Example (INT): PDT-INT-05-001 is the first (001) integration task in Lab Module 05 associated with Programming Digital Twins (PDT). Unless otherwise specified, it should be implemented AFTER all CFG, EDA, and DTA related tasks.
NOTE: As alluded to previously, an exception to the numbering sequence scheme is made for build-specific tasks related to the EDA and DTA. The initial build requirement (check out a new branch) is numbered '000' for each component (e.g., PDT-EDA-02-000) and should be implemented before any other component-specific requirement, and '100' for the final build requirement (e.g., PDT-EDA-02-100), which should be implemented after all other component-specific requirements.
PR's are disabled while the codebase is being developed.
Much of this repository, and in particular unit and integration tests, will continue to evolve, so please check back regularly for potential updates. Please note that API changes can - and likely will - occur at any time.
- DTDLParser
- Reference: Digital Twin Consortium and contributors. (2024) [Online]. Available: https://github.com/digitaltwinconsortium/DTDLParser.
- InfluxDB.Client
- Reference: Influx Data, Inc. Influx DB C# Client. (2024) [Online]. Available: https://github.com/influxdata/influxdb-client-csharp.
- InfluxDB v2
- Reference: Influx Data, Inc. Get started with InfluxDB v2. Available: https://docs.influxdata.com/influxdb/v2/. Accessed 01Jan2024.
- Mosquitto MQTT Broker
- Reference: The Eclipse Foundation, Inc. Eclipse Mosquitto - An Open Source MQTT Broker. Available: https://mosquitto.org/. Accessed 15Nov2023.
- MQTT v 3.1.1
- Reference: A. Banks, R. Gupta. MQTT Version 3.1.1. OASIS Standard, 2014. Available: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html.
- MQTTnet
- Reference: .NET Foundation and contributors. MQTTnet .NET library for MQTT communications. (2024) [Online]. Available: https://github.com/dotnet/MQTTnet.
- Newtonsoft.Json
- Reference: James Newton-King. Json.NET JSON framework for .NET. (2024) [Online]. Available: https://github.com/JamesNK/Newtonsoft.Json.
- NUnit
- Reference: Charlie Poole, Rob Prouse. Nunit unit testing framework for .NET languages. (2024) [Online]. Available: https://github.com/nunit.
- OllamaSharp
- Reference: Andreas Wäscher. Provides .NET bindings for the Ollama API. (2025) [Online]. Available: https://github.com/awaescher/OllamaSharp.
- pdt-cfw-components
- Reference: Andrew D. King. Programming Digital Twins Client Framework Components (Client Framework). (2024) [Online]. Available: https://github.com/programming-digital-twins/pdt-cfw-components.
- pdt-edge-components
- Reference: Andrew D. King. Programming Digital Twins Edge Components (Edge Device App). (2024) [Online]. Available: https://github.com/programming-digital-twins/pdt-edge-components.
- pdt-exercise-docs
- Reference: Andrew D. King. Programming Digital Twins Exercise Docs Template. (2024) [Online]. Available: https://github.com/programming-digital-twins/pdt-exercise-docs.
- pdt-unity-components
- Reference: Andrew D. King. Programming Digital Twins Unity Components (Digital Twin App). (2024) [Online]. Available: https://github.com/programming-digital-twins/pdt-unity-components.
- Sense-Emu
- Reference: The Raspberry Pi Foundation. Sense HAT Emulator. Available: https://sense-emu.readthedocs.io/en/v1.0/. Accessed 15Nov2023.
- Unity 3D for Students
- Reference: Unity Technologies. Unity Student Plan. Available: https://unity.com/products/unity-student. Accessed 15Nov2023.
- Visual Studio
- Reference: Microsoft. Visual Studio. Available: https://code.visualstudio.com/. Accessed 04Jan2024.
- Visual Studio Code
- Reference: Microsoft. Visual Studio Code. Available: https://code.visualstudio.com/. Accessed 15Nov2023.
- Wireshark
- Reference: G. Combs et al. Wireshark. Available: https://gitlab.com/wireshark/wireshark. Accessed 15Nov2023.
This code base is under active development.
If any code samples or other technology this work contains, describes, and / or is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
Please see LICENSE information in PDT-DOC-LIC for more information. In summary:
Documentation - Usage and License
This project's written instructions and non-source code documentation - all Notes, Instructions and Cards contained within this Kanban board - are available under the following license:
- Documentation: Copyright © 2024 by Andrew D. King. Licensed under CC BY-NC-SA 4.0
.
- See LICENSE for details.
Source Code Solutions and Examples - Usage and License
This project contains embedded sample source codes representing examples and solutions. Unless otherwise represented, these embedded source codes (C# and Python) are available under the following license:
- Source Codes: Copyright © 2024 Andrew D. King. Licensed under The MIT License.
- See LICENSE-CODE for details.