Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToC and Prelim. Script for Tutorials 10, 11 and 12 #161

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions Tutorials/whatiswot/10-Building_Blocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Building Blocks

## Table of Contents

- Explaining Building Block Concept
- TD
- Bindings
- Discovery
- Scripting API
- Profiles
- Summary

## Preliminary Script

- In this video, we give a short introduction to each building block of the Web of Things — Thing Description, Binding Templates, Discovery, and Scripting API. Later, in separate videos, we will explore each individual building block in more detail.

### But what are building blocks, exactly?

- Building blocks allow the implementation of systems that conform with the abstract WoT Architecture. Let's take a closer look at the WoT building blocks.

- A Thing always has a TD, a Thing Description. It is a key building block that provides metadata describing a Thing and its network interface. This TD can be shared directly by the Thing or through the TD Directory — which is what we call Discovery. Things and consumers can be programmed with the Scripting API.

### Thing Description

- Let’s begin with the Thing Description, or TD — a key component of the WoT.

- All TDs can be processed just like normal JSON documents. Essentially, a TD defines an information model using a semantic vocabulary and a serialized JSON representation. It provides human- and machine-readable metadata describing the capabilities of a Thing.

- A TD describes a Thing instance with general metadata such as name, ID, and description. A TD can also contain Interaction Affordance metadata and Protocol Bindings such as Modbus and HTTP, as well as both public and local IP addresses.

- Here is an example of a TD. This is the JSON serialization of a TD of a temperature controller. It tells the consumer to send a Modbus request to read the temperature in the local network. The Thing can be proxied by a gateway where an HTTP request will be sent instead of a Modbus request.

<!-- Reference picture from whiteboard. Create an asset that could be used in the future as well.
|Temperature Controller|
|Current Temperature |
|Modbus | Local Network|
Can be side by side with code snippet.-->

```js
{
"title":"Temperature Controller",
"properties":{
"temperature":{
"type":"integer",
"forms":[{
"href":"modbus+tcp://192.168.1.50:183/1/1",
"modv:functionName":"readHoldingRegisters",
"contentType":"text/octet-stream;length=2"
}]
}
}
}

```

```js
{
"title":"Temperature Controller",
"properties":{
"temperature":{
"type":"integer",
"forms":[{
"href":"https://mywotgateway.com/temperaturecontroller/properties/temperature",
"htv:methodName":"GET",
"contentType":"application/json"
}]
}
}
}

```

<!-- - The WoT TD building block enhances interoperability. The goal is to enable communication within machines or controllers. -->

<!-- Change robot to better match temperature controller example. Dashboard thermometer thingy
Thing (Box cube shape) <-- Temperature sensor image

ALL OF THIS AFTER BINDINGS -->

### Bindings

- The second building block is WoT Binding Templates.

- The IoT uses a variety of protocols for accessing devices because no single protocol is enough to cover the different use cases and requirements. The challenge of the WoT is to enable interactions of a variety of different IoT platforms.

- The Binding Templates address an application client to use the TD so that they can extract metadata of the protocols such as HTTP, Modbus, etc. In general, Binding Templates provide a collection of blueprints that give guidance on how to interact with different Things that use different transport protocols and content types.

### Discovery

- The next building block is WoT Discovery.

- WoT Thing Descriptions must be known or accessible to other systems and devices.

- WoT Discovery accomplishes this by defining mechanisms for distributing and accessing WoT TD over the network.

- These mechanisms are used to simplify access to Things and services, and to support their integration. They are not limited to a local area network; they also support remote discovery.

- Thing Description Directory service provides mechanisms to register and retrieve WoT metadata and TDs after authentication and authorization.

### Scripting API

- Next is an optional building block of W3C, the WoT Scripting API.

- The Scripting API makes it easier to develop IoT applications by providing an ECMAScript-based API, similar to the Web browser APIs.

<!-- Show code directly, Don't care about ECMA, "With this you can build your applications" (start with dashboard, then show the code) -->

- “Once you get the TDs, you build apps”?
TODO: Needs more content

### Profiles

- By nature, TD is flexible and able to describe anything without any limitations.

- In some cases, depending on the Thing’s purpose, it may be a good idea to limit the TD to prevent unnecessary implementation load.

### Summary

- To summarize, WoT enables implementing device logic by reusable scripts executed in a runtime system for IoT applications which aims to improve productivity and reduce integration costs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Applications in Smart Homes and Smart Cities

## Table of Contents

- Smart Homes
- Architecture Patterns
- Controllers
- Gateways
- Smart Cities

## Preliminary Script

- In this two-part tutorial, we will introduce the W3C Web of Things by exploring its application domains and common architecture patterns. In this video, our focus will be Smart Homes and Smart Cities.

### Smart Homes

- In smart homes, the ability to connect and manage multiple assets remotely over the network is highly beneficial.

- The interesting aspect of smart homes isn’t tied to a specific solution you buy, but rather in how WoT enables flexibility. Manufacturers can provide Thing Descriptions (TDs) for their devices, which lets anyone build and customize their own systems. By following these open standards, devices can communicate with each other across brands, allowing for seamless integration. This approach ensures that devices remain adaptable and private, and don’t become obsolete, as they can continuously support new use cases and technologies.

- This helps with various activities within the home, such as controlling lights, adjusting room temperature, managing home appliances, and enhancing security using smartphones. These capabilities enable optimization of energy and resource consumption.

**Graphic:** `House with many WoT-powered devices, showcasing Thing Description of the house`

#### Architecture patterns

In smart homes, we can see common architecture patterns. In this video, we will explain Controller and Gateway patterns.

1. **Controllers:**

- A common pattern involves using a controller, locally and/or remotely, to interact with devices on the home network by consuming the Thing Description.

- Devices are represented by TDs and act as servers, responding to commands from client controllers (e.g., smartphones) for actions such as adjusting settings or activating sensors.

**Graphic:** `TD of the house transitions into a phone interface (controller) demonstrating interactions with different devices`

2. **Gateways:**

- Consumer can control it both locally or fully remotely.
- Gateways connect home networks to the internet, enabling remote management and monitoring.
- They facilitate communication between local devices and external controllers, enhancing accessibility and control.

**Graphic:** `Old Video 11 Cloud Gateway Animation`

### Smart cities

- Similar to smart homes, monitoring of smart cities via the Web of Thigns is possible. In this case, end users are akin to citizens of municipalities and government agencies.

- Smart cities need to cover multiple domains like water management, air quality monitoring, etc., similar to a website selling cars, pumps, brakes — i.e., multiple things in one place. Since WoT is composed of open standards, it can be reliably used by municipalities.
egekorkan marked this conversation as resolved.
Show resolved Hide resolved

- In smart cities, bridges, dams, and canals can be monitored for material conditions and deterioration calling for maintenance repair work to prevent significant damage. Parking spaces and street lights can be monitored for crowd management and optimized usage, too.
egekorkan marked this conversation as resolved.
Show resolved Hide resolved

- Different managers who manage different Things — multi-ownership.

> Show TDs for every Thing.

Since it’s so big, there’s usually a mix of architectures.
egekorkan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Applications in Industrial and Agriculture Systems

## Table of Contents

- Brief Introduction
- Industrial Systems
- Agriculture Systems
- Cross-domain Collaboration

## Preliminary Script

- Industrial applications of WoT involves more complex use cases than smart homes.

- In industrial systems, devices from different manufacturers need to work together for a single use case. WoT supports this by accommodating various industry protocols, including legacy ones, ensuring seamless integration. The use of Thing Descriptions (TDs) allows devices to self-describe their capabilities, reducing the engineering effort needed to make them compatible.

### Industrial systems

- Industrial applications may resemble smart home applications but have broader requirements, such as advanced monitoring of connected manufacturing equipment as well as the manufactured products and prediction of possible machine failure.

- Mention different protocols in factories and show TDs

### Agriculture systems

- Another domain-specific application is in agriculture systems.

- With WoT, soil conditions can be monitored and optimal plans for watering and fertilizing can be created. Depending on the need, agricultural devices can be controlled remotely. Thus, the quality and quantity of the harvest can be increased.
egekorkan marked this conversation as resolved.
Show resolved Hide resolved

### Cross-domain Collaboration

- In cross-domain collaborations, each system involves other systems in other domains. For example, Smart Factory with Smart City, Smart City with Smart Home. In these models, information can be exchanged directly between systems in a peer-to-peer manner or indirectly via collaboration platforms.
egekorkan marked this conversation as resolved.
Show resolved Hide resolved