|
1 | | -# FIWARE NGSI-LD Step-by-Step Tutorials Context Provider |
| 1 | +# FIWARE NGSI-LD Step-by-Step Tutorials Dummy Devices |
2 | 2 |
|
3 | | -[](https://fiware-tutorials.rtfd.io) |
4 | | -[](https://hub.docker.com/r/fiware/tutorials.ngsi-ld/) |
5 | | -[](https://stackoverflow.com/questions/tagged/fiware) |
6 | 3 | [](https://cim.etsi.org/NGSI-LD/official/front-page.html) |
7 | 4 | [](https://w3c.github.io/json-ld-syntax/) |
8 | 5 |
|
9 | | -Simple nodejs express application for use with the FIWARE Step-by-Step tutorials. Each tutorial consists of a series of |
10 | | -exercises to demonstrate the correct use of individual FIWARE components and shows the flow of context data within a |
11 | | -simple Smart Solution either by connecting to a series of dummy IoT devices or manipulating the context directly or |
12 | | -programmatically. |
| 6 | +Simple nodejs express application for use with the FIWARE Step-by-Step tutorials. |
13 | 7 |
|
14 | | -This application provides various sources of context and demonstrates various aspects of FIWARE To run the application |
15 | | -in debug mode add `DEBUG=tutorial:*` |
| 8 | +This application provides sends information about devices on the farm. |
16 | 9 |
|
17 | | -## Store Application |
| 10 | +### Actuators |
18 | 11 |
|
19 | | -- `WEB_APP_PORT=3000` # Port used by the content provider proxy and web-app for viewing |
20 | | -- `CONTEXT_BROKER=http://orion:1026/v2` - URL of the context broker to update context |
21 | | -- `NGSI_LD_PREFIX=` - Whether to use full URNs for devices |
22 | | -- `SECURE_ENDPOINTS=true` - Enable Keyrock as PDP - default is `false` |
| 12 | +- POST `/iot/water:id` - Actuate the water sprinkler on/off |
| 13 | +- POST `/iot/tractor:id` - Actuate the tractor start/stop |
| 14 | +- POST `/iot/filling:id` - Actuate the filling level add/remove/fill |
23 | 15 |
|
24 | | -## Dummy Ultralight Devices |
| 16 | +### Fire devices |
25 | 17 |
|
26 | | -- `IOTA_HTTP_HOST=iot-agent` - The URL of the IoT Agent |
27 | | -- `IOTA_HTTP_PORT=7896` - Port used by the dummy IoT devices to commuicate with the IoT Agent |
28 | | -- `DUMMY_DEVICES_PORT=3001` - Port used by the dummy IoT devices to receive commands |
29 | | -- `DUMMY_DEVICES_TRANSPORT=HTTP` - Default transport used by dummy IoT devices (either `HTTP` or `MQTT`) |
30 | | -- `DUMMY_DEVICES_API_KEY=4jggokgpepnvsb2uv4s40d59ov` - Device API Key. |
| 18 | +- GET `/status` - send the status of the weather and the barn door |
| 19 | +- GET `/devices/:type` - send the status of devices of a given type |
| 20 | +- GET `/animals` - send the status of the animal collars |
31 | 21 |
|
32 | | -## Identity Management - Keyrock |
| 22 | +### Set device states |
33 | 23 |
|
34 | | -- `KEYROCK_URL=http://localhost` - URL for Keyrock IDM |
35 | | -- `KEYROCK_IP_ADDRESS=http://172.18.1.5` - IP address for Keyrock IDM |
36 | | -- `KEYROCK_PORT=3005` - Port that Keyrock is listening on |
37 | | -- `KEYROCK_CLIENT_ID=tutorial-dckr-site-0000-xpresswebapp` - Client ID for the appliction within keyrock |
38 | | -- `KEYROCK_CLIENT_SECRET=tutorial-dckr-site-0000-clientsecret` - Client secret for the appliction within keyrock |
| 24 | +- PUT `/devices/tractor` - - update the status of tractors |
| 25 | +- PUT `/devices` - initialise the cache of all devices |
| 26 | +- PUT `/barndoor` - toggle the barn door open/shut |
| 27 | +- PUT `/weather` - amend the weather - sunny/cloudy/raining |
| 28 | +- PUT `/temperature/:id` - amend the target temperature of a device |
39 | 29 |
|
40 | | -## Access Control - Authzforce |
41 | | - |
42 | | -- `AUTHZFORCE_URL=http://authzforce` - URL for Authzforce |
43 | | -- `AUTHZFORCE_PORT=8080` - Port that Authzforce is listening on |
44 | | - |
45 | | -## How to build your own image |
46 | | - |
47 | | -The [Dockerfile](https://github.com/fiware/tutorials.NGSI-LD/blob/master/docker/Dockerfile) associated with this image |
48 | | -can be used to build an image in several ways: |
49 | | - |
50 | | -- By default, the `Dockerfile` retrieves the **latest** version of the codebase direct from GitHub (the `build-arg` is |
51 | | - optional): |
52 | | - |
53 | | -```console |
54 | | -docker build -t fiware/tutorials.NGSI-LD . --build-arg DOWNLOAD=latest |
55 | | -``` |
56 | | - |
57 | | -- You can alter this to obtain the last **stable** release run this `Dockerfile` with the build argument |
58 | | - `DOWNLOAD=stable` |
59 | | - |
60 | | -```console |
61 | | -docker build -t fiware/tutorials.NGSI-LD . --build-arg DOWNLOAD=stable |
62 | | -``` |
63 | | - |
64 | | -- You can also download a specific release by running this `Dockerfile` with the build argument `DOWNLOAD=<version>` |
65 | | - |
66 | | -```console |
67 | | -docker build -t fiware/tutorials.NGSI-LD . --build-arg DOWNLOAD=1.7.0 |
68 | | -``` |
69 | | - |
70 | | -- To download code from your own fork of the GitHub repository add the `GITHUB_ACCOUNT` and `GITHUB_REPOSITORY` |
71 | | - arguments to the `docker build` command. |
72 | | - |
73 | | -```console |
74 | | -docker build -t fiware/tutorials.NGSI-LD . --build-arg GITHUB_ACCOUNT=<your account> --build-arg GITHUB_REPOSITORY=<your repo> |
75 | | -``` |
76 | | - |
77 | | -Alternatively, if you want to build directly from your own sources, please copy the existing `Dockerfile` into file the |
78 | | -root of the repository and amend it to copy over your local source using : |
79 | | - |
80 | | -```Dockerfile |
81 | | -COPY app /usr/src/app |
82 | | -``` |
83 | | - |
84 | | -Full instructions can be found within the `Dockerfile` itself. |
| 30 | +To run the application in debug mode add `DEBUG=devices:*` |
0 commit comments