This platform enables means for (i) automated binding of IoT devices in order to access their sensors and actuators, and (ii) automated software provisioning.
see User Manual
A REST API for the management of devices, sensors and actuators is provided.
POST /api/devices/ HTTP/1.1
Content-Type: application/json
accept: application/json
{
"name": "Raspberry Pi",
"macAddress": "123456789067",
"ipAddress": "192.168.0.34",
"formattedMacAddress": "12-34-56-78-90-67"
}
HTTP/1.1 201 Created
location: http://localhost:8080/MBP/api/devices/5a033094c27074e37bbb198b
content-type:
application/json;charset=UTF-8
{
"id": "5a033094c27074e37bbb198b",
"name": "Raspberry Pi",
"macAddress": "123456789067",
"ipAddress": "192.168.0.34",
"date": null,
...
}
The id of the newly created device can be parsed from the response header location or from the response body, which is in json format.
GET /api/devices/ HTTP/1.1
HTTP/1.1 200 OK
[
{
"macAddress": "123456789067",
"ipAddress": "192.168.0.34",
"name": "Raspberry Pi",
"id": "596c7a7d4f0c58688e5aa6b1",
"date": null,
}, ...
]
GET /api/devices/596c7a7d4f0c58688e5aa6b1 HTTP/1.1
HTTP/1.1 200 OK
{
"macAddress": "123456789067",
"ipAddress": "192.168.0.34",
"name": "Raspberry Pi",
"id": "596c7a7d4f0c58688e5aa6b1",
"date": null,
}
PUT /api/devices/596c7a7d4f0c58688e5aa6b1 HTTP/1.1
{
"name": "Raspberry Pi",
"macAddress": "127556789067",
"ipAddress": "192.168.0.75",
"formattedMacAddress": "12-75-56-78-90-67"
}
HTTP/1.1 204 No Content
DELETE /api/devices/596c7a7d4f0c58688e5aa6b1 HTTP/1.1
HTTP/1.1 204 No Content
An adapter is the required software (e.g., python script) to bind sensors and actuators to the MBP.
POST /api/types/ HTTP/1.1
Content-Type: application/json
accept: application/json
{
"name": "TemperatureSensorAdapter",
"description": "An adapter for the LK temperature sensor",
"service": {
"name": "service-stub.conf",
"content": "stub conf"
},
"routines": [{
"name": "service-stub.py",
"content": "service code"
}]
}
HTTP/1.1 201 Created
location: http://localhost:8080/MBP/api/types/5a0336ba972ca8734022d67c
content-type: application/json;charset=UTF-8
{
"id": "5a0336ba972ca8734022d67c",
"name": "TemperatureSensorAdapter",
"description": "An adapter for the LK temperature sensor",
...
}
The id of the newly created adapter type can be parsed from the response header location or from the response body, which is in json format.
GET /api/types/ HTTP/1.1
HTTP/1.1 200 OK
[
{
"name": "TemperatureSensorAdapter",
"id": "596c7c344f0c58688e5aa6b3",
"description": "An adapter for the LK temperature sensor"
}, ...
]
GET /api/types/596c7c344f0c58688e5aa6b3 HTTP/1.1
HTTP/1.1 200 OK
{
"name": "TemperatureSensorAdapter",
"id": "596c7c344f0c58688e5aa6b3",
"description": "An adapter for the LK temperature sensor"
}
PUT /api/types/596c7c344f0c58688e5aa6b3 HTTP/1.1
{
"name": "TemperatureSensorAdapter",
"description": "An adapter for the LK temperature sensor",
"service": {
"name": "service-stub.conf",
"content": "..."
},
"routines": [{
"name": "service-stub.py",
"content": "..."
}]
}
HTTP/1.1 204 No Content
DELETE /api/types/596c7c344f0c58688e5aa6b3 HTTP/1.1
HTTP/1.1 204 No Content
To register a sensor, it is necessary to register first:
(i) the device to which the sensor is connected to, and
(ii) the adapter type, i.e., the required software (e.g., python script) to bind the sensor to the MBP.
The following example uses the previously registered adapter type (id = 596c7c344f0c58688e5aa6b3) and device (id = 596c7a7d4f0c58688e5aa6b1):
POST /api/sensors/ HTTP/1.1
Content-Type: application/json
accept: application/json
{
"name": "Temperature Sensor",
"type": "<URL>/api/types/596c7c344f0c58688e5aa6b3",
"device": "<URL>/api/devices/596c7a7d4f0c58688e5aa6b1",
}
HTTP/1.1 201 Created
location: http://localhost:8080/MBP/api/sensors/596c7a974f0c58688e5aa6b2
content-type: application/json;charset=UTF-8
{
"id": "596c7a974f0c58688e5aa6b2",
"name": "test_sensor",
...
}
The id of the newly created sensor can be parsed from the response header location or from the response body, which is in json format.
GET /api/sensors/ HTTP/1.1
HTTP/1.1 200 OK
[
{
"id": "596c7a974f0c58688e5aa6b2",
"name": "test_sensor",
"_embedded": {
"device": {
"macAddress": "111111111111",
"ipAddress": null,
"name": "Test_Device",
"id": "596c7a7d4f0c58688e5aa6b1",
"date": null
}
}
}, ...
]
GET /api/sensors/596c7a974f0c58688e5aa6b2 HTTP/1.1
HTTP/1.1 200 OK
{
"id": "596c7a974f0c58688e5aa6b2",
"name": "test_sensor",
"_embedded": {
"device": {
"macAddress": "111111111111",
"ipAddress": null,
"name": "Test_Device",
"id": "596c7a7d4f0c58688e5aa6b1",
"date": null
}
}
}
PUT /api/sensors/596c7a974f0c58688e5aa6b2 HTTP/1.1
{
"name": "Temperature Sensor",
"type": "<URL>/api/types/596c7c344f0c58688e5aa6b3",
"device": "<URL>/api/devices/596c7a7d4f0c58688e5aa6b1",
}
HTTP/1.1 204 No Content
DELETE /api/sensors/596c7a974f0c58688e5aa6b2 HTTP/1.1
HTTP/1.1 204 No Content
see REST calls for sensors, replace /sensors with /actuators
-
Java Projects (contains both web and the old base project that implemented the services)
-
Python Scripts (contains all python services and sensor scripts)
-
RSA Key (key that should be installed in each RPi in order to use SSH access)
-
Diagram (domain diagram for the java project)
Run sudo apt-get install upstart
, reboot after installation.
This is used to set up services on the system.
To set a service (%name% stands for any name):
- create a
%name%.conf
file in/etc/init
- run
sudo initctl reload-configuration
- run
sudo service %name% start
WinPCap on server machine (Windows only - not needed on Linux dists)
Compliments Scapy library.