W2MExampleWiki
The Advantech IoT Sensor Data Format
draft-adv-iot-sensor-format-06
Abstract
Terminology
This specification makes use of the following additional terminology:
IoT Gateway (IoTGW): It integrates technologies and protocols for networking, embedded control, enterprise-grade security, and easy manageability on which application-specific software can run. Connectivity up to the WISE Cloud and down to sensors and existing controllers embedded in the system. Pre-process filtering and gathering of selected data for delivery.
Sensor Node (SenNode): A sensor node is capable of performing some processing, gathering sensory information and communicating with other connected nodes in the network. A sensor node should be small in size, consume extremely low energy, operate in high volumetric densities, be autonomous and operate unattended, and be adaptive to the environment. As sensor nodes are typically very small electronic devices, they can only be equipped with a limited power source.
Sensor (Sen): Sensor is hardware device that produce a measurable response to a change in a physical condition like temperature or pressure. Sensor measures physical data of the parameter to be monitored.
Resource Type(rt): Each root resource of a function set is assigned a Resource Type parameter, therefore making it possible to discover it. The Resource Type parameter defines the value that MUST be included in the rt= field of the sensor.
Interface Description(if): The Interface Description parameter defines the REST interface for that type of resources.
Interface | if= | Methods |
Link List | core.ll | GET |
Batch | core.b | GET, PUT, POST (where applicable) |
Linked Batch | core.lb | GET, PUT, POST, DELETE (where applicable) |
Sensor | core.s | GET |
Parameter | core.p | GET, PUT |
Read-only Parameter | core.rp | GET |
Template:Anchor Template:Anchor Actuator | core.a | GET, PUT, POST |
Template:Anchor Template:Anchor Binding | core.bnd | GET, POST, DELETE |
Link List: The Link List interface is used to retrieve (GET) a list of resources on a web server.
Batch: The Batch interface is used to manipulate a collection of sub-resources at the same time.
Linked Batch: Contrary to the basic Batch which is a collection statically defined by the web server, a Linked Batch is dynamically controlled by a web client.
Sensor: The Sensor interface allows the value of a sensor resource to be read (GET).
Parameter: The Parameter interface allows configurable parameters and other information to be modeled as a resource.
Read-only Parameter: The Read-only Parameter interface allows configuration parameters to be read (GET) but not set.
Actuator: Examples of actuators include for example LEDs, relays, motor controllers and light dimmers. The current value of the actuator can be read (GET) or a new actuator value set (PUT).
Binding:The Binding interface is used to manipulate a binding table.
Path Template (Path) : The path template includes a possible index {#} parameter, and possible fixed path segments. The index {#} allows for multiple instances of this type of resource, and can be any string.
IPSO Application Framework
HTTP, REST, XML, JSON, COAP and other key components of web technology are powerful mechanisms in an Internet of Things application.
Function Sets : The framework is organized into groups of resource types called Function Sets. A Function Set has a recommended root path, under which its sub-resources are organized. Each Function Set is assigned a Resource Type parameter, therefore making it possible to discover it.
Function Set | Root Path | Resource Type |
General Purpose IO | /gpio | ipso.gpio |
Power | /pwr | ipso.pwr |
Load Control | /load | ipso.load |
Sensors | /sen | ipso.sen |
Light Control | /lt | ipso.lt |
Message | /msg | ipso.msg |
Location | /loc | ipso.loc |
Configuration | /cfg | ipso.cfg |
Media Types for Sensor Markup Language (SENML)
Semantics
SenML | JSON | Type | Description |
Base Name | bn | String | This is a string that is prepended to the names found in the entries |
Base Time | bt | Number | A base time that is added to the time found in an entry |
Base Units | bu | Number | A base unit that is assumed for all entries, unless otherwise indicated |
Version | ver | Number | Version number of media type format |
Measurement or Parameters | e | Array | Array of values for sensor measurements or other generic parameters |
Name | n | String | Name of the sensor or parameter |
Units | U | String | Units for a measurement value |
Value | v | Number | Value of the entry |
String Value | sv | String | |
Boolean Value | bv | Boolean | |
Value Sum | s | Floating point | Integrated sum of the values over time |
Time | t | Number | Time when value was recorded |
Update Time | ut | Number | Update time. A time in seconds that represents the maximum time before this sensor will provide an updated reading for a measurement. |
The Data Type of Sensor Data Format
Data Type (type) | SenML Field |
b (boolean) | bv |
s (string) | s |
e (enum) | e |
i (integer) | v |
d (decimal) | v |
h(hexadecimal) | s |
o(octet-stream) | s |
Example:
{“n”:
The Unified Code for Units of Measure (UCUM)
http://unitsofmeasure.org/ucum.html
Symbol | Description |
m | meter |
kg | kilogram |
s | second |
A | ampere |
K | kelvin |
cd | candela |
mol | mole |
Hz | hertz |
rad | radian |
sr | steradian |
N | newton |
Pa | pascal |
J | joule |
W | watt |
C | coulomb |
V | volt |
F | farad |
Ohm | ohm |
S | siemens |
Wb | weber |
T | tesla |
H | henry |
Cel | degrees Celsius |
lm | lumen |
lx | lux |
Bq | becquerel |
Gy | gray |
Sv | sievert |
kat | katal |
pH | pH acidity |
% | Value of a switch. A value of 0.0 indicates the switch is off while 100.0 indicates on. |
count | counter value |
%RH | Relative Humidity |
m2 | area |
l | volume in liters |
m/s | velocity |
m/s2 | acceleration |
l/s | flow rate in liters per second |
W/m2 | irradiance |
cd/m2 | luminance |
Bspl | bel sound pressure level |
bit/s | bits per second |
lat | degrees latitude. Assumed to be in WGS84 unless another reference frame is known for the sensor. |
lon | degrees longitude. Assumed to be in WGS84 unless another reference frame is known for the sensor. |
%EL | remaining battery energy level in percents |
EL | remaining battery energy level in seconds |
beet/m | Heart rate in beets per minute |
beets | Cumulative number of heart beats |
h | Hour. |
IoTS
SUSI Thermal Protect API (3):
[SUSI API]* uint32_t SUSI_API SusiThermalProtectionGetCaps(uint32_t Id, uint32_t ItemId, uint32_t *pValue)
- uint32_t SUSI_API SusiThermalProtectionSetConfig(uint32_t Id, SusiThermalProtect *pConfig)
- uint32_t SUSI_API SusiThermalProtectionGetConfig(uint32_t Id, SusiThermalProtect *pConfig)
[Path Definition]
Id:
Id | Description |
SUSI_ID_THERMAL_PROTECT_1 | Thermal protection zone 1 |
SUSI_ID_THERMAL_PROTECT_2 | Thermal protection zone 2 |
SUSI_ID_THERMAL_PROTECT_3 | Thermal protection zone 3 |
SUSI_ID_THERMAL_PROTECT_4 | Thermal protection zone 4 |
Description | {#} |
Thermal protection zone 1 | Zone1 |
Thermal protection zone 2 | Zone2 |
Thermal protection zone 3 | Zone3 |
Thermal protection zone 4 | Zone4 |
ItemId:
Item Id | Description |
SUSI_ID_TP_EVENT_SUPPORT_FLAGS | Event support flags |
SUSI_ID_TP_EVENT_TRIGGER_MAXIMUM | The maximum temperature to trigger event |
SUSI_ID_TP_EVENT_TRIGGER_MINIMUM | The minimum temperature to trigger event |
SUSI_ID_TP_EVENT_CLEAR_MAXIMUM | The maximum temperature to clear event |
SUSI_ID_TP_EVENT_CLEAR_MINIMUM | The minimum temperature to clear event |
Description | {#} |
Support shutdown event | shutdownon |
Support throttle event | throttleon |
Support power off event | poweroffon |
The maximum temperature to trigger event | maxtt |
The minimum temperature to trigger event | mintt |
The maximum temperature to clear event | maxtc |
The minimum temperature to clear event | mintc |
pConfig:
typedef struct _SusiThermalProtect{
uint32_t SourceId;
uint32_t EventType;
uint32_t SendEventTemperature;
uint32_t ClearEventTemperature;
} SusiThermalProtect, *PSusiThermalProtect;
Description | {#} |
SourceId | srcid |
EventType | et |
SendEventTemperature | set |
ClearEventTemperature | cet |
{#}/{#}: Id/ItemId
{#}/{#}: Id/Config
[Restful Api]
Endpoint : http://IP/MAC Address | ||||
Path (RD) | RT | IF | Type | Unit |
/tp/caps/{#}/{#} | tp.caps | rp | i | |
/tp/caps/zone1/shutdownon | tp.caps.zone1.shutdownon | rp | i | |
/tp/cfg/{#}/{#} | tp.cfg | a | i | |
/tp/cfg/zone1/srcid | tp.cfg.zone1.srcid | a | i |
RD:
POST https://susiissad.management.intelligentsystems.azure.net
/core
/Devices('AIMB-214')
/Microsoft.IntelligentSystems.Services.InvokeAction
?api-version=2014-06-30 HTTP/1.1
Host: | susiissad.management.intelligentsystems.azure.net |
x-ms-iot-account: | susiissad |
Authorization: | ApiKey nAdAqlaBM1dj61peni03ZEFj+r88uCAEA6cM2L+/fsE= |
Accept: | application/json;core=verbose |
Content-Type: | application/json |
JSON:
{
"Path":"Advantech.EssSusi.DeviceModel.V4/Device('AIMB-214')",
"Action":"Advantech.EssSusi.DeviceModel.V4.SetFanSpeed",
"Parameters":"{
\"fanSpeed\":
{
CpuFanSpeed:2000,
SysFanSpeed:3000
}
}"
}
{
"Platform Information": {
"e": [
{
"n": "Boot up times",
"v": 687,
"Id": -1879048191
},
{
"n": "Running time (hours)",
"v": 621,
"Id": -1879048190
},
{
"n": "Board name",
"sv": "DS-570",
"Id": -1879044095
},
{
"n": "BIOS revision",
"sv": "V1.10",
"Id": -1879044092
},
{
"n": "Driver version",
"sv": "4.0.12777",
"Id": -1878982656
},
{
"n": "Library version",
"sv": "4.0.12777",
"Id": -1878982655
},
{
"n": "Firmware version",
"sv": "19.14.512",
"Id": -1878982654
}
],
"bn": "Platform Information",
"Id": -1879048192,
"bt": 1276020076,
"bu": "Info",
"ver": 1
},
"Hardware Monitor": {
"Fan Speed": {},
"Id": 100000,
"Case Open": {},
"Temperature": {
"e": [
{
"n": "CPU",
"v": 46.0,
"min": 0.0,
"max": 100.0,
"Id": 131072
},
{
"n": "Chipset",
"v": 41.0,
"min": 0.0,
"max": 100.0,
"Id": 131073
},
{
"n": "System",
"v": 42.0,
"min": 0.0,
"max": 100.0,
"Id": 131074
}
],
"bn": "Temperature",
"Id": 131327,
"bt": 1276020076,
"bu": "Cel",
"ver": 1
},
"Voltage": {
"e": [
{
"n": "3.3V",
"v": 3.284,
"min": 0.0,
"max": 15.0,
"Id": 135171
},
{
"n": "5V",
"v": 5.02,
"min": 0.0,
"max": 15.0,
"Id": 135172
},
{
"n": "12V",
"v": 12.052,
"min": 0.0,
"max": 15.0,
"Id": 135173
},
{
"n": "5V Standby",
"v": 5.014,
"min": 0.0,
"max": 15.0,
"Id": 135174
},
{
"n": "CMOS Battery",
"v": 2.92,
"min": 0.0,
"max": 15.0,
"Id": 135176
}
],
"bn": "Voltage",
"Id": 135423,
"bt": 1276020076,
"bu": "V",
"ver": 1
},
"Current": {}
}
}
{
"Platform Information": {
"e": [
{
"n": "Boot up times",
"v": 687,
"Id": -1879048191
},
{}
],
"bn": "Platform Information",
"Id": -1879048192,
"bt": 1276020076,
"bu": "Info",
"ver": 1
},
"Hardware Monitor": {
"e": [
{
"Fan Speed": {
"e": [
{
"n": "CPU",
"v": 1000
},
{}
],
"bn": "Fan Speed",
"Id": 131327,
"bt": 1276020076,
"bu": "RPM",
"ver": 1
},
"Temperature": {
"e": [
{
"n": "CPU",
"v": 46,
"min": 0,
"max": 100,
"Id": 131072
},
{}
],
"bn": "Temperature",
"Id": 131327,
"bt": 1276020076,
"bu": "Cel",
"ver": 1
},
"Voltage": {
"e": [
{
"n": "3.3V",
"v": 3.284,
"min": 0,
"max": 15,
"Id": 135171
},
{}
],
"bn": "Voltage",
"Id": 135423,
"bt": 1276020076,
"bu": "V",
"ver": 1
},
"Current": {},
"Case Open": {}
},
{}
],
"bn": "Hardware Monitor",
"Id": 100000,
"bt": 1276020076,
"bu": "HWM",
"ver": 1
}
}