9
9
[ ![ Coverage Status] ( https://coveralls.io/repos/github/telefonicaid/iotagent-node-lib/badge.svg?branch=master )] ( https://coveralls.io/github/telefonicaid/iotagent-node-lib?branch=master )
10
10
![ Status] ( https://nexus.lab.fiware.org/static/badges/statuses/iot-node-lib.svg )
11
11
12
- This project aims to provide a Node.js module to enable IoT Agent developers to
13
- build custom agents for their devices that can easily connect to NGSI Context
14
- Brokers (such as [ Orion] ( https://github.com/telefonicaid/fiware-orion ) ).
15
-
16
- An IoT Agent is a component that lets groups of devices send their data to and
17
- be managed from a FIWARE NGSI Context Broker using their own native protocols.
18
- IoT Agents should also be able to deal with security aspects of the FIWARE
19
- platform (authentication and authorization of the channel) and provide other
20
- common services to the device programmer.
21
-
22
- This project is part of [ FIWARE] ( https://www.fiware.org/ ) . For more information
23
- check the FIWARE Catalogue entry for the
12
+ This project aims to provide a Node.js module to enable IoT Agent developers to build custom agents for their devices
13
+ that can easily connect to NGSI Context Brokers (such as [ Orion] ( https://github.com/telefonicaid/fiware-orion ) ).
14
+
15
+ An IoT Agent is a component that lets groups of devices send their data to and be managed from a FIWARE NGSI Context
16
+ Broker using their own native protocols. IoT Agents should also be able to deal with security aspects of the FIWARE
17
+ platform (authentication and authorization of the channel) and provide other common services to the device programmer.
18
+
19
+ This project is part of [ FIWARE] ( https://www.fiware.org/ ) . For more information check the FIWARE Catalogue entry for the
24
20
[ IoT Agents] ( https://github.com/Fiware/catalogue/tree/master/iot-agents ) .
25
21
26
22
| :books : [ Documentation] ( https://iotagent-node-lib.rtfd.io ) | :mortar_board : [ Academy] ( https://fiware-academy.readthedocs.io/en/latest/iot-agents/idas ) | :dart : [ Roadmap] ( https://github.com/telefonicaid/iotagent-node-lib/blob/master/docs/roadmap.md ) |
27
- | ---| ---| ---|
23
+ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
24
+
28
25
29
26
## Index
30
27
@@ -59,7 +56,6 @@ functionality provided by the IoT Agent node lin (e.g. for contecting to a conex
59
56
its device communications using a common vocabulary regardless of the payload, syntax or transport protocol used by the
60
57
device itself.
61
58
62
-
63
59
## Install
64
60
65
61
The ** IoT Agent node library** is not a standalone product and should be added as a dependency to ` package.json ` of the
@@ -78,43 +74,39 @@ In order to use the library within your own IoT Agent, you must first you requir
78
74
const iotagentLib = require (" iotagent-node-lib" );
79
75
```
80
76
81
- Information about how to configure the Library can be found at the corresponding
82
- section of the
77
+ Information about how to configure the Library can be found at the corresponding section of the
83
78
[ Installation & Administration Guide] ( doc/installationguide.md ) .
84
79
85
80
## Usage
86
81
87
- This library has no packaging or build processes. The [ Getting Started] ( doc/getting-started.md ) is a good place to start.
88
- Usage of the library is explained in the [ User & Programmers Manual] ( doc/usermanual.md ) .
82
+ This library has no packaging or build processes. The [ Getting Started] ( doc/getting-started.md ) is a good place to
83
+ start. Usage of the library is explained in the [ User & Programmers Manual] ( doc/usermanual.md ) .
89
84
90
- - Details of the architecture of an IoT Agent be found [ here] ( doc/architecture.md ) .
91
- - Further Advanced topics can be found [ here] ( doc/advanced-topics.md ) .
92
- - The following features are listed as [ deprecated] ( doc/deprecated.md ) .
85
+ - Details of the architecture of an IoT Agent be found [ here] ( doc/architecture.md ) .
86
+ - Further Advanced topics can be found [ here] ( doc/advanced-topics.md ) .
87
+ - The following features are listed as [ deprecated] ( doc/deprecated.md ) .
93
88
94
89
## API
95
90
96
91
The ** IoT Agent node library** offers a simple REST API which provides common functionality to access, provision and
97
- decommission devices.
98
- [ API] ( doc/api.md ) .
92
+ decommission devices. [ API] ( doc/api.md ) .
99
93
100
94
## Testing
101
95
102
-
103
96
Contributions to development can be found [ here] ( doc/development.md ) - additional contributions are welcome.
104
97
105
98
### Agent Console
106
99
107
- A command-line client to experiment with the library is packed with it. The
108
- command-line client can be started using the following command:
100
+ A command-line client to experiment with the library is packed with it. The command-line client can be started using the
101
+ following command:
109
102
110
103
``` console
111
104
bin/agentConsole.js
112
105
```
113
106
114
- The client offers an API similar to the one offered by the library: it can start
115
- and stop an IoT agent, register and unregister devices, send measures mimicking
116
- the device and receive updates of the device data. Take into account that, by
117
- default, the console uses the same ` config.js ` file than the IoT Agent.
107
+ The client offers an API similar to the one offered by the library: it can start and stop an IoT agent, register and
108
+ unregister devices, send measures mimicking the device and receive updates of the device data. Take into account that,
109
+ by default, the console uses the same ` config.js ` file than the IoT Agent.
118
110
119
111
The command-line client creates a console that offers the following options:
120
112
@@ -172,24 +164,20 @@ listdevices
172
164
173
165
#### Command-line testing
174
166
175
- The library also offers a Context Broker and IoT Agent client that can be used
176
- to:
167
+ The library also offers a Context Broker and IoT Agent client that can be used to:
177
168
178
- - Simulate operations to the Context Broker used by the IoT Agent, triggering
179
- Context Provider forwardings for lazy attributes and checking the
180
- appropriate values for active ones.
181
- - Simulate operations to the Device Provisioning API and Configuration API of
182
- the IoT Agent.
169
+ - Simulate operations to the Context Broker used by the IoT Agent, triggering Context Provider forwardings for lazy
170
+ attributes and checking the appropriate values for active ones.
171
+ - Simulate operations to the Device Provisioning API and Configuration API of the IoT Agent.
183
172
184
- The tester can be started with the following command, from the root folder of
185
- the project:
173
+ The tester can be started with the following command, from the root folder of the project:
186
174
187
175
``` console
188
176
bin/iotAgentTester.js
189
177
```
190
178
191
- From the command-line, the ` help ` command can be used to show a description of
192
- the currently supported features. These are the following:
179
+ From the command-line, the ` help ` command can be used to show a description of the currently supported features. These
180
+ are the following:
193
181
194
182
``` text
195
183
stressInit
@@ -304,30 +292,26 @@ migrate <targetDb> <service> <subservice>
304
292
subservices, use the "*" value.
305
293
```
306
294
307
- The agent session stores transient configuration data about the target Context
308
- Broker and the target IoT Agent. This configuration is independent, and can be
309
- checked with the ` showConfigCb ` and ` showConfigIot ` commands, respectively.
310
- Their values can be changed with the ` configCb ` and ` configIot ` commands
311
- respectively. The new configurations will be deleted upon startup.
295
+ The agent session stores transient configuration data about the target Context Broker and the target IoT Agent. This
296
+ configuration is independent, and can be checked with the ` showConfigCb ` and ` showConfigIot ` commands, respectively.
297
+ Their values can be changed with the ` configCb ` and ` configIot ` commands respectively. The new configurations will be
298
+ deleted upon startup.
312
299
313
300
#### Creating specialized testers
314
301
315
302
The command-line testing tools make use of the
316
- [ command-node Node.js library] ( https://github.com/telefonicaid/command-shell-lib )
317
- for command-line utils. In order to help creating testing tools for IoTAgents of
318
- specific protocols, all the commands of the library tester are offered as a
319
- array that can be directly imported into other Command-Line tools, using the
320
- following steps:
303
+ [ command-node Node.js library] ( https://github.com/telefonicaid/command-shell-lib ) for command-line utils. In order to
304
+ help creating testing tools for IoTAgents of specific protocols, all the commands of the library tester are offered as a
305
+ array that can be directly imported into other Command-Line tools, using the following steps:
321
306
322
- - Require the ` iotagent-node-lib ` command-line module in your command-line
323
- tool:
307
+ - Require the ` iotagent-node-lib ` command-line module in your command-line tool:
324
308
325
309
``` javascript
326
- var iotaCommands = require (' iotagent-node-lib' ).commandLine ;
310
+ var iotaCommands = require (" iotagent-node-lib" ).commandLine ;
327
311
```
328
312
329
- - Initialize the command-line utils (the initialization function takes two
330
- arguments, that will be explained in detail below:
313
+ - Initialize the command-line utils (the initialization function takes two arguments, that will be explained in detail
314
+ below:
331
315
332
316
``` javascript
333
317
iotaCommands .init (configCb, configIot);
@@ -342,56 +326,47 @@ commands = commands.concat(commands, iotaCommands.commands);
342
326
- Execute the command-line interpreter as usual:
343
327
344
328
``` javascript
345
- clUtils .initialize (commandLine .commands , ' IoT Agent tester> ' );
329
+ clUtils .initialize (commandLine .commands , " IoT Agent tester> " );
346
330
```
347
331
348
- The command-line module makes use of two configuration objects. Both can be
349
- shown and edited in the command-line using the provided commands, but a default
350
- value must be present.
332
+ The command-line module makes use of two configuration objects. Both can be shown and edited in the command-line using
333
+ the provided commands, but a default value must be present.
351
334
352
- The Context Broker configuration object holds all the information about the
353
- Context Broker where the IoT Agent to be tested is connected. It MUST contain
354
- the following attributes:
335
+ The Context Broker configuration object holds all the information about the Context Broker where the IoT Agent to be
336
+ tested is connected. It MUST contain the following attributes:
355
337
356
338
- ** host** : host where the Context Broker instance is located.
357
339
- ** port** : port where the Context Broker instance is listening.
358
340
- ** service** : service that will be used in all the NGSI operations.
359
341
- ** subservice** : service that will be used in all the NGSI operations.
360
342
361
- The IoT Agent configuration object holds information about the IoT Agent that is
362
- being tested. It MUST contain the following attributes:
343
+ The IoT Agent configuration object holds information about the IoT Agent that is being tested. It MUST contain the
344
+ following attributes:
363
345
364
346
- ** host** : host where the IoT Agent instance is located.
365
347
- ** port** : port where the IoT Agent instance is listening.
366
- - ** service** : service that will be used to group devices and device
367
- information.
368
- - ** subservice** : subservice that will be used to group devices and device
369
- information.
348
+ - ** service** : service that will be used to group devices and device information.
349
+ - ** subservice** : subservice that will be used to group devices and device information.
370
350
371
351
---
372
352
373
353
## Licence
374
354
375
- The IoT Agent Node Library is licensed under [ Affero General Public License (GPL)
376
- version 3] ( ./LICENSE ) .
355
+ The IoT Agent Node Library is licensed under [ Affero General Public License (GPL) version 3] ( ./LICENSE ) .
377
356
378
357
© 2019 Telefonica Investigación y Desarrollo, S.A.U
379
358
380
-
381
-
382
359
### Are there any legal issues with AGPL 3.0? Is it safe for me to use?
383
360
384
- There is absolutely no problem in using a product licensed under AGPL 3.0. Issues with GPL
385
- (or AGPL) licenses are mostly related with the fact that different people assign different
386
- interpretations on the meaning of the term “derivate work” used in these licenses. Due to this,
387
- some people believe that there is a risk in just _ using_ software under GPL or AGPL licenses
388
- (even without _ modifying_ it).
361
+ There is absolutely no problem in using a product licensed under AGPL 3.0. Issues with GPL (or AGPL) licenses are mostly
362
+ related with the fact that different people assign different interpretations on the meaning of the term “derivate work”
363
+ used in these licenses. Due to this, some people believe that there is a risk in just _ using_ software under GPL or AGPL
364
+ licenses (even without _ modifying_ it).
389
365
390
366
For the avoidance of doubt, the owners of this software licensed under an AGPL-3.0 license
391
367
wish to make a clarifying public statement as follows:
392
368
393
- > Please note that software derived as a result of modifying the source code of this
394
- > software in order to fix a bug or incorporate enhancements is considered a derivative
395
- > work of the product. Software that merely uses or aggregates (i.e. links to) an otherwise
396
- > unmodified version of existing software is not considered a derivative work, and therefore
397
- > it does not need to be released as under the same license, or even released as open source.
369
+ > Please note that software derived as a result of modifying the source code of this software in order to fix a bug or
370
+ > incorporate enhancements is considered a derivative work of the product. Software that merely uses or aggregates (i.e.
371
+ > links to) an otherwise unmodified version of existing software is not considered a derivative work, and therefore it
372
+ > does not need to be released as under the same license, or even released as open source.
0 commit comments