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

node-wot TDs for 2022-07 #371

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions events/2022.07.Online/TD/node-wot/TDs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# node-wot Implementations
July 2022 Online Plugfest/Testfest

## Siemens
We expose the following virtual *online* things (with [node-wot](https://github.com/eclipse/thingweb.node-wot/)):
* [Smart-Coffee-Machine](http://plugfest.thingweb.io:8083/smart-coffee-machine)
* [TestThing](http://plugfest.thingweb.io:8083/testthing)
* [Multilanguage Counter](http://plugfest.thingweb.io:8083/counter)
* [Smart Charging with Web of Things](https://github.com/sebastiankb/wot-smart-charging)

### WebUIs

Moreover, there are several Web UIs available:
* [Generic WebUI](http://plugfest.thingweb.io/webui/)
* [Smart Coffee Machine - Property Live Monitor](http://plugfest.thingweb.io/examples/smart-coffee-machine.html)
* [Counter UI](http://plugfest.thingweb.io/examples/counter.html)
* [WoT-FXUI](http://plugfest.thingweb.io:8088/test/fullscreen/default)

## TUM
copy TUM-README.md here
101 changes: 101 additions & 0 deletions events/2022.07.Online/TD/node-wot/TDs/TUM-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# TUM Devices

## General Setup

We have a room with controlled lighting where different WoT devices are placed on two desks.
Both the lights and the devices of Desk 1 are regularly turned off everyday from 4am to 6am UTC+2. This can be modified upon request.
The devices are in a local network over WiFi or Ethernet and are bridged over a custom reverse proxy to the public Internet but with Basic Auth.
There are live streams available and more information is available below.
The devices on Desk 1 are more simple devices that can be used by multiple Consumers at the same time.
The devices on Desk 2 are more complex and interacting with them at the same time as another Consumer can cause problems.
More information on the devices are below.

The streams and TDs of devices are available at our homepage at <https://esiremotelab.esi.ei.tum.de/>.

## Authentication for the Web Page

The page linked above needs authentication to access the streams and the streams.
Contact ege.korkan@tum.de to obtain access rights.
These credentials do not give interaction authentication with the devices, you will be provided with a second set of credentials.

We track the usage of the website via Matomo. By requesting access, you agree on the collection of anonymous information about the session.

## Live Streams

We have 3 cameras pointing at the devices on two desks. 1 camera for Desk 1 and 2 for Desk 2.
The streams are provided via WebRTC which requires you to have ports open on 50000 to 502000.
We did not have any issues regarding scalability after one semester of teaching.

## Physical Devices

**Note:** Photos will be uploaded on 28.09.2020

### Desk1

![Desk1 Overview](Images/Desk1/Desk1.jpg "Desk1 Overview")

### Custom Made Devices

- PanTilt HAT: This is a platform meant to attach video surveillance cameras. Ours do not have a camera attached, but the platform can tilt (moving up and down) and pan (moving left and right). The actions are asynchronous, meaning that a response is returned when the request is successful but the platform will keep moving. The platform stops automatically when it reaches end points.
![PanTilt HAT](Images/Desk1/PanTiltHAT.jpg "PanTilt HAT")
- Rainbow HAT: This HAT has different environment sensors, LEDs and touch buttons. The touch buttons are capacitive and need human interaction.
![Rainbow HAT](Images/Desk1/RainbowHAT.jpg "Rainbow HAT")
- Sense HAT: This HAT is similar to RainbowHAT but it has an LED matrix instead of single LEDs and 7 segment displays. There is a button that can be pressed which triggers the event emissions. On Monday, Tuesday and Thursday, this button will be pressed by a robot every 20 minutes.
![Sense HAT](Images/Desk1/SenseHAT.jpg "Sense HAT")
- Unicorn pHAT: This is small LED Matrix.
![Unicorn pHAT](Images/Desk1/UnicornPHAT.jpg "Unicorn pHAT")

**Note:** Most environment sensor values should not be trusted since the sensors are not calibrated. However, they are reliable :)

### Philips Hue Devices

- HueColorLight: This is a light bulb whose color can be adjusted in different ways. The descriptions of each interaction should be read to understand how to use different parameters. The light bulbs do not point to the cameras to not have problems with exposure, they point to the wall behind them.
![Hue Color Light](Images/Desk1/HueColor.jpg "Hue Color Light")
- HueDaylight: This is a software running in the Hue Bridge that tells whether there is daylight outside or not. This is based on the current time and the GPS position. However, the room's windows are covered to have regulated lighting, so not much use of this "sensor".
- HueDimmerSwitch: This is a switch that is preprogrammed to turn off/on the lights and change their brightness. The button presses are not events but they need to be constantly polled.
- HueIndoorSensor: These are the two white square Things on the table. They measure light intensity and notify if there is movement in the room.
![Hue Indoor Sensor](Images/Desk1/HueIndoor.jpg "Hue Indoor Sensor")
- HueOutdoorSensor: This sensor is not visible in any camera stream but it is positioned to the left of the Desk 1. Its functionality is identical to the IndoorSensor.

**Note:** The lights are bridged over the Hue Bridge and we do not change their APIs in any way. The responses returned from the devices (which is the Hue Bridge) have always 2XX code, even if the light is not even screwed in.
You have to parse the responses if you want to handle such status responses.
In other words, do not put any meaning into the status codes.

### Desk2

- uArm Robot: This is the black robot seen on the top part of the second stream. It can be moved to any position and pick up objects. If you move the robot when it cannot move (when there is something on the way), the software library that we are using loses the position and thinks that it has moved to where you wanted it to. Thus, in such cases, use the reset action. Otherwise, the robot restarts every hour and fixes this problem.
![uArm](Images/Desk2/uArm.jpg "uArm")
- Dobot Magician Robot: This is the white robot seen on the bottom part of the second stream. It is mounted on a sliding rail and can be moved to preprogrammed locations and pick up objects if the objects are on those positions. The `getCube` and `returnCube` actions can be invoked 3 times in a row in total. Each invocation is put in a queue and processed by the robot sequentially. Invoking one of them too much results in an HTTP 429 error.
![Dobot](Images/Desk2/Dobot.jpg "Dobot")
- Infrared Sensor: These sensor detect if a cube passes in front of them and send an event.
![Infrared](Images/Desk2/Infrared.jpg "Infrared Sensor")
- Conveyor Belt: These belts can be run forward or backwards with a speed set in their properties. They should be stopped when not in use to avoid damaging the hardware.
![Conveyor Belt](Images/Desk2/ConveyorBelt.jpg "Conveyor Belt")

## Simulations

We have multiple virtual Coffee machines simulated on HTTP and CoAP.
CoAP and HTTP instances are all accessible over the IP address 129.187.45.174 but with different port numbers of course.

Expected Behavior: The property values are generated at each request and are random.
Similarly, if there is an action that will send output, it is automatically generated.
Events are emitted at pre-configured intervals of around 8 and 10 seconds.
This can be changed if requested.

For each protocol, there are 16 instances but this can be increased to 1000+ if needed.
Also, if you have a device whose TD is available and you want a simulation, simply send the TD and the event emission intervals.

### HTTP

The list of TDs can be found at <http://129.187.45.174:8080>
One example would be <http://129.187.45.174:8080/Virtual-Coffee-Machine_1_1> until 1_16

### CoAP

The list of TDs can be found at coap://129.187.45.174:5683
One example would be coap://129.187.45.174:5683/Virtual-Coffee-Machine_2_1 until 2_16

### Implementation details

They are made possible via [shadow-thing](https://github.com/tum-esi/shadow-thing)
[Images/Desk1/Desk1.jpg]: <https://dl.acm.org/doi/abs/10.1145/1985394.1985398>
214 changes: 214 additions & 0 deletions events/2022.07.Online/TD/node-wot/TDs/counter.td.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"title": "Counter",
"titles": {
"en": "Counter",
"de": "Zähler",
"it": "Contatore"
},
"securityDefinitions": {
"no_sec": {
"scheme": "nosec"
}
},
"security": "no_sec",
"description": "counter example Thing",
"descriptions": {
"en": "Counter example Thing",
"de": "Zähler Beispiel Ding",
"it": "Contatore Esempio"
},
"support": "git://github.com/eclipse/thingweb.node-wot.git",
"@context": [
"https://www.w3.org/2019/wot/td/v1",
"https://www.w3.org/2022/wot/td/v1.1",
{
"iot": "http://example.org/iot"
}
],
"uriVariables": {
"step": {
"type": "integer",
"minimum": 1,
"maximum": 250
}
},
"properties": {
"count": {
"title": "Count",
"titles": {
"en": "Count",
"de": "Zählen",
"it": "Conteggio"
},
"type": "integer",
"description": "current counter value",
"descriptions": {
"en": "Current counter value",
"de": "Derzeitiger Zähler Stand",
"it": "Valore attuale del contatore"
},
"iot:Custom": "example annotation",
"observable": true,
"readOnly": true,
"forms": [
{
"op": [
"writeproperty",
"readproperty",
"observeproperty",
"unobserveproperty"
],
"href": "https://example.com/counter/count"
}
]
},
"countAsImage": {
"description": "current counter value as SVG image",
"forms": [
{
"href": "https://example.com/counter/count/display",
"contentType": "image/svg+xml"
}
],
"observable": false,
"readOnly": true,
"uriVariables": {
"fill": {
"type": "string"
}
}
},
"redDotImage": {
"description": "Red dot image as PNG",
"forms": [
{
"href": "https://example.com/counter/count/display/redDotImage",
"contentType": "image/png"
}
],
"observable": false,
"readOnly": true
},
"lastChange": {
"title": "Last change",
"titles": {
"en": "Last change",
"de": "Letzte Änderung",
"it": "Ultima modifica"
},
"type": "string",
"description": "last change of counter value",
"descriptions": {
"en": "Last change of counter value",
"de": "Letzte Änderung",
"it": "Ultima modifica del valore"
},
"observable": true,
"readOnly": true,
"forms": [
{
"op": [
"writeproperty",
"readproperty",
"observeproperty",
"unobserveproperty"
],
"href": "https://example.com/counter/lastChange"
}
]
}
},
"actions": {
"increment": {
"title": "Increment",
"titles": {
"en": "Increment",
"de": "Zunahme",
"it": "Incrementa"
},
"description": "Incrementing counter value",
"descriptions": {
"en": "Incrementing counter value",
"de": "Zähler erhöhen",
"it": "incrementare valore"
},
"forms": [
{
"op": [
"invokeaction"
],
"href": "https://example.com/counter/increment"
}
]
},
"decrement": {
"title": "Decrement",
"titles": {
"en": "Decrement",
"de": "Verringerung",
"it": "Decrementa"
},
"description": "Decrementing counter value",
"descriptions": {
"en": "Decrementing counter value",
"de": "Zähler verringern",
"it": "decrementare valore"
},
"forms": [
{
"op": [
"invokeaction"
],
"href": "https://example.com/counter/decrement"
}
]
},
"reset": {
"title": "Reset",
"titles": {
"en": "Reset",
"de": "Zurücksetzen",
"it": "Ripristina"
},
"description": "Resetting counter value",
"descriptions": {
"en": "Resetting counter value",
"de": "Zähler resettieren",
"it": "resettare valore"
},
"forms": [
{
"op": [
"invokeaction"
],
"href": "https://example.com/counter/reset"
}
]
}
},
"events": {
"change": {
"title": "Change",
"titles": {
"en": "Change",
"de": "Geändert",
"it": "Valore modificato"
},
"description": "change event",
"descriptions": {
"en": "change event",
"de": "Änderungsnachricht",
"it": "resettare valore"
},
"forms": [
{
"op": [
"subscribeevent",
"unsubscribeevent"
],
"href": "https://example.com/counter/change"
}
]
}
}
}
11 changes: 11 additions & 0 deletions events/2022.07.Online/TD/node-wot/TDs/echonet-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TDs provided by ECHONET Consortium
In this PlugFest, only read and write operations on one property and readallproperties operation are supported (i.e. read operation on multiple properties and write operation on all or multiple properties are not supported).

Action invokation is not supported.

The following list shows which TD represents what device.

* generallighting.td.jsonld : a light
* homeairconditioner.td.jsonld : an air conditioner
* illuminancesensor.td.jsonld : an illuminance sensor
* temperaturesensor.td.jsonld : a temperature sensor